Henri Verbeet : d3d9/tests: Test the pool and usage of surfaces created through CreateOffscreenPlainSurface ().

Alexandre Julliard julliard at winehq.org
Wed Nov 7 14:47:31 CST 2018


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Nov  7 11:49:13 2018 +0330

d3d9/tests: Test the pool and usage of surfaces created through CreateOffscreenPlainSurface().

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

---

 dlls/d3d9/device.c       | 3 ---
 dlls/d3d9/tests/device.c | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 1e7c0ea..840a786 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1813,9 +1813,6 @@ static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface(IDirect3DDevice9Ex
         }
     }
 
-    /* FIXME: Offscreen surfaces are supposed to be always lockable,
-     * regardless of the pool they're created in. Should we set dynamic usage
-     * here? */
     return d3d9_device_create_surface(device, width, height, format,
             WINED3D_TEXTURE_CREATE_MAPPABLE, surface, 0, pool, D3DMULTISAMPLE_NONE, 0, user_mem);
 }
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 52a3ee7..e789107 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -8673,6 +8673,7 @@ static void test_surface_double_unlock(void)
     };
     IDirect3DSurface9 *surface;
     IDirect3DDevice9 *device;
+    D3DSURFACE_DESC desc;
     D3DLOCKED_RECT lr;
     IDirect3D9 *d3d;
     unsigned int i;
@@ -8697,6 +8698,11 @@ static void test_surface_double_unlock(void)
                 D3DFMT_X8R8G8B8, pools[i], &surface, NULL);
         ok(SUCCEEDED(hr), "Failed to create surface in pool %#x, hr %#x.\n", pools[i], hr);
 
+        hr = IDirect3DSurface9_GetDesc(surface, &desc);
+        ok(hr == D3D_OK, "Pool %#x: Got unexpected hr %#x.\n", pools[i], hr);
+        ok(!desc.Usage, "Pool %#x: Got unexpected usage %#x.\n", pools[i], desc.Usage);
+        ok(desc.Pool == pools[i], "Pool %#x: Got unexpected pool %#x.\n", pools[i], desc.Pool);
+
         hr = IDirect3DSurface9_UnlockRect(surface);
         ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x, for surface in pool %#x.\n", hr, pools[i]);
         hr = IDirect3DSurface9_LockRect(surface, &lr, NULL, 0);




More information about the wine-cvs mailing list