Disallow volatile keyword#8397
Merged
Merged
Conversation
Contributor
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
alsepkow
requested changes
Apr 23, 2026
Contributor
There was a problem hiding this comment.
A couple comments from @inbelic and I.
I think we also need an 'assisted by AI' in the PR description?
It would also be good to mention the scenario capturing this for llvm llvm/wg-hlsl#300 as without it it wasn't clear that we actually don't support volatile. Even copilot told me HLSL supports it (And in some ways it was right! It tried compiling with it).
AnastaZIuk
referenced
this pull request
in Devsh-Graphics-Programming/Nabla
May 14, 2026
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.
volatileis not a valid keyword in HLSL, it is meaningless in this language.However, it comes as a result of the fact that HLSL is build on a C/C++ compiler, so there are some C++ artifacts that are part of the language.
This scenario goes into more detail: llvm/wg-hlsl#300
Though DXC currently does and seems to always have compiled with the volatile keyword, this is not sensible and should be disallowed.
Fixes #8391
Assisted by: Github Copilot