[PATCH vkd3d 1/4] tests: Import HLSL struct assignment tests from Wine.

Zebediah Figura zfigura at codeweavers.com
Sat Oct 3 16:24:23 CDT 2020


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 Makefile.am                              |  2 ++
 tests/hlsl-struct-assignment.shader_test | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 tests/hlsl-struct-assignment.shader_test

diff --git a/Makefile.am b/Makefile.am
index 415e6862..f3a5967d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,6 +57,7 @@ vkd3d_shader_tests = \
 	tests/hlsl-majority-typedef.shader_test \
 	tests/hlsl-return-implicit-conversion.shader_test \
 	tests/hlsl-return-void.shader_test \
+	tests/hlsl-struct-assignment.shader_test \
 	tests/hlsl-vector-indexing.shader_test \
 	tests/hlsl-vector-indexing-uniform.shader_test \
 	tests/math.shader_test \
@@ -195,6 +196,7 @@ XFAIL_TESTS = \
 	tests/hlsl-majority-typedef.shader_test \
 	tests/hlsl-return-implicit-conversion.shader_test \
 	tests/hlsl-return-void.shader_test \
+	tests/hlsl-struct-assignment.shader_test \
 	tests/hlsl-vector-indexing.shader_test \
 	tests/hlsl-vector-indexing-uniform.shader_test \
 	tests/math.shader_test \
diff --git a/tests/hlsl-struct-assignment.shader_test b/tests/hlsl-struct-assignment.shader_test
new file mode 100644
index 00000000..ea55b9ad
--- /dev/null
+++ b/tests/hlsl-struct-assignment.shader_test
@@ -0,0 +1,23 @@
+[pixel shader]
+struct apple
+{
+    struct
+    {
+        float4 a;
+    } m;
+    float4 b;
+};
+
+float4 main() : sv_target
+{
+    struct apple q, r, s;
+
+    q.m.a = float4(0.1, 0.2, 0.3, 0.4);
+    q.b = float4(0.5, 0.1, 0.4, 0.5);
+    s = r = q;
+    return s.m.a + s.b;
+}
+
+[test]
+draw quad
+probe all rgba (0.6, 0.3, 0.7, 0.9) 1
-- 
2.28.0




More information about the wine-devel mailing list