microsoft / microsoft/DirectXShaderCompiler

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

Open
#4,549 2 comments 0 reactions 1 assignee View on GitHub

@tex3d is already working on this.

Since Apr 23, 2024.

diagnostic
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.