[PATCH 1/7] wined3d: Enforce volume mapping restrictions (try 2)
Stefan Dösinger
stefan at codeweavers.com
Sun Aug 25 19:01:26 CDT 2013
Try 2: Remove a test todo in d3dx9.
---
dlls/d3dx9_36/tests/volume.c | 2 +-
dlls/wined3d/volume.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c
index f3976c0..eb2877f 100644
--- a/dlls/d3dx9_36/tests/volume.c
+++ b/dlls/d3dx9_36/tests/volume.c
@@ -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);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 71b2937..0369f54 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -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");
--
1.8.1.5
More information about the wine-patches
mailing list