Skip to content

[SPIR-V] Compiler crashes on ray tracing shader with statically declared resources #8220

@alexandreLBarrett

Description

@alexandreLBarrett

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

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashneeds-triageAwaiting triagespirvWork related to SPIR-V

Type

No type

Projects

Status

Triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions