[v4 1/5] d3d9: make use of wined3d_texture_map in d3d9_volume_LockBox

Riccardo Bortolato rikyz619 at gmail.com
Wed Oct 7 12:04:31 CDT 2015


Also removed wined3d_volume_map from wined3d public api.

Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
 dlls/d3d9/d3d9_private.h       | 2 ++
 dlls/d3d9/volume.c             | 5 ++++-
 dlls/wined3d/volume.c          | 2 +-
 dlls/wined3d/wined3d.spec      | 1 -
 dlls/wined3d/wined3d_private.h | 2 ++
 include/wine/wined3d.h         | 2 --
 6 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index a1b824b..28db978 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -191,6 +191,8 @@ struct d3d9_volume
 {
     IDirect3DVolume9 IDirect3DVolume9_iface;
     struct d3d9_resource resource;
+    struct wined3d_texture *wined3d_texture;
+    unsigned int sub_resource_idx;
     struct wined3d_volume *wined3d_volume;
     struct d3d9_texture *texture;
 };
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c
index 603fb6e..25c2c2c 100644
--- a/dlls/d3d9/volume.c
+++ b/dlls/d3d9/volume.c
@@ -148,7 +148,8 @@ static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *iface,
             iface, locked_box, box, flags);
 
     wined3d_mutex_lock();
-    hr = wined3d_volume_map(volume->wined3d_volume, &map_desc, (const struct wined3d_box *)box, flags);
+    hr = wined3d_texture_map(volume->wined3d_texture, volume->sub_resource_idx,
+            &map_desc, (const struct wined3d_box *)box, flags);
     wined3d_mutex_unlock();
 
     locked_box->RowPitch = map_desc.row_pitch;
@@ -209,6 +210,8 @@ void volume_init(struct d3d9_volume *volume, struct wined3d_texture *wined3d_tex
     volume->resource.refcount = 0;
     volume->wined3d_volume = wined3d_volume;
     volume->texture = wined3d_texture_get_parent(wined3d_texture);
+    volume->wined3d_texture = wined3d_texture;
+    volume->sub_resource_idx = sub_resource_idx;
 
     *parent_ops = &d3d9_volume_wined3d_parent_ops;
 }
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 099927c..743f2dd 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -531,7 +531,7 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
     return TRUE;
 }
 
-HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
+HRESULT wined3d_volume_map(struct wined3d_volume *volume,
         struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
 {
     struct wined3d_device *device = volume->resource.device;
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index dbe078f..5406ce0 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -284,5 +284,4 @@
 @ cdecl wined3d_vertex_declaration_incref(ptr)
 
 @ cdecl wined3d_volume_get_resource(ptr)
-@ cdecl wined3d_volume_map(ptr ptr ptr long)
 @ cdecl wined3d_volume_unmap(ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3071726..e2ee844 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2341,6 +2341,8 @@ void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pit
 void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context,
         BOOL srgb_mode) DECLSPEC_HIDDEN;
 void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
+HRESULT wined3d_volume_map(struct wined3d_volume *volume,
+        struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN;
 void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
 void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context,
         const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index c9448df..b8f6001 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2569,8 +2569,6 @@ void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex
 ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
 
 struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume);
-HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume,
-        struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
 HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume);
 
 /* Return the integer base-2 logarithm of x. Undefined for x == 0. */
-- 
1.9.1




More information about the wine-patches mailing list