Zebediah Figura : tests: Use SM1-compatible uniform layouts in shader tests.

Alexandre Julliard julliard at winehq.org
Tue Mar 8 15:46:30 CST 2022


Module: vkd3d
Branch: master
Commit: efd9e9e9902811ffa80aa5be864171ef449a8b61
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=efd9e9e9902811ffa80aa5be864171ef449a8b61

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Mar  7 19:55:42 2022 -0600

tests: Use SM1-compatible uniform layouts in shader tests.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tests/hlsl-clamp.shader_test              | 4 ++--
 tests/hlsl-storage-qualifiers.shader_test | 7 ++++---
 tests/math.shader_test                    | 4 ++--
 tests/max.shader_test                     | 8 ++++----
 tests/pow.shader_test                     | 4 ++--
 5 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/tests/hlsl-clamp.shader_test b/tests/hlsl-clamp.shader_test
index 73f396ff..8e26270c 100644
--- a/tests/hlsl-clamp.shader_test
+++ b/tests/hlsl-clamp.shader_test
@@ -1,7 +1,7 @@
 [pixel shader]
-float4 main(uniform float u, uniform float v, uniform float w) : sv_target
+float4 main(uniform float3 u) : sv_target
 {
-    return float4(clamp(u, v, w), clamp(0.9, v, w), clamp(u, -0.5, w), clamp(0.6, -0.4, 0.3));
+    return float4(clamp(u.x, u.y, u.z), clamp(0.9, u.y, u.z), clamp(u.x, -0.5, u.z), clamp(0.6, -0.4, 0.3));
 }
 
 [test]
diff --git a/tests/hlsl-storage-qualifiers.shader_test b/tests/hlsl-storage-qualifiers.shader_test
index 0e22bb6f..00e7b836 100644
--- a/tests/hlsl-storage-qualifiers.shader_test
+++ b/tests/hlsl-storage-qualifiers.shader_test
@@ -9,12 +9,13 @@ 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)
+void main(in uniform float4 a, uniform float4 b, out float4 o : sv_target)
 {
-    sub(a, b, 0.3, 0.4, o);
+    sub(a.x, b.x, 0.3, 0.4, o);
 }
 
 [test]
-uniform 0 float4 0.1 0.2 0.0 0.0
+uniform 0 float4 0.1 0.0 0.0 0.0
+uniform 4 float4 0.2 0.0 0.0 0.0
 draw quad
 probe all rgba (0.1, 0.2, 0.3, 0.4)
diff --git a/tests/math.shader_test b/tests/math.shader_test
index 2fe59a08..6bd9656d 100644
--- a/tests/math.shader_test
+++ b/tests/math.shader_test
@@ -1,7 +1,7 @@
 [pixel shader]
-float4 main(uniform float u, uniform float v, uniform float w, uniform float x,
-            uniform float y, uniform float z) : SV_TARGET
+float4 main(uniform float4 a, uniform float2 b) : SV_TARGET
 {
+    float u = a.x, v = a.y, w = a.z, x = a.w, y = b.x, z = b.y;
     return float4(x * y - z / w + --u / -v,
             z * x / y + w / -v,
             u + v - w,
diff --git a/tests/max.shader_test b/tests/max.shader_test
index 56c9a84e..50083f33 100644
--- a/tests/max.shader_test
+++ b/tests/max.shader_test
@@ -1,7 +1,7 @@
 [pixel shader]
-float4 main(uniform float u, uniform float v) : sv_target
+float4 main(uniform float2 u) : sv_target
 {
-    return float4(max(u, v), max(2, 2.1), max(true, 2), max(-1, -1));
+    return float4(max(u.x, u.y), max(2, 2.1), max(true, 2), max(-1, -1));
 }
 
 [test]
@@ -10,11 +10,11 @@ draw quad
 probe all rgba (0.7, 2.1, 2.0, -1.0)
 
 [pixel shader]
-float4 main(uniform float2 u, uniform float2 v) : sv_target
+float4 main(uniform float4 u) : sv_target
 {
     float3 a = float3(-0.1, 0.2, 0.3);
 
-    return float4(max(u, v), max(a, u));
+    return float4(max(u.xy, u.zw), max(a, u.xy));
 }
 
 [test]
diff --git a/tests/pow.shader_test b/tests/pow.shader_test
index 21011e6c..6470494e 100644
--- a/tests/pow.shader_test
+++ b/tests/pow.shader_test
@@ -1,7 +1,7 @@
 [pixel shader]
-float4 main(uniform float2 u, uniform float2 v) : sv_target
+float4 main(uniform float4 u) : sv_target
 {
-    return float4(pow(u.y, 3), pow(u, v), pow(0.5, v.y));
+    return float4(pow(u.y, 3), pow(u.xy, u.zw), pow(0.5, u.w));
 }
 
 [test]




More information about the wine-cvs mailing list