From a815e625d6717d6ba36527f836244ea059e46e14 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Wed, 1 Oct 2025 21:46:26 +0200 Subject: [PATCH] tests/hlsl: Add a test for SV_GroupThreadID. --- tests/hlsl/compute.shader_test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/hlsl/compute.shader_test b/tests/hlsl/compute.shader_test index 77e38d19d..fa78639c4 100644 --- a/tests/hlsl/compute.shader_test +++ b/tests/hlsl/compute.shader_test @@ -76,3 +76,19 @@ todo(glsl | msl) dispatch 13 13 1 probe uav 0 (0, 0) u32(0, 0, 0, 1) probe uav 0 (14, 38) u32(3, 9, 0, 1) probe uav 0 (49, 49) u32(12, 12, 0, 1) + +[compute shader] +RWTexture2D u; + + [numthreads(4, 4, 1)] +void main(uint3 thread_id : SV_DispatchThreadId, uint3 group_thread_id : SV_GroupThreadID) +{ + if (thread_id.x < 50 && thread_id.y < 50) + u[thread_id.xy] = uint4(group_thread_id, 1); +} + +[test] +todo(glsl | msl) dispatch 13 13 1 +probe uav 0 (0, 0) u32(0, 0, 0, 1) +probe uav 0 (14, 39) u32(2, 3, 0, 1) +probe uav 0 (49, 49) u32(1, 1, 0, 1)