[PATCH 1/5] d3d9/tests: Test the pool and usage of surfaces created through CreateOffscreenPlainSurface().

Henri Verbeet hverbeet at codeweavers.com
Wed Nov 7 02:01:13 CST 2018


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 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 1e7c0ea0f45..840a786cce4 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 52a3ee795fa..e789107a34a 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);
-- 
2.11.0




More information about the wine-devel mailing list