Zebediah Figura : d3dcompiler/tests: Add more tests for swizzles.

Alexandre Julliard julliard at winehq.org
Thu Mar 12 17:09:07 CDT 2020


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Mar  6 17:17:32 2020 -0600

d3dcompiler/tests: Add more tests for swizzles.

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

---

 dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 40 +++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
index 525de9910b..ce63d3ea5d 100644
--- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
+++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
@@ -307,6 +307,21 @@ static void test_swizzle(void)
         "    return ret;\n"
         "}";
 
+    static const char ps_multiple_lhs_source[] =
+        "float4 main() : COLOR\n"
+        "{\n"
+        "    float4 ret = float4(0.1, 0.2, 0.3, 0.4);\n"
+        "    ret.wyz.yx = float2(0.5, 0.6).yx;\n"
+        "    return ret;\n"
+        "}";
+
+    static const char ps_multiple_rhs_source[] =
+        "float4 main() : COLOR\n"
+        "{\n"
+        "    float4 ret = float4(0.1, 0.2, 0.3, 0.4).ywxz.zyyz;\n"
+        "    return ret;\n"
+        "}";
+
     if (!init_test_context(&test_context))
         return;
     device = test_context.device;
@@ -328,6 +343,31 @@ static void test_swizzle(void)
 
         ID3D10Blob_Release(ps_code);
     }
+
+    todo_wine ps_code = compile_shader(ps_multiple_lhs_source, "ps_2_0");
+    if (ps_code)
+    {
+        draw_quad(device, ps_code);
+
+        v = get_color_vec4(device, 0, 0);
+        ok(compare_vec4(&v, 0.1f, 0.6f, 0.3f, 0.5f, 0),
+                "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+
+        ID3D10Blob_Release(ps_code);
+    }
+
+    todo_wine ps_code = compile_shader(ps_multiple_rhs_source, "ps_2_0");
+    if (ps_code)
+    {
+        draw_quad(device, ps_code);
+
+        v = get_color_vec4(device, 0, 0);
+        ok(compare_vec4(&v, 0.1f, 0.4f, 0.4f, 0.1f, 0),
+                "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+
+        ID3D10Blob_Release(ps_code);
+    }
+
     release_test_context(&test_context);
 }
 




More information about the wine-cvs mailing list