[PATCH 2/6] wined3d: Pass the volume texture level to the client libraries.

Stefan Dösinger stefan at codeweavers.com
Thu Apr 17 08:47:29 CDT 2014


The goal is to remove volumes and surfaces from the wined3d public API.
This extra information is needed for the transition. Once volumes are
gone, wined3d_device_parent_ops->volume_created will be removed and
d3d8/9 will create its own volume objects that have no relationship to
the wined3d objects.
---
 dlls/d3d10core/device.c  | 2 +-
 dlls/d3d8/device.c       | 2 +-
 dlls/d3d9/d3d9_private.h | 3 ++-
 dlls/d3d9/device.c       | 4 ++--
 dlls/d3d9/volume.c       | 3 ++-
 dlls/ddraw/ddraw.c       | 2 +-
 dlls/wined3d/volume.c    | 2 +-
 include/wine/wined3d.h   | 2 +-
 8 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c
index 1aa5e8b..bec6c4a 100644
--- a/dlls/d3d10core/device.c
+++ b/dlls/d3d10core/device.c
@@ -1946,7 +1946,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
 }
 
 static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent,
-        void *container_parent, struct wined3d_volume *volume, void **parent,
+        void *container_parent, struct wined3d_volume *volume, UINT level, void **parent,
         const struct wined3d_parent_ops **parent_ops)
 {
     TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p.\n",
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index c83d16c..d9c3302 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2952,7 +2952,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
 }
 
 static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent,
-        void *container_parent, struct wined3d_volume *volume, void **parent,
+        void *container_parent, struct wined3d_volume *volume, UINT level, void **parent,
         const struct wined3d_parent_ops **parent_ops)
 {
     struct d3d8_volume *d3d_volume;
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index 8d75f62..389cc95 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -187,10 +187,11 @@ struct d3d9_volume
     struct wined3d_volume *wined3d_volume;
     IUnknown *container;
     IUnknown *forwardReference;
+    UINT level;
 };
 
 void volume_init(struct d3d9_volume *volume, struct wined3d_volume *wined3d_volume,
-        const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
+        UINT level, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
 
 struct d3d9_swapchain
 {
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 263ac12..84184ec 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -3445,7 +3445,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
 }
 
 static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent,
-        void *container_parent, struct wined3d_volume *volume, void **parent,
+        void *container_parent, struct wined3d_volume *volume, UINT level, void **parent,
         const struct wined3d_parent_ops **parent_ops)
 {
     struct d3d9_volume *d3d_volume;
@@ -3456,7 +3456,7 @@ static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *
     if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume))))
         return E_OUTOFMEMORY;
 
-    volume_init(d3d_volume, volume, parent_ops);
+    volume_init(d3d_volume, volume, level, parent_ops);
     *parent = d3d_volume;
     TRACE("Created volume %p.\n", d3d_volume);
 
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c
index 30a977c..35e96df 100644
--- a/dlls/d3d9/volume.c
+++ b/dlls/d3d9/volume.c
@@ -253,12 +253,13 @@ static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops =
 };
 
 void volume_init(struct d3d9_volume *volume, struct wined3d_volume *wined3d_volume,
-        const struct wined3d_parent_ops **parent_ops)
+        UINT level, const struct wined3d_parent_ops **parent_ops)
 {
     volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl;
     d3d9_resource_init(&volume->resource);
     wined3d_volume_incref(wined3d_volume);
     volume->wined3d_volume = wined3d_volume;
+    volume->level = level;
 
     *parent_ops = &d3d9_volume_wined3d_parent_ops;
 }
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index aa74a1e..5cb985f 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4764,7 +4764,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
 }
 
 static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent,
-        void *container_parent, struct wined3d_volume *volume,
+        void *container_parent, struct wined3d_volume *volume, UINT level,
         void **parent, const struct wined3d_parent_ops **parent_ops)
 {
     TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p.\n",
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 817fe7e..f8ddcd8 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -886,7 +886,7 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi
     }
 
     if (FAILED(hr = device_parent->ops->volume_created(device_parent,
-            wined3d_texture_get_parent(container), object, &parent, &parent_ops)))
+            wined3d_texture_get_parent(container), object, level, &parent, &parent_ops)))
     {
         WARN("Failed to create volume parent, hr %#x.\n", hr);
         volume_set_container(object, NULL);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index c958872..f805079 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1978,7 +1978,7 @@ struct wined3d_device_parent_ops
     HRESULT (__cdecl *surface_created)(struct wined3d_device_parent *device_parent, void *container_parent,
             struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops);
     HRESULT (__cdecl *volume_created)(struct wined3d_device_parent *device_parent, void *container_parent,
-            struct wined3d_volume *volume, void **parent, const struct wined3d_parent_ops **parent_ops);
+            struct wined3d_volume *volume, UINT level, void **parent, const struct wined3d_parent_ops **parent_ops);
     HRESULT (__cdecl *create_swapchain_surface)(struct wined3d_device_parent *device_parent, void *container_parent,
             const struct wined3d_resource_desc *desc, struct wined3d_surface **surface);
     HRESULT (__cdecl *create_swapchain)(struct wined3d_device_parent *device_parent,
-- 
1.8.3.2




More information about the wine-patches mailing list