From f21b487bf957872e66e49686d80f3a3e068f5f00 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Wed, 1 Oct 2025 21:44:13 +0200 Subject: [PATCH] tests/hlsl: Add a test for SV_GroupID. --- 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 c6fbc586e..77e38d19d 100644 --- a/tests/hlsl/compute.shader_test +++ b/tests/hlsl/compute.shader_test @@ -60,3 +60,19 @@ todo(glsl | msl) dispatch 13 13 1 probe uav 0 (0, 0) u32(0, 0, 0, 1) probe uav 0 (14, 38) u32(10, 0, 0, 1) probe uav 0 (49, 49) u32(5, 0, 0, 1) + +[compute shader] +RWTexture2D u; + + [numthreads(4, 4, 1)] +void main(uint3 thread_id : SV_DispatchThreadId, uint3 group_id : SV_GroupID) +{ + if (thread_id.x < 50 && thread_id.y < 50) + u[thread_id.xy] = uint4(group_id, 1); +} + +[test] +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)