Skip to content

[HLSL] Preserve coherence qualifiers on resource flat-conversions#8583

Open
llvm-beanz wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:fix-flat-cast
Open

[HLSL] Preserve coherence qualifiers on resource flat-conversions#8583
llvm-beanz wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:fix-flat-cast

Conversation

@llvm-beanz

@llvm-beanz llvm-beanz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

PerformHLSLConversion forced the ICK_Flat_Conversion cast target to the structural/unqualified type, discarding the 'globallycoherent' (and 'reordercoherent') AttributedType. As a result, the converted expression's
type no longer reflected the coherence of its destination, forcing consumers
to reconstruct that information from declarations.

Re-apply the coherence AttributedType to the flat-conversion result when the
target is a resource type, so the converted expression's type carries the
coherence of its destination (e.g. a ResourceDescriptorHeap[] access used to
initialize a 'globallycoherent' resource).

Assisted by Claude Opus 4.8

PerformHLSLConversion forced the ICK_Flat_Conversion cast target to the
structural/unqualified type, discarding the 'globallycoherent' (and
'reordercoherent') AttributedType. As a result, the converted
expression's
type no longer reflected the coherence of its destination, forcing
consumers
to reconstruct that information from declarations.

Re-apply the coherence AttributedType to the flat-conversion result
when the
target is a resource type, so the converted expression's type carries
the
coherence of its destination (e.g. a ResourceDescriptorHeap[] access
used to
initialize a 'globallycoherent' resource).

@bob80905 bob80905 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but there are 2 probably basic questions I have.

  1. Oddly in the github view, globallycoherent is highlighted as a keyword in red, but reordercoherent is not. Why is that?
  2. ResourceDescriptorHeap isn't defined anywhere, yet the tests work. Is this a variable that exists implicitly in all shaders? I don't think I've seen this before.

@llvm-beanz

Copy link
Copy Markdown
Collaborator Author

LGTM, but there are 2 probably basic questions I have.

  1. Oddly in the github view, globallycoherent is highlighted as a keyword in red, but reordercoherent is not. Why is that?

It is because the GitHub syntax plugin isn't up-to-date with SM 6.9. I think GitHub uses this format grammar, which hasn't been updated in 7 years...

  1. ResourceDescriptorHeap isn't defined anywhere, yet the tests work. Is this a variable that exists implicitly in all shaders? I don't think I've seen this before.

ResourceDescriptorHeap and SamplerDescriptorHeap are part of SM 6.6's dynamic resources.

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

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants