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

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-11-07 11:31:13 +03:30 committed by Alexandre Julliard
parent 9629769fe7
commit a4f047da10
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);