wined3d: Enforce volume mapping restrictions.

This commit is contained in:
Stefan Dösinger 2013-08-26 02:01:26 +02:00 committed by Alexandre Julliard
parent fc36c5eb5d
commit 421b7a17ad
2 changed files with 8 additions and 1 deletions

View file

@ -184,7 +184,7 @@ static void test_D3DXLoadVolumeFromMemory(IDirect3DDevice9 *device)
set_box(&src_box, 0, 0, 4, 1, 0, 4);
set_box(&dst_box, 0, 0, 4, 1, 0, 4);
hr = D3DXLoadVolumeFromMemory(volume, NULL, &dst_box, pixels, D3DFMT_A8R8G8B8, 16, 16, NULL, &src_box, D3DX_DEFAULT, 0);
todo_wine ok(hr == D3DERR_INVALIDCALL, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
ok(hr == D3DERR_INVALIDCALL, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
IDirect3DVolume9_Release(volume);
IDirect3DVolumeTexture9_Release(volume_texture);

View file

@ -373,6 +373,13 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
TRACE("volume %p, map_desc %p, box %p, flags %#x.\n",
volume, map_desc, box, flags);
if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
{
WARN("Volume %p is not CPU accessible.\n", volume);
map_desc->data = NULL;
return WINED3DERR_INVALIDCALL;
}
if (!volume_prepare_system_memory(volume))
{
WARN("Out of memory.\n");