From b4590d336801f5dd4f1b1ba7a9a25ca43a7d68c9 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 22 Nov 2018 15:03:06 +0330 Subject: [PATCH] d3d9: Disallow creating managed vertex buffers on d3d9ex devices. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d9/buffer.c | 6 ++++++ dlls/d3d9/tests/d3d9ex.c | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c index 4b0b39293cb..557ec91bf9b 100644 --- a/dlls/d3d9/buffer.c +++ b/dlls/d3d9/buffer.c @@ -283,6 +283,12 @@ HRESULT vertexbuffer_init(struct d3d9_vertexbuffer *buffer, struct d3d9_device * return D3DERR_INVALIDCALL; } + if (pool == D3DPOOL_MANAGED && device->d3d_parent->extended) + { + WARN("Managed resources are not supported by d3d9ex devices.\n"); + return D3DERR_INVALIDCALL; + } + /* In d3d9, buffers can't be used as rendertarget or depth/stencil buffer. */ if (usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL)) return D3DERR_INVALIDCALL; diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 0c463940845..759790ceadc 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -4533,10 +4533,9 @@ static void test_resource_access(void) hr = IDirect3DDevice9Ex_CreateVertexBuffer(device, 16, tests[i].usage, tests[i].format == FORMAT_COLOUR ? 0 : D3DFVF_XYZRHW, tests[i].pool, &vb, NULL); - todo_wine_if(hr == D3D_OK && tests[i].pool == D3DPOOL_MANAGED) - ok(hr == (tests[i].pool == D3DPOOL_SCRATCH || tests[i].pool == D3DPOOL_MANAGED - || (tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3DERR_INVALIDCALL : D3D_OK), - "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == (tests[i].pool == D3DPOOL_SCRATCH || tests[i].pool == D3DPOOL_MANAGED + || (tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3DERR_INVALIDCALL : D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr); if (FAILED(hr)) continue;