Zebediah Figura : tests: Add some tests for fused assignment operations with writemasks.

Alexandre Julliard julliard at winehq.org
Mon Mar 15 16:58:42 CDT 2021


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Mar  9 19:42:50 2021 -0600

tests: Add some tests for fused assignment operations with writemasks.

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

---

 Makefile.am                            | 12 ++++++++++--
 tests/writemask-assignop-0.shader_test | 15 +++++++++++++++
 tests/writemask-assignop-1.shader_test | 16 ++++++++++++++++
 tests/writemask-assignop-2.shader_test | 13 +++++++++++++
 tests/writemask-assignop-3.shader_test | 11 +++++++++++
 5 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a412194..a79ad02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -80,7 +80,11 @@ vkd3d_shader_tests = \
 	tests/swizzle-5.shader_test \
 	tests/swizzle-6.shader_test \
 	tests/swizzle-7.shader_test \
-	tests/trigonometry.shader_test
+	tests/trigonometry.shader_test \
+	tests/writemask-assignop-0.shader_test \
+	tests/writemask-assignop-1.shader_test \
+	tests/writemask-assignop-2.shader_test \
+	tests/writemask-assignop-3.shader_test
 
 vkd3d_test_headers = \
 	tests/d3d12_crosstest.h \
@@ -267,7 +271,11 @@ XFAIL_TESTS = \
 	tests/swizzle-5.shader_test \
 	tests/swizzle-6.shader_test \
 	tests/swizzle-7.shader_test \
-	tests/trigonometry.shader_test
+	tests/trigonometry.shader_test \
+	tests/writemask-assignop-0.shader_test \
+	tests/writemask-assignop-1.shader_test \
+	tests/writemask-assignop-2.shader_test \
+	tests/writemask-assignop-3.shader_test
 endif
 
 if BUILD_DEMOS
diff --git a/tests/writemask-assignop-0.shader_test b/tests/writemask-assignop-0.shader_test
new file mode 100644
index 0000000..374a38b
--- /dev/null
+++ b/tests/writemask-assignop-0.shader_test
@@ -0,0 +1,15 @@
+[pixel shader]
+uniform float4 color;
+
+float4 main() : SV_target
+{
+    float4 ret = color;
+    ret.zw += float2(0.5, 0.3);
+    ret.yx -= float2(0.1, 0.5);
+    return ret;
+}
+
+[test]
+uniform 0 float4 0.0303 0.08 0.07 0.0202
+draw quad
+probe all rgba (-0.4697, -0.02, 0.57, 0.3202) 2
diff --git a/tests/writemask-assignop-1.shader_test b/tests/writemask-assignop-1.shader_test
new file mode 100644
index 0000000..6199325
--- /dev/null
+++ b/tests/writemask-assignop-1.shader_test
@@ -0,0 +1,16 @@
+[pixel shader]
+uniform float4 color;
+
+float4 main() : SV_target
+{
+    float4 ret = color;
+    ret.zwx.yzx.xz += float2(0.4, 0.2);
+    ret.xzyw.wzx.xz.y.x -= 0.6;
+    ret.yxwz.yxwz *= -1;
+    return ret;
+}
+
+[test]
+uniform 0 float4 0.0303 0.08 0.07 0.0202
+draw quad
+probe all rgba (0.5697, -0.08, -0.27, -0.4202)
diff --git a/tests/writemask-assignop-2.shader_test b/tests/writemask-assignop-2.shader_test
new file mode 100644
index 0000000..4e905e6
--- /dev/null
+++ b/tests/writemask-assignop-2.shader_test
@@ -0,0 +1,13 @@
+[pixel shader]
+float4 main() : SV_target
+{
+    float4 ret = float4(2, 2, 2, 2);
+    ret.yxz.yx += float2(0.1, 0.2);
+    ret.w.x -= 0.3;
+    ret.wzyx.zyx.yx.x *= 0.4;
+    return ret;
+}
+
+[test]
+draw quad
+probe all rgba (2.1, 2.2, 0.8, 1.7)
diff --git a/tests/writemask-assignop-3.shader_test b/tests/writemask-assignop-3.shader_test
new file mode 100644
index 0000000..90957cb
--- /dev/null
+++ b/tests/writemask-assignop-3.shader_test
@@ -0,0 +1,11 @@
+[pixel shader]
+float4 main() : SV_target
+{
+    float4 ret = float4(2, 2, 2, 2);
+    ret.xyzw.xyzw -= float4(0.1, 0.2, 0.3, 0.4);
+    return ret;
+}
+
+[test]
+draw quad
+probe all rgba (1.9, 1.8, 1.7, 1.6)




More information about the wine-cvs mailing list