From: Francisco Casas fcasas@codeweavers.com
--- Makefile.am | 1 + tests/array-index-expr.shader_test | 47 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 tests/array-index-expr.shader_test
diff --git a/Makefile.am b/Makefile.am index e06d0eeb..b5f7159e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,6 +50,7 @@ vkd3d_shader_tests = \ tests/arithmetic-int.shader_test \ tests/arithmetic-int-uniform.shader_test \ tests/arithmetic-uint.shader_test \ + tests/array-index-expr.shader_test \ tests/array-parameters.shader_test \ tests/asfloat.shader_test \ tests/asuint.shader_test \ diff --git a/tests/array-index-expr.shader_test b/tests/array-index-expr.shader_test new file mode 100644 index 00000000..231915a3 --- /dev/null +++ b/tests/array-index-expr.shader_test @@ -0,0 +1,47 @@ +[pixel shader todo] +uniform float i; + +float4 main() : SV_TARGET +{ + float4 arr = float4(11.0, 12.0, 13.0, 14.0); + return arr[i]; +} + +[test] +uniform 0 float 0 +todo draw quad +todo probe all rgba (11.0, 11.0, 11.0, 11.0) +uniform 0 float 1 +todo draw quad +todo probe all rgba (12.0, 12.0, 12.0, 12.0) +uniform 0 float 2 +todo draw quad +todo probe all rgba (13.0, 13.0, 13.0, 13.0) +uniform 0 float 3 +todo draw quad +todo probe all rgba (14.0, 14.0, 14.0, 14.0) + + +[pixel shader todo] +uniform float i; + +float4 main() : SV_TARGET +{ + int4 arr_i = int4(21, 22, 23, 24); + bool4 arr_b = bool4(true, false, true, false); + return float4(arr_i[i], arr_b[i], arr_i[3 - i], arr_b[3 - i]); +} + +[test] +uniform 0 float 0 +todo draw quad +todo probe all rgba (21.0, 1.0, 24.0, 0.0) +uniform 0 float 1 +todo draw quad +todo probe all rgba (22.0, 0.0, 23.0, 1.0) +uniform 0 float 2 +todo draw quad +todo probe all rgba (23.0, 1.0, 22.0, 0.0) +uniform 0 float 3 +todo draw quad +todo probe all rgba (24.0, 0.0, 21.0, 1.0)