Henri Verbeet : d3d8: Disallow rendertarget and depth/ stencil usage on 3D textures.
Alexandre Julliard
julliard at winehq.org
Tue Nov 20 15:39:50 CST 2018
Module: wine
Branch: master
Commit: fc97073e2a3043bcf0624f924cd43f178337ec96
URL: https://source.winehq.org/git/wine.git/?a=commit;h=fc97073e2a3043bcf0624f924cd43f178337ec96
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Nov 20 16:54:43 2018 +0330
d3d8: Disallow rendertarget and depth/stencil usage on 3D textures.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d8/tests/device.c | 6 ++----
dlls/d3d8/texture.c | 4 ++++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index c99ed0e..8ac6ed7 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -9091,10 +9091,8 @@ static void test_resource_access(void)
hr = IDirect3DDevice8_CreateVolumeTexture(device, 16, 16, 1, 1,
tests[i].usage, format, tests[i].pool, &texture);
- todo_wine_if(tests[i].usage & D3DUSAGE_RENDERTARGET
- && !(tests[i].usage & D3DUSAGE_DYNAMIC) && tests[i].pool == D3DPOOL_DEFAULT)
- ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3D_OK : D3DERR_INVALIDCALL),
- "Test %u: Got unexpected hr %#x.\n", i, hr);
+ ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3D_OK : D3DERR_INVALIDCALL),
+ "Test %u: Got unexpected hr %#x.\n", i, hr);
if (FAILED(hr))
continue;
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c
index ec5ae03..ccbf60e 100644
--- a/dlls/d3d8/texture.c
+++ b/dlls/d3d8/texture.c
@@ -1186,6 +1186,10 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
struct wined3d_resource_desc desc;
HRESULT hr;
+ /* In d3d8, 3D textures can't be used as rendertarget or depth/stencil buffer. */
+ if (usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL))
+ return D3DERR_INVALIDCALL;
+
texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DVolumeTexture8_Vtbl;
d3d8_resource_init(&texture->resource);
list_init(&texture->rtv_list);
More information about the wine-cvs
mailing list