Skip to content

[Crash] VariablePointers* capabilities not enabled when targeting SPIRV backend #8581

Description

@bob80905

This stack trace:

FAIL: OffloadTest-vk :: Feature/LocalResources/local_resource_if_else_array_elements.test (302 of 608)
******************** TEST 'OffloadTest-vk :: Feature/LocalResources/local_resource_if_else_array_elements.test' FAILED ********************
Exit Code: 2147500037

Command Output (stdout):
--
# RUN: at line 70
c:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\split-file.exe C:\actions-runner\_work\offload-test-suite\offload-test-suite\OffloadTest\test\Feature\LocalResources\local_resource_if_else_array_elements.test C:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\vk\Feature\LocalResources\Output\local_resource_if_else_array_elements.test.tmp
# executed command: 'c:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\split-file.exe' 'C:\actions-runner\_work\offload-test-suite\offload-test-suite\OffloadTest\test\Feature\LocalResources\local_resource_if_else_array_elements.test' 'C:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\vk\Feature\LocalResources\Output\local_resource_if_else_array_elements.test.tmp'
# RUN: at line 71
"C:\actions-runner\_work\offload-test-suite\offload-test-suite\DXC\build\bin\dxc.exe" -spirv -fspv-target-env=vulkan1.3 -T cs_6_0 -Fo C:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\vk\Feature\LocalResources\Output\local_resource_if_else_array_elements.test.tmp.o C:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\vk\Feature\LocalResources\Output\local_resource_if_else_array_elements.test.tmp/source.hlsl
# executed command: 'C:\actions-runner\_work\offload-test-suite\offload-test-suite\DXC\build\bin\dxc.exe' -spirv -fspv-target-env=vulkan1.3 -T cs_6_0 -Fo 'C:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\vk\Feature\LocalResources\Output\local_resource_if_else_array_elements.test.tmp.o' 'C:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\vk\Feature\LocalResources\Output\local_resource_if_else_array_elements.test.tmp/source.hlsl'
# .---command stderr------------
# | fatal error: generated SPIR-V is invalid: Using pointers with OpPhi requires capability VariablePointers or VariablePointersStorageBuffer
# |   %31 = OpPhi %_ptr_StorageBuffer_type_RWByteAddressBuffer %29 %27 %30 %28
# | 
# | note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
# | 
# `-----------------------------
# error: command failed with exit status: 0x80004005

--

********************

Results from compiling this HLSL with -T cs_6_0:

RWByteAddressBuffer In : register(u0);
RWByteAddressBuffer OutArr[] : register(u1);

[numthreads(1,1,1)]
void main(uint3 tid : SV_DispatchThreadID) {
    RWByteAddressBuffer Out;
    if (tid.x == 0) {
        Out = OutArr[0];
    } else {
        Out = OutArr[1];
    }
    Out.Store(0, In.Load(0));
}

We should not be encountering this spirv codegen error. It appears that we must enable the VariablePointers* capabilities when Targeting SPIRV in DXC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions