-
Notifications
You must be signed in to change notification settings - Fork 825
Implement GetGroupWaveIndex and GetGroupWaveCount #7959
New issue
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ With the latest revision this PR passed the Python code formatter. |
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
|
Could you add something to ReleaseNotes.md please? |
damyanp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have several SM 6.10 features staged in PRs now. In order to reduce conflicts, I'd like to suggest we make a separate PR reserving the HLSL Intrinsics and the experimental DXIL ops ahead of the rest of the changes.
This means a PR with just the additions to gen_intrin_main.txt, hctdb.py, nullptr , generated changes (hlsl_intrinsic_opcodes.json, DxilConstants.h, DXIL.rst, DxilInstructions.h, DxilOperations.cpp), and initial EmptyLower table entries for gLowerTable in HLOperationLower.cpp.
Of course, this will also depend on getting #7947 in first.
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put a PR up for reserving these operations here: #7995.
Once that's merged, this should be rebased onto main, but you won't want some of your changes here.
You don't need the changes in the generated files, or the addition of the HLSL instrinsics in gen_intrin_main.txt or DXIL ops in hctdb.py, or the HL op reservations in hlsl_intrinsic_opcodes.json.
You'll want to take what's in main for HLOperationLower.cpp's gLowerTable, then update the lowering function to TranslateWaveToVal.
|
I did a rebase and a test update, while catching a fault with the ordering of the lowering table entries in the opcode reservation change. Since it's not based on this branch (it's a rebase), I put the branch up here: You can reset your branch to this and iterate from there to save a bunch of work. |
84e7262 to
2388db2
Compare
tools/clang/test/HLSLFileCheckLit/hlsl/intrinsics/wave/group-wave-index.hlsl
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
s-perron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SPIR-V changes look good. I did not review the rest.
| @@ -0,0 +1,82 @@ | |||
| ; RUN: not %dxv %s 2>&1 | FileCheck %s | |||
|
|
|||
| ; CHECK: error: Function requires a visible group, but is called from a shader without one. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this mechanism is a bit of a backstop, and doesn't provide very clear diagnostic. I still think it would be beneficial to have a dedicated check and message for this case, especially since there is no front-end diagnostic that will catch it. But it's not critical that we add that at this time.
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I had a minor comment about a dedicated diagnostic for thread-launch node shader, but it's not absolutely necessary to do that.
Implement Group Wave Index and Group Wave Count as proposed by:
https://github.com/microsoft/hlsl-specs/blob/main/proposals/0048-group-wave-index.md
Added two new intrinsics:
Limited to Shader Model 6.10 and Compute, Mesh, Node and Amp. shaders.
Added basic test.