From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- Makefile.am | 1 + tests/hlsl-is-front-face.shader_test | 67 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/hlsl-is-front-face.shader_test
diff --git a/Makefile.am b/Makefile.am index 48991982..23e78d09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -94,6 +94,7 @@ vkd3d_shader_tests = \ tests/hlsl-initializer-struct.shader_test \ tests/hlsl-intrinsic-override.shader_test \ tests/hlsl-invalid.shader_test \ + tests/hlsl-is-front-face.shader_test \ tests/hlsl-ldexp.shader_test \ tests/hlsl-length.shader_test \ tests/hlsl-lerp.shader_test \ diff --git a/tests/hlsl-is-front-face.shader_test b/tests/hlsl-is-front-face.shader_test new file mode 100644 index 00000000..a8d7f8c8 --- /dev/null +++ b/tests/hlsl-is-front-face.shader_test @@ -0,0 +1,67 @@ +[require] +shader model >= 4.0 + +[input layout] +0 r32g32b32a32 float texcoord +0 r32g32 float sv_position + +[vertex buffer 0] +0.0 1.0 0.0 1.0 -2.0 -2.0 +0.0 1.0 0.0 1.0 2.0 -2.0 +0.0 1.0 0.0 1.0 -2.0 2.0 +0.0 1.0 0.0 1.0 2.0 2.0 + +[vertex shader] + +struct vertex +{ + struct + { + float4 texcoord : texcoord; + float4 pos : sv_position; + } m; +}; + +void main(inout struct vertex v) +{ +} + +[pixel shader] +struct input +{ + struct + { + float4 texcoord : texcoord; + } m; +}; + +struct output +{ + struct + { + float4 color : sv_target; + } m; +}; + +struct output main(struct input i, bool face : sv_isfrontface) +{ + struct output o; + o.m.color = i.m.texcoord; + if (face) + o.m.color += float4(1.0, 1.0, 1.0, 1.0); + return o; +} + +[test] +draw triangle strip 4 +probe all rgba (0.0, 1.0, 0.0, 1.0) + +[vertex buffer 0] +0.0 1.0 0.0 1.0 -2.0 -2.0 +0.0 1.0 0.0 1.0 -2.0 2.0 +0.0 1.0 0.0 1.0 2.0 -2.0 +0.0 1.0 0.0 1.0 2.0 2.0 + +[test] +draw triangle strip 4 +probe all rgba (1.0, 2.0, 1.0, 2.0)