[0037] Describe semantic diagnostics for textures and samplers#423
Open
Icohedron wants to merge 3 commits into
Open
[0037] Describe semantic diagnostics for textures and samplers#423Icohedron wants to merge 3 commits into
Icohedron wants to merge 3 commits into
Conversation
Icohedron
commented
May 19, 2026
Comment on lines
+598
to
+601
| Clang will diagnose use of derivative-requiring methods in unsupported shader | ||
| stages at the sema level using [availability attributes](0001-availability-diagnostics.md)). | ||
| This differs from DXC which defers the rejection of `Sample`, `SampleBias`, | ||
| `SampleCmp`, and `SampleCmpBias` in unsupported shaders to the DXIL validator |
Contributor
Author
There was a problem hiding this comment.
I assume this is how we want to do this in Clang so that we don't have to rely on the DXIL validator to report errors.
alsepkow
reviewed
May 19, 2026
This was referenced May 20, 2026
Open
bogner
reviewed
May 27, 2026
Comment on lines
+578
to
+581
| On the Vulkan target, `GatherCmp` operations only support component 0 (Red). | ||
| `GatherCmpGreen`, `GatherCmpBlue`, and `GatherCmpAlpha` are rejected. | ||
| This is because SPIR-V's [OpImageDrefGather](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpImageDrefGather) | ||
| does not have a Component operand and always gathers component 0. |
Collaborator
There was a problem hiding this comment.
This should explicitly state what happens with GatherCmpRed I think. Calling out that the others are rejected without saying what that one does is confusing.
Contributor
Author
There was a problem hiding this comment.
There is already a brief description of what GatherCmpRed does earlier in the proposal: https://github.com/llvm/wg-hlsl/blob/main/proposals/0037-texture-and-sampler-types.md#gathercmp-gathercmpalpha-gathercmpblue-gathercmpred-gathercmpgreen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates proposal 0037 to include documentation of semantic diagnostics specific to textures and samplers and describes how Clang will implement them.
This includes:
The section on Clang HLSL builtins has also been edited to be more general rather than specific to Texture2D, referring to the newly added table of expected dimensionality and types for specific vector parameter sizes.
I have also added myself as an author to the proposal, since I have made significant edits and contributions to it.