We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[branch]
switch
HLSL supports the branch attribute on switch statements. Clang currently errors if you apply the [branch] attribute to a switch statement.
branch
RWBuffer<uint4> Buf; [numthreads(8,1,1)] void main(uint GI : SV_GroupIndex) { uint4 Val = Buf[GI]; [branch] switch (Val.x) { case 0: Buf[GI] = Val.xxxx; break; case 1: Buf[GI] = Val.yyyy; break; case 2: Buf[GI] = Val.zzzz; break; default: Buf[GI] = Val.wwww; break; } }
Godbolt
The text was updated successfully, but these errors were encountered:
We need to do some investigation before we attempt to estimate this.
Sorry, something went wrong.
[HLSL] Add support to branch/flatten attributes to switch (#131739)
567b0f8
closes: [#125754](#125754) --------- Co-authored-by: joaosaffran <[email protected]>
Automerge: [HLSL] Add support to branch/flatten attributes to switch …
09b4ede
…(#131739) closes: [#125754](llvm/llvm-project#125754) --------- Co-authored-by: joaosaffran <[email protected]>
@llvm/issue-subscribers-clang-codegen
Author: Chris B (llvm-beanz)
RWBuffer<uint4> Buf; [numthreads(8,1,1)] void main(uint GI : SV_GroupIndex) { uint4 Val = Buf[GI]; [branch] switch (Val.x) { case 0: Buf[GI] = Val.xxxx; break; case 1: Buf[GI] = Val.yyyy; break; case 2: Buf[GI] = Val.zzzz; break; default: Buf[GI] = Val.wwww; break; } }
joaosaffran
Successfully merging a pull request may close this issue.
HLSL supports the
branch
attribute onswitch
statements. Clang currently errors if you apply the[branch]
attribute to a switch statement.Godbolt
The text was updated successfully, but these errors were encountered: