Skip to content

Conversation

@pow2clk
Copy link
Collaborator

@pow2clk pow2clk commented Nov 21, 2025

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

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this needed?

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Derivative operations in Work Graph Coalescing nodes

2 participants