Henri Verbeet : d3d9: Disallow creating managed index buffers on d3d9ex devices.
Alexandre Julliard
julliard at winehq.org
Thu Nov 22 17:00:31 CST 2018
Module: wine
Branch: master
Commit: d9db221f0db83c3489862500727035cb16b7a266
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d9db221f0db83c3489862500727035cb16b7a266
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Nov 22 15:21:07 2018 +0330
d3d9: Disallow creating managed index buffers on d3d9ex devices.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 557ec91..219ee43 100644
--- a/dlls/d3d9/buffer.c
+++ b/dlls/d3d9/buffer.c
@@ -585,6 +585,12 @@ HRESULT indexbuffer_init(struct d3d9_indexbuffer *buffer, struct d3d9_device *de
if (pool == D3DPOOL_SCRATCH)
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 759790c..2a3adc7 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -4500,10 +4500,9 @@ static void test_resource_access(void)
hr = IDirect3DDevice9Ex_CreateIndexBuffer(device, 16, tests[i].usage,
tests[i].format == FORMAT_COLOUR ? D3DFMT_INDEX32 : D3DFMT_INDEX16, tests[i].pool, &ib, 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;
More information about the wine-cvs
mailing list