[PATCH 2/4] d3d9: Volume and cube textures do not support user memory.
Stefan Dösinger
stefan at codeweavers.com
Wed Dec 4 07:01:32 CST 2013
---
dlls/d3d9/device.c | 20 ++++++++++++++++++--
dlls/d3d9/tests/d3d9ex.c | 9 +++++++++
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 170d9e0..e48a641 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -793,7 +793,15 @@ static HRESULT WINAPI d3d9_device_CreateVolumeTexture(IDirect3DDevice9Ex *iface,
*texture = NULL;
if (shared_handle)
- FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
+ {
+ if (pool == D3DPOOL_SYSTEMMEM)
+ {
+ WARN("User memory is not allowed on volume textures.\n");
+ return D3DERR_INVALIDCALL;
+ }
+ else
+ FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
+ }
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
@@ -826,7 +834,15 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface,
*texture = NULL;
if (shared_handle)
- FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
+ {
+ if (pool == D3DPOOL_SYSTEMMEM)
+ {
+ WARN("User memory is not allowed on cube textures.\n");
+ return D3DERR_INVALIDCALL;
+ }
+ else
+ FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
+ }
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c
index 5825c35..e6ce770 100644
--- a/dlls/d3d9/tests/d3d9ex.c
+++ b/dlls/d3d9/tests/d3d9ex.c
@@ -539,6 +539,8 @@ static void test_texture_sysmem_create(void)
{
IDirect3DDevice9Ex *device;
IDirect3DTexture9 *texture;
+ IDirect3DCubeTexture9 *cube_texture;
+ IDirect3DVolumeTexture9 *volume_texture;
D3DLOCKED_RECT locked_rect;
UINT refcount;
HWND window;
@@ -575,6 +577,13 @@ static void test_texture_sysmem_create(void)
IDirect3DTexture9_Release(texture);
HeapFree(GetProcessHeap(), 0, mem);
+ hr = IDirect3DDevice9Ex_CreateCubeTexture(device, 2, 1, 0, D3DFMT_A8R8G8B8,
+ D3DPOOL_SYSTEMMEM, &cube_texture, &mem);
+ ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9Ex_CreateVolumeTexture(device, 2, 2, 2, 1, 0, D3DFMT_A8R8G8B8,
+ D3DPOOL_SYSTEMMEM, &volume_texture, &mem);
+ ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+
refcount = IDirect3DDevice9Ex_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
--
1.8.3.2
More information about the wine-patches
mailing list