Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- Makefile.am | 4 ++++ tests/hlsl-majority-pragma.shader_test | 21 +++++++++++++++++++++ tests/hlsl-majority-typedef.shader_test | 22 ++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 tests/hlsl-majority-pragma.shader_test create mode 100644 tests/hlsl-majority-typedef.shader_test
diff --git a/Makefile.am b/Makefile.am index 7911a8ea..415e6862 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,6 +53,8 @@ vkd3d_shader_tests = \ tests/conditional.shader_test \ tests/hlsl-array-dimension.shader_test \ tests/hlsl-comma.shader_test \ + tests/hlsl-majority-pragma.shader_test \ + tests/hlsl-majority-typedef.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-vector-indexing.shader_test \ @@ -189,6 +191,8 @@ XFAIL_TESTS = \ tests/conditional.shader_test \ tests/hlsl-array-dimension.shader_test \ tests/hlsl-comma.shader_test \ + tests/hlsl-majority-pragma.shader_test \ + tests/hlsl-majority-typedef.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-vector-indexing.shader_test \ diff --git a/tests/hlsl-majority-pragma.shader_test b/tests/hlsl-majority-pragma.shader_test new file mode 100644 index 00000000..e7fc75cd --- /dev/null +++ b/tests/hlsl-majority-pragma.shader_test @@ -0,0 +1,21 @@ +[pixel shader] +#pragma pack_matrix(row_major) +uniform float2x2 r; +#pragma pack_matrix(column_major) +uniform float2x2 c; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = mul(r, float2(0.5, 0.6)); + ret.zw = mul(c, float2(0.5, 0.6)); + return ret; +} + +[test] +uniform 0 float4 0.1 0.2 0.0 0.0 +uniform 4 float4 0.3 0.4 0.0 0.0 +uniform 8 float4 0.1 0.3 0.0 0.0 +uniform 12 float4 0.2 0.4 0.0 0.0 +draw quad +probe all rgba (0.17, 0.39, 0.17, 0.39) 1 diff --git a/tests/hlsl-majority-typedef.shader_test b/tests/hlsl-majority-typedef.shader_test new file mode 100644 index 00000000..1460e9a0 --- /dev/null +++ b/tests/hlsl-majority-typedef.shader_test @@ -0,0 +1,22 @@ +[pixel shader] +typedef float2x2 matrix_t; +typedef row_major matrix_t row_matrix_t; +typedef column_major matrix_t col_matrix_t; +uniform row_matrix_t r; +uniform col_matrix_t c; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = mul(r, float2(0.5, 0.6)); + ret.zw = mul(c, float2(0.5, 0.6)); + return ret; +} + +[test] +uniform 0 float4 0.1 0.2 0.0 0.0 +uniform 4 float4 0.3 0.4 0.0 0.0 +uniform 8 float4 0.1 0.3 0.0 0.0 +uniform 12 float4 0.2 0.4 0.0 0.0 +draw quad +probe all rgba (0.17, 0.39, 0.17, 0.39) 1