[PATCH 3/5] d3dcompiler/tests: Add a test for the comma operator.

Zebediah Figura z.figura12 at gmail.com
Tue Feb 11 22:54:19 CST 2020


From: Zebediah Figura <zfigura at codeweavers.com>

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/d3dcompiler_43/tests/hlsl.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/dlls/d3dcompiler_43/tests/hlsl.c b/dlls/d3dcompiler_43/tests/hlsl.c
index 868693838cc..50c03a732ef 100644
--- a/dlls/d3dcompiler_43/tests/hlsl.c
+++ b/dlls/d3dcompiler_43/tests/hlsl.c
@@ -626,6 +626,35 @@ static void test_fail(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *qquad_ge
     }
 }
 
+static void test_comma(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry,
+        IDirect3DVertexShader9 *vshader_passthru)
+{
+    static const struct hlsl_probe_info probes[] =
+    {
+        {0, 0, {0.6f, 0.7f, 0.8f, 0.9f}, 0.0001f, "comma test failed"},
+    };
+
+    static const char *shader =
+        "float4 test(float x: TEXCOORD0): COLOR\n"
+        "{\n"
+        "    float4 ret;\n"
+        "    return (ret = float4(0.1, 0.2, 0.3, 0.4)), ret + 0.5;\n"
+        "}";
+
+    IDirect3DPixelShader9 *pshader;
+    ID3DXConstantTable *constants;
+
+    pshader = compile_pixel_shader9(device, shader, "ps_2_0", &constants);
+    if (pshader)
+    {
+        compute_shader_probe9(device, vshader_passthru, pshader, quad_geometry,
+                probes, ARRAY_SIZE(probes), 1, 1, __LINE__);
+
+        ID3DXConstantTable_Release(constants);
+        IDirect3DPixelShader9_Release(pshader);
+    }
+}
+
 static BOOL load_d3dcompiler(void)
 {
     HMODULE module;
@@ -680,6 +709,7 @@ START_TEST(hlsl)
             test_float_vectors(device, quad_geometry, vshader_passthru);
             test_trig(device, quad_geometry, vshader_passthru);
             test_fail(device, quad_geometry, vshader_passthru);
+            test_comma(device, quad_geometry, vshader_passthru);
         }
     } else skip("no pixel shader support\n");
 
-- 
2.25.0




More information about the wine-devel mailing list