From 5790056c445c6e393806d93ad6924e996398f44b Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 9 May 2024 12:22:03 +1000 Subject: [PATCH] tests/hlsl: Add a test for WaveReadLaneAt() with a non-uniform index. --- tests/hlsl/wave-ops-uint.shader_test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/hlsl/wave-ops-uint.shader_test b/tests/hlsl/wave-ops-uint.shader_test index fd7d7695..2e0bff40 100644 --- a/tests/hlsl/wave-ops-uint.shader_test +++ b/tests/hlsl/wave-ops-uint.shader_test @@ -165,6 +165,26 @@ probe uav 1 (2) rui (18) probe uav 1 (3) rui (18) +[compute shader] +RWBuffer u0; +RWBuffer u1; + + [numthreads(4, 1, 1)] +void main(uint id : SV_GroupIndex) +{ + uint i = u0[id] + u0[id ^ 1]; + // Non-uniform lane index + u1[id] = WaveReadLaneAt(i, (id + 2) & 3); +} + +[test] +todo dispatch 4 1 1 +probe uav 1 (0) rui (18) +probe uav 1 (1) rui (18) +probe uav 1 (2) rui (23) +probe uav 1 (3) rui (23) + + [compute shader] RWBuffer u0; RWBuffer u1;