Paul Gofman : d3d9/tests: Add tests for SW shaders creation in SWVP and MVP modes.

Alexandre Julliard julliard at winehq.org
Thu Aug 24 14:18:25 CDT 2017


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Wed Aug 23 17:17:54 2017 +0300

d3d9/tests: Add tests for SW shaders creation in SWVP and MVP modes.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d9/tests/device.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index a129d4c..5f904a2 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -6547,6 +6547,7 @@ float4 main(const float4 color : COLOR) : SV_TARGET
     IDirect3DVertexShader9 *vs = NULL;
     IDirect3DPixelShader9 *ps = NULL;
     IDirect3DDevice9 *device;
+    struct device_desc desc;
     IDirect3D9 * d3d;
     ULONG refcount;
     D3DCAPS9 caps;
@@ -6624,6 +6625,64 @@ float4 main(const float4 color : COLOR) : SV_TARGET
     if (ps)
         IDirect3DPixelShader9_Release(ps);
 
+    refcount = IDirect3DDevice9_Release(device);
+    ok(!refcount, "Device has %u references left.\n", refcount);
+
+    desc.device_window = window;
+    desc.width = 640;
+    desc.height = 480;
+    desc.flags = CREATE_DEVICE_SWVP_ONLY;
+
+    if (!(device = create_device(d3d, window, &desc)))
+    {
+        skip("Failed to create a D3D device, skipping tests.\n");
+        IDirect3D9_Release(d3d);
+        DestroyWindow(window);
+        return;
+    }
+
+    vs = NULL;
+    hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_256, &vs);
+    todo_wine
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+    if (vs)
+        IDirect3DVertexShader9_Release(vs);
+    hr = IDirect3DDevice9_CreateVertexShader(device, vs_3_256, &vs);
+    todo_wine
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+    if (vs)
+        IDirect3DVertexShader9_Release(vs);
+
+    refcount = IDirect3DDevice9_Release(device);
+    ok(!refcount, "Device has %u references left.\n", refcount);
+
+    desc.flags = CREATE_DEVICE_MIXED_ONLY;
+    if (!(device = create_device(d3d, window, &desc)))
+    {
+        skip("Failed to create a D3D device, skipping tests.\n");
+        IDirect3D9_Release(d3d);
+        DestroyWindow(window);
+        return;
+    }
+    hr = IDirect3DDevice9_SetSoftwareVertexProcessing(device, 0);
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+    hr = IDirect3DDevice9_CreateVertexShader(device, vs_1_256, &vs);
+    todo_wine
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+    hr = IDirect3DDevice9_SetVertexShader(device, vs);
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+    if (vs)
+        IDirect3DVertexShader9_Release(vs);
+
+    hr = IDirect3DDevice9_CreateVertexShader(device, vs_3_256, &vs);
+    todo_wine
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+    hr = IDirect3DDevice9_SetVertexShader(device, vs);
+    ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+    if (vs)
+        IDirect3DVertexShader9_Release(vs);
+
 cleanup:
     refcount = IDirect3DDevice9_Release(device);
     ok(!refcount, "Device has %u references left.\n", refcount);




More information about the wine-cvs mailing list