-
Notifications
You must be signed in to change notification settings - Fork 807
Allow derivatives in coalescing nodes #7942
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
Per the spec ( https://github.com/microsoft/DirectX-Specs/blob/master/d3d/WorkGraphs.md#quad-and-derivative-operation-semantics ) derivatives are allowed in all but thread launch nodes, but the validator disallowed them in coalescing nodes. This changes the validator to allow derivatives in coalescind nodes and adds testing for derivatives in coalescing and broadcast nodes. Fixes microsoft#7723
| #define AS 2 | ||
| #define MS 3 | ||
| #define BNS 4 | ||
| #define CNS 5 |
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.
Add an error check if we try to use derivatives with Thread Launch?
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 had the same thought! But that test already exists: https://github.com/microsoft/DirectXShaderCompiler/blob/main/tools/clang/test/HLSLFileCheck/validation/callgraph/deriv-in-nested-fn-node-lib68-launch.ll#L6
| res += input.SampleCmp(cmpSamp, uv, cmpVal, uint2(-3, 4)); | ||
| res += input.SampleCmp(cmpSamp, uv, cmpVal, uint2(-4, 6), DTid.z); | ||
| res += input.SampleCmp(cmpSamp, uv, cmpVal, uint2(-5, 7), DTid.z, status); | ||
| res += input.SampleCmp(cmpSamp, uv, cmpVal, uint2(-4, 6), GI); |
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.
why was this needed?
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 suppose it wasn't if I just converted the GTid that replaced DTid with uint3. That replacement took place because all launch types support that semantic value and coalescing doesn't support DispatchThreadID. The uses are pretty arbitrary, just using what values are available.
Per the spec ( https://github.com/microsoft/DirectX-Specs/blob/master/d3d/WorkGraphs.md#quad-and-derivative-operation-semantics ) derivatives are allowed in all but thread launch nodes, but the validator disallowed them in coalescing nodes.
This changes the validator to allow derivatives in coalescind nodes and adds testing for derivatives in coalescing and broadcast nodes.
Fixes #7723