d3d9: Disallow creating managed cube textures on d3d9ex devices.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Henri Verbeet 2018-11-23 19:00:44 +03:30 committed by Alexandre Julliard
parent e6ec3cbd62
commit 4d6dfd5d19
2 changed files with 8 additions and 2 deletions

View File

@ -4289,8 +4289,8 @@ static void test_resource_access(void)
case SURFACE_CUBE:
hr = IDirect3DDevice9Ex_CreateCubeTexture(device, 16, 1,
tests[j].usage, format, tests[j].pool, &texture_cube, NULL);
todo_wine_if(!tests[j].valid && !tests[j].usage && (tests[j].format == FORMAT_DEPTH
|| tests[j].pool == D3DPOOL_MANAGED))
todo_wine_if(!tests[j].valid && tests[j].format == FORMAT_DEPTH
&& !tests[j].usage && tests[j].pool != D3DPOOL_MANAGED)
ok(hr == (tests[j].valid && (tests[j].format != FORMAT_DEPTH || depth_cube)
? D3D_OK : D3DERR_INVALIDCALL),
"Test %s %u: Got unexpected hr %#x.\n", surface_types[i].name, j, hr);

View File

@ -1383,6 +1383,12 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic
DWORD flags = 0;
HRESULT hr;
if (pool == D3DPOOL_MANAGED && device->d3d_parent->extended)
{
WARN("Managed resources are not supported by d3d9ex devices.\n");
return D3DERR_INVALIDCALL;
}
texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl;
d3d9_resource_init(&texture->resource);
list_init(&texture->rtv_list);