Commit d9bd9a9a authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9: Volume and cube textures do not support user memory.

parent b7b0b7d2
...@@ -800,7 +800,14 @@ static HRESULT WINAPI d3d9_device_CreateVolumeTexture(IDirect3DDevice9Ex *iface, ...@@ -800,7 +800,14 @@ static HRESULT WINAPI d3d9_device_CreateVolumeTexture(IDirect3DDevice9Ex *iface,
*texture = NULL; *texture = NULL;
if (shared_handle) if (shared_handle)
{
if (pool != D3DPOOL_DEFAULT)
{
WARN("Trying to create a shared volume texture in pool %#x.\n", pool);
return D3DERR_INVALIDCALL;
}
FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle); FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
}
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object) if (!object)
...@@ -833,7 +840,14 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface, ...@@ -833,7 +840,14 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface,
*texture = NULL; *texture = NULL;
if (shared_handle) if (shared_handle)
{
if (pool != D3DPOOL_DEFAULT)
{
WARN("Trying to create a shared cube texture in pool %#x.\n", pool);
return D3DERR_INVALIDCALL;
}
FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle); FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
}
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object) if (!object)
......
...@@ -539,11 +539,14 @@ static void test_user_memory(void) ...@@ -539,11 +539,14 @@ static void test_user_memory(void)
{ {
IDirect3DDevice9Ex *device; IDirect3DDevice9Ex *device;
IDirect3DTexture9 *texture; IDirect3DTexture9 *texture;
IDirect3DCubeTexture9 *cube_texture;
IDirect3DVolumeTexture9 *volume_texture;
D3DLOCKED_RECT locked_rect; D3DLOCKED_RECT locked_rect;
UINT refcount; UINT refcount;
HWND window; HWND window;
HRESULT hr; HRESULT hr;
void *mem; void *mem;
D3DCAPS9 caps;
window = create_window(); window = create_window();
if (!(device = create_device(window, window, TRUE))) if (!(device = create_device(window, window, TRUE)))
...@@ -552,6 +555,9 @@ static void test_user_memory(void) ...@@ -552,6 +555,9 @@ static void test_user_memory(void)
goto done; goto done;
} }
hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 128 * 128 * 4); mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 128 * 128 * 4);
hr = IDirect3DDevice9Ex_CreateTexture(device, 128, 128, 0, 0, D3DFMT_A8R8G8B8, hr = IDirect3DDevice9Ex_CreateTexture(device, 128, 128, 0, 0, D3DFMT_A8R8G8B8,
D3DPOOL_SYSTEMMEM, &texture, &mem); D3DPOOL_SYSTEMMEM, &texture, &mem);
...@@ -576,8 +582,21 @@ static void test_user_memory(void) ...@@ -576,8 +582,21 @@ static void test_user_memory(void)
hr = IDirect3DTexture9_UnlockRect(texture, 0); hr = IDirect3DTexture9_UnlockRect(texture, 0);
ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr);
IDirect3DTexture9_Release(texture); IDirect3DTexture9_Release(texture);
HeapFree(GetProcessHeap(), 0, mem);
if (caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP)
{
hr = IDirect3DDevice9Ex_CreateCubeTexture(device, 2, 1, 0, D3DFMT_A8R8G8B8,
D3DPOOL_SYSTEMMEM, &cube_texture, &mem);
ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
}
if (caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)
{
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);
}
HeapFree(GetProcessHeap(), 0, mem);
refcount = IDirect3DDevice9Ex_Release(device); refcount = IDirect3DDevice9Ex_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount); ok(!refcount, "Device has %u references left.\n", refcount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment