diff --git a/tests/hlsl/tgsm.shader_test b/tests/hlsl/tgsm.shader_test index 51e89d9b..21ad9ebe 100644 --- a/tests/hlsl/tgsm.shader_test +++ b/tests/hlsl/tgsm.shader_test @@ -161,3 +161,36 @@ void main(uint local_idx : SV_GroupIndex) [test] todo(sm<6) dispatch 1 1 1 probe uav 1 (0) rui (39) + +[require] +shader model >= 6.2 +native-16-bit + +[uav 1] +format r32-typeless +size (raw_buffer, 4) + +0xf000f 0xf000f 0xf000f 0xf000f + +[compute shader] +RWByteAddressBuffer u : register(u1); +groupshared uint16_t m[4]; + + [numthreads(4, 1, 1)] +void main(uint local_idx : SV_GroupIndex, uint group_id : SV_GroupID) +{ + uint16_t id = (uint16_t)group_id.x; + /* 16-bit atomic ops are not supported. */ + m[local_idx] = id + 8 * (local_idx + 1); + GroupMemoryBarrierWithGroupSync(); + m[local_idx] += m[local_idx ^ 1]; + GroupMemoryBarrierWithGroupSync(); + u.Store(8 * group_id.x + 2 * local_idx, m[local_idx]); +} + +[test] +dispatch 2 1 1 +probe uav 1 (0) rui(0x180018) +probe uav 1 (1) rui(0x380038) +probe uav 1 (2) rui(0x1a001a) +probe uav 1 (3) rui(0x3a003a)