Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- Makefile.am | 2 + tests/hlsl-invalid.shader_test | 60 +++++++++++++++++++++++ tests/hlsl-storage-qualifiers.shader_test | 20 ++++++++ 3 files changed, 82 insertions(+) create mode 100644 tests/hlsl-storage-qualifiers.shader_test
diff --git a/Makefile.am b/Makefile.am index 542b66e7..e8537864 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,6 +64,7 @@ vkd3d_shader_tests = \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-static-initializer.shader_test \ + tests/hlsl-storage-qualifiers.shader_test \ tests/hlsl-struct-assignment.shader_test \ tests/hlsl-struct-semantics.shader_test \ tests/hlsl-vector-indexing.shader_test \ @@ -261,6 +262,7 @@ XFAIL_TESTS = \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-static-initializer.shader_test \ + tests/hlsl-storage-qualifiers.shader_test \ tests/hlsl-struct-assignment.shader_test \ tests/hlsl-struct-semantics.shader_test \ tests/hlsl-vector-indexing.shader_test \ diff --git a/tests/hlsl-invalid.shader_test b/tests/hlsl-invalid.shader_test index 0711d266..72055989 100644 --- a/tests/hlsl-invalid.shader_test +++ b/tests/hlsl-invalid.shader_test @@ -121,6 +121,12 @@ float4 main(in float4 i) : sv_target return 0; }
+[pixel shader fail] +float4 main(float4 i) : sv_target +{ + return 0; +} + [pixel shader fail] struct {float4 a;};
@@ -159,3 +165,57 @@ void main(out struct output o) o.t = float4(0, 0, 0, 0); o.a = 0; } + +[pixel shader fail] +uniform in float4 f; +float4 main() : sv_target { return 0; } + +[pixel shader fail] +in float4 f; +float4 main() : sv_target { return 0; } + +[pixel shader fail] +static uniform float4 f; +float4 main() : sv_target { return 0; } + +[pixel shader fail] +void main(out uniform float4 o : sv_target) +{ + o = 0; +} + +[pixel shader fail] +void sub(out uniform float4 o) +{ + o = 0; +} + +void main(out float4 o : sv_target) +{ + sub(o); +} + +[pixel shader fail] +void sub(in out uniform float4 o) +{ +} + +void main(out float4 o : sv_target) +{ + o = 0; + sub(o); +} + +[pixel shader fail] +float4 main(void) : sv_target +{ + uniform float f; + return 0; +} + +[pixel shader fail] +float4 main(void) : sv_target +{ + in float f; + return 0; +} diff --git a/tests/hlsl-storage-qualifiers.shader_test b/tests/hlsl-storage-qualifiers.shader_test new file mode 100644 index 00000000..0e22bb6f --- /dev/null +++ b/tests/hlsl-storage-qualifiers.shader_test @@ -0,0 +1,20 @@ +[pixel shader] +void sub2(in uniform float4 i, out float4 o) +{ + o = i; +} + +void sub(float a, uniform float b, in float c, uniform in float d, out float4 o) +{ + sub2(float4(a, b, c, d), o); +} + +void main(in uniform float a, uniform float b, out float4 o : sv_target) +{ + sub(a, b, 0.3, 0.4, o); +} + +[test] +uniform 0 float4 0.1 0.2 0.0 0.0 +draw quad +probe all rgba (0.1, 0.2, 0.3, 0.4)