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,
*texture = NULL;
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);
}
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
......@@ -833,7 +840,14 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface,
*texture = NULL;
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);
}
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
......
......@@ -539,11 +539,14 @@ static void test_user_memory(void)
{
IDirect3DDevice9Ex *device;
IDirect3DTexture9 *texture;
IDirect3DCubeTexture9 *cube_texture;
IDirect3DVolumeTexture9 *volume_texture;
D3DLOCKED_RECT locked_rect;
UINT refcount;
HWND window;
HRESULT hr;
void *mem;
D3DCAPS9 caps;
window = create_window();
if (!(device = create_device(window, window, TRUE)))
......@@ -552,6 +555,9 @@ static void test_user_memory(void)
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);
hr = IDirect3DDevice9Ex_CreateTexture(device, 128, 128, 0, 0, D3DFMT_A8R8G8B8,
D3DPOOL_SYSTEMMEM, &texture, &mem);
......@@ -576,8 +582,21 @@ static void test_user_memory(void)
hr = IDirect3DTexture9_UnlockRect(texture, 0);
ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr);
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);
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