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