Skip to content

Comments

Add test for compute shader semantics#752

Open
Keenuts wants to merge 2 commits intollvm:mainfrom
Keenuts:compute
Open

Add test for compute shader semantics#752
Keenuts wants to merge 2 commits intollvm:mainfrom
Keenuts:compute

Conversation

@Keenuts
Copy link
Contributor

@Keenuts Keenuts commented Feb 18, 2026

Add testing for compute shader system semantics on a 2x2x2 dispatch.

@Keenuts Keenuts requested a review from s-perron February 19, 2026 09:09
@Keenuts Keenuts enabled auto-merge (squash) February 19, 2026 12:56
Copy link
Contributor

@s-perron s-perron left a comment

Choose a reason for hiding this comment

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

it is hard to look at the results and know that they are correct. I need to look at an entry in OUT_DTID and make sure it is at the correct index. I then need to go to OUT_GTID and determine the correct value for the DTID in the first array. Then I need to go to a third.

It would be nice to have all of the related information together with appropriate comments to explain the results.

RWStructuredBuffer<uint> OUT_GI : register(u2);

[numthreads(2, 2, 2)]
void main(uint3 DTID : SV_DispatchThreadID, uint3 GID : SV_GroupID, uint3 GTID : SV_GroupThreadID, uint GI : SV_GroupIndex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't use GID.

Comment on lines +2 to +3
RWStructuredBuffer<uint> OUT_DTID : register(u0);
RWStructuredBuffer<uint> OUT_GTID : register(u1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment explaining why you don't simply use uint3. I assume it is because we currently get the alignment wrong.

# RUN: %dxc_target -T cs_6_0 -Fo %t.o %t/system_values.hlsl
# RUN: %offloader %t/system_values.yaml %t.o

# Metal is reporting DispatchThreadID value ot 8 for the x dimension.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Metal is reporting DispatchThreadID value ot 8 for the x dimension.
# Metal is reporting DispatchThreadID value of 8 for the x dimension.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants