From 568776bbf6f4b391b70ad4ae18f24c6fce358468 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Mon, 28 Oct 2024 10:37:52 -0500 Subject: [PATCH] tests: Add a test for uninitialized varyings. --- Makefile.am | 1 + tests/hlsl/uninitialized-varyings.shader_test | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/hlsl/uninitialized-varyings.shader_test diff --git a/Makefile.am b/Makefile.am index ff42613d..88aa8d65 100644 --- a/Makefile.am +++ b/Makefile.am @@ -268,6 +268,7 @@ vkd3d_shader_tests = \ tests/hlsl/unbounded-array-5.1.shader_test \ tests/hlsl/uniform-parameters.shader_test \ tests/hlsl/uniform-semantics.shader_test \ + tests/hlsl/uninitialized-varyings.shader_test \ tests/hlsl/unorm-snorm.shader_test \ tests/hlsl/unroll.shader_test \ tests/hlsl/unsigned.shader_test \ diff --git a/tests/hlsl/uninitialized-varyings.shader_test b/tests/hlsl/uninitialized-varyings.shader_test new file mode 100644 index 00000000..6d4d1b0b --- /dev/null +++ b/tests/hlsl/uninitialized-varyings.shader_test @@ -0,0 +1,46 @@ +% Uninitialized varyings behave generally quite different across different +% drivers. This test is limited to what is more or less consistent. + +[require] +shader model < 4.0 + +[pixel shader] +% The alpha channel is not consistent here. +float4 main(float4 v : texcoord0) : sv_target +{ + return float4(v.xyz, 1); +} + +[test] +clear rtv 0 1 0 0 1 +todo draw quad +probe (0, 0) rgba (0, 0, 0, 1) + + +[pixel shader] +float4 main(float2 v : texcoord3, float3 w : texcoord1) : sv_target +{ + return float4(v.xy, w.yz); +} + +[test] +clear rtv 0 1 0 0 1 +todo draw quad +probe (0, 0) rgba (0, 0, 0, 0) + + +[require] +% 2.0 consistently yields white. 3.0 has no consistent results. +% color1 also has no consistent results in 2.0 or 3.0. +shader model < 3.0 + +[pixel shader] +float4 main(float4 v : color0) : sv_target +{ + return v; +} + +[test] +clear rtv 0 1 0 0 1 +todo draw quad +probe (0, 0) rgba (1, 1, 1, 1)