Description
The compiler crashes when compiling a ray tracing shader with a resource declared as static in the global scope.
Steps to Reproduce
Trying to compile this code with -T lib_6_8 -spirv -fspv-target-env=vulkan1.3 will cause a segmentation fault.
static RWTexture2D<float4> OutputTexture = ResourceDescriptorHeap[0];
[shader("raygeneration")]
void RayGenMain()
{
OutputTexture[DispatchRaysIndex().xy] = float4(1, 1, 1, 1.0f);
}
see on Compiler Explorer: https://godbolt.org/z/nbnzG54dd
Actual Behavior
The code compiles correctly and allows the shader to access the resource.
Environment
- DXC version 1.8.2505.1
- Host Operating System Windows 11 Pro 25H2