Skip to content

[HLSL] Misleading error message when using a UAV register for a raytracing acceleration structure #4549

Open

Description

Functional impact

This bug provides a misleading error message when compiling a shader with a semantic error. This causes lots of confusion and doesn't lead the developer toward fixing the error

Minimal repro steps

  • Write a shader with the HLSL code:
RaytracingAccelerationStructure opaque_as : register(u0);

Texture2D<float> depth_buffer : register(t0);
  • Try to compile the shader
  • Observe an error message saying that depth_buffer and opaque_as overlap their descriptors

Expected result

I'd expect the error message to say something like "raytracing acceleration structures must use SRV registers instead of UAV registers"

Actual result

The compiler gives an error message Shaders\Shadows\shadow.pixel.dxil.hlsl(17,1): error GDA5BD758: resource depth_buffer at register 0 overlaps with resource opaque_as at register 0, space 0

Further technical details

Brian Favela speculated that the HLSL compiler is assuming that a RT AS is always using a SRV register and ignoring the HLSL code that incorrectly says to use a UAV register

Activity

  1. added
    diagnostic
    and removed
    needs-triage
    on Apr 23, 2024
  2. damyanp commented on Apr 23, 2024

    @damyanp
    Member

    Tex Riddell (@tex3d) - can you do some initial investigation to help us repro and scope the issue.

  3. damyanp commented on Sep 5, 2026

    @damyanp
    Member

    Ported from a note on Internal bug 40439386, dated 2022-07-18:

    The fix has two parts: validation should ensure that the resource is assigned the correct register type, and the compiler should then emit a clear diagnostic describing the invalid register assignment.

    Assisted by GitHub Copilot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

diagnostic

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions