[RFC 2/6] wined3d: store wined3d_texture in d3d8, d3d9 and ddraw surfaces and volumes

Riccardo Bortolato rikyz619 at gmail.com
Fri Sep 11 02:08:06 CDT 2015


---
 dlls/d3d11/device.c        | 10 +++++-----
 dlls/d3d8/d3d8_private.h   |  8 ++++++--
 dlls/d3d8/device.c         | 17 +++++++++--------
 dlls/d3d8/surface.c        |  4 +++-
 dlls/d3d8/volume.c         |  4 +++-
 dlls/d3d9/d3d9_private.h   |  8 ++++++--
 dlls/d3d9/device.c         | 17 +++++++++--------
 dlls/d3d9/surface.c        |  4 +++-
 dlls/d3d9/volume.c         |  4 +++-
 dlls/ddraw/ddraw.c         | 14 +++++++-------
 dlls/ddraw/ddraw_private.h |  3 ++-
 dlls/ddraw/surface.c       |  4 +++-
 dlls/wined3d/surface.c     |  2 +-
 dlls/wined3d/volume.c      |  2 +-
 include/wine/wined3d.h     |  6 ++++--
 15 files changed, 65 insertions(+), 42 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 316c268..3203f30 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -2927,10 +2927,10 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_pa
 
 static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent,
         void *container_parent, struct wined3d_surface *surface, void **parent,
-        const struct wined3d_parent_ops **parent_ops, UINT idx)
+        const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
-    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, surface, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, surface, parent, parent_ops, texture, idx);
 
     *parent = NULL;
     *parent_ops = &d3d10_null_wined3d_parent_ops;
@@ -2940,9 +2940,9 @@ 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,
-        const struct wined3d_parent_ops **parent_ops, UINT idx)
+        const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
-    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, index %u.\n",
+    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, texture %p, index %u.\n",
             device_parent, container_parent, volume, parent, parent_ops, idx);
 
     *parent = NULL;
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h
index 6573435..b0fb9db 100644
--- a/dlls/d3d8/d3d8_private.h
+++ b/dlls/d3d8/d3d8_private.h
@@ -206,11 +206,13 @@ struct d3d8_volume
     struct d3d8_resource resource;
     struct wined3d_volume *wined3d_volume;
     struct d3d8_texture *texture;
+    struct wined3d_texture *wined3d_texture;
     UINT sub_resource_idx;
 };
 
 void volume_init(struct d3d8_volume *volume, struct d3d8_texture *texture,
-        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops, UINT idx) DECLSPEC_HIDDEN;
+        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx) DECLSPEC_HIDDEN;
 
 struct d3d8_swapchain
 {
@@ -233,12 +235,14 @@ struct d3d8_surface
     IDirect3DDevice8 *parent_device;
     IUnknown *container;
     struct d3d8_texture *texture;
+    struct wined3d_texture *wined3d_texture;
     UINT sub_resource_idx;
 };
 
 struct wined3d_rendertarget_view *d3d8_surface_get_rendertarget_view(struct d3d8_surface *surface) DECLSPEC_HIDDEN;
 void surface_init(struct d3d8_surface *surface, IUnknown *container_parent,
-        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops, UINT idx) DECLSPEC_HIDDEN;
+        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *texture, UINT idx) DECLSPEC_HIDDEN;
 struct d3d8_surface *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN;
 
 struct d3d8_vertexbuffer
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 7cf0f91..ba67ba5 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -981,6 +981,7 @@ static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width
     sub_resource = wined3d_texture_get_sub_resource(texture, 0);
     surface_impl = wined3d_resource_get_parent(sub_resource);
     surface_impl->parent_device = &device->IDirect3DDevice8_iface;
+    surface_impl->wined3d_texture = texture;
     *surface = &surface_impl->IDirect3DSurface8_iface;
     IDirect3DSurface8_AddRef(*surface);
     wined3d_texture_decref(texture);
@@ -2999,17 +3000,17 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_pa
 
 static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent,
         void *container_parent, struct wined3d_surface *surface, void **parent,
-        const struct wined3d_parent_ops **parent_ops, UINT idx)
+        const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
     struct d3d8_surface *d3d_surface;
 
-    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, surface, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, surface, parent, parent_ops, texture, idx);
 
     if (!(d3d_surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_surface))))
         return E_OUTOFMEMORY;
 
-    surface_init(d3d_surface, container_parent, surface, parent_ops, idx);
+    surface_init(d3d_surface, container_parent, surface, parent_ops, texture, idx);
     *parent = d3d_surface;
     TRACE("Created surface %p.\n", d3d_surface);
 
@@ -3018,17 +3019,17 @@ 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,
-        const struct wined3d_parent_ops **parent_ops, UINT idx)
+        const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
     struct d3d8_volume *d3d_volume;
 
-    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, volume, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, volume, parent, parent_ops, texture, idx);
 
     if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume))))
         return E_OUTOFMEMORY;
 
-    volume_init(d3d_volume, container_parent, volume, parent_ops, idx);
+    volume_init(d3d_volume, container_parent, volume, parent_ops, texture, idx);
     *parent = d3d_volume;
     TRACE("Created volume %p.\n", d3d_volume);
 
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c
index 714102d..81b75e1 100644
--- a/dlls/d3d8/surface.c
+++ b/dlls/d3d8/surface.c
@@ -293,7 +293,8 @@ static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
 };
 
 void surface_init(struct d3d8_surface *surface, IUnknown *container_parent,
-        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx)
 {
     IDirect3DBaseTexture8 *texture;
 
@@ -303,6 +304,7 @@ void surface_init(struct d3d8_surface *surface, IUnknown *container_parent,
     surface->wined3d_surface = wined3d_surface;
     list_init(&surface->rtv_entry);
     surface->container = container_parent;
+    surface->wined3d_texture = wined3d_texture;
     surface->sub_resource_idx = idx;
 
     if (container_parent && SUCCEEDED(IUnknown_QueryInterface(container_parent,
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index f5c27e5..0cc6403 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -202,13 +202,15 @@ static const struct wined3d_parent_ops d3d8_volume_wined3d_parent_ops =
 };
 
 void volume_init(struct d3d8_volume *volume, struct d3d8_texture *texture,
-        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx)
 {
     volume->IDirect3DVolume8_iface.lpVtbl = &d3d8_volume_vtbl;
     d3d8_resource_init(&volume->resource);
     volume->resource.refcount = 0;
     volume->wined3d_volume = wined3d_volume;
     volume->texture = texture;
+    volume->wined3d_texture = wined3d_texture;
     volume->sub_resource_idx = idx;
 
     *parent_ops = &d3d8_volume_wined3d_parent_ops;
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h
index 506cb59..4532cb3 100644
--- a/dlls/d3d9/d3d9_private.h
+++ b/dlls/d3d9/d3d9_private.h
@@ -193,11 +193,13 @@ struct d3d9_volume
     struct d3d9_resource resource;
     struct wined3d_volume *wined3d_volume;
     struct d3d9_texture *texture;
+    struct wined3d_texture *wined3d_texture;
     UINT sub_resource_idx;
 };
 
 void volume_init(struct d3d9_volume *volume, struct d3d9_texture *texture,
-        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops, UINT idx) DECLSPEC_HIDDEN;
+        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx) DECLSPEC_HIDDEN;
 
 struct d3d9_swapchain
 {
@@ -221,12 +223,14 @@ struct d3d9_surface
     IUnknown *container;
     struct d3d9_texture *texture;
     BOOL getdc_supported;
+    struct wined3d_texture *wined3d_texture;
     UINT sub_resource_idx;
 };
 
 struct wined3d_rendertarget_view *d3d9_surface_get_rendertarget_view(struct d3d9_surface *surface) DECLSPEC_HIDDEN;
 void surface_init(struct d3d9_surface *surface, IUnknown *container_parent,
-        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops, UINT idx) DECLSPEC_HIDDEN;
+        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx) DECLSPEC_HIDDEN;
 struct d3d9_surface *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN;
 
 struct d3d9_vertexbuffer
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 092ed10..c60cbba 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1121,6 +1121,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
     sub_resource = wined3d_texture_get_sub_resource(texture, 0);
     surface_impl = wined3d_resource_get_parent(sub_resource);
     surface_impl->parent_device = &device->IDirect3DDevice9Ex_iface;
+    surface_impl->wined3d_texture = texture;
     *surface = &surface_impl->IDirect3DSurface9_iface;
     IDirect3DSurface9_AddRef(*surface);
 
@@ -3535,17 +3536,17 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_pa
 
 static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent,
         void *container_parent, struct wined3d_surface *surface, void **parent,
-        const struct wined3d_parent_ops **parent_ops, UINT idx)
+        const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
     struct d3d9_surface *d3d_surface;
 
-    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, surface, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, surface, parent, parent_ops, texture, idx);
 
     if (!(d3d_surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_surface))))
         return E_OUTOFMEMORY;
 
-    surface_init(d3d_surface, container_parent, surface, parent_ops, idx);
+    surface_init(d3d_surface, container_parent, surface, parent_ops, texture, idx);
     *parent = d3d_surface;
     TRACE("Created surface %p.\n", d3d_surface);
 
@@ -3554,17 +3555,17 @@ 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,
-        const struct wined3d_parent_ops **parent_ops, UINT idx)
+        const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
     struct d3d9_volume *d3d_volume;
 
-    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, volume, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, volume, parent, parent_ops, texture, idx);
 
     if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume))))
         return E_OUTOFMEMORY;
 
-    volume_init(d3d_volume, container_parent, volume, parent_ops, idx);
+    volume_init(d3d_volume, container_parent, volume, parent_ops, texture, idx);
     *parent = d3d_volume;
     TRACE("Created volume %p.\n", d3d_volume);
 
diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c
index b1f0a11..602ffec 100644
--- a/dlls/d3d9/surface.c
+++ b/dlls/d3d9/surface.c
@@ -346,7 +346,8 @@ static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops =
 };
 
 void surface_init(struct d3d9_surface *surface, IUnknown *container_parent,
-        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx)
 {
     struct wined3d_resource_desc desc;
     IDirect3DBaseTexture9 *texture;
@@ -357,6 +358,7 @@ void surface_init(struct d3d9_surface *surface, IUnknown *container_parent,
     surface->wined3d_surface = wined3d_surface;
     list_init(&surface->rtv_entry);
     surface->container = container_parent;
+    surface->wined3d_texture = wined3d_texture;
     surface->sub_resource_idx = idx;
 
     if (container_parent && SUCCEEDED(IUnknown_QueryInterface(container_parent,
diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c
index 8df829c..2795ab7 100644
--- a/dlls/d3d9/volume.c
+++ b/dlls/d3d9/volume.c
@@ -202,13 +202,15 @@ static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops =
 };
 
 void volume_init(struct d3d9_volume *volume, struct d3d9_texture *texture,
-        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx)
 {
     volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl;
     d3d9_resource_init(&volume->resource);
     volume->resource.refcount = 0;
     volume->wined3d_volume = wined3d_volume;
     volume->texture = texture;
+    volume->wined3d_texture = wined3d_texture;
     volume->sub_resource_idx = idx;
 
     *parent_ops = &d3d9_volume_wined3d_parent_ops;
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 6f35b23..9c8d337 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4713,13 +4713,13 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_pa
 
 static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent,
         void *container_parent, struct wined3d_surface *surface,
-        void **parent, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        void **parent, const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
     struct ddraw *ddraw = ddraw_from_device_parent(device_parent);
     struct ddraw_surface *ddraw_surface;
 
-    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, surface, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, surface, parent, parent_ops, texture, idx);
 
     /* We have a swapchain or wined3d internal texture. */
     if (!container_parent || container_parent == ddraw)
@@ -4736,7 +4736,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
         return DDERR_OUTOFVIDEOMEMORY;
     }
 
-    ddraw_surface_init(ddraw_surface, ddraw, container_parent, surface, parent_ops, idx);
+    ddraw_surface_init(ddraw_surface, ddraw, container_parent, surface, parent_ops, texture, idx);
     *parent = ddraw_surface;
     list_add_head(&ddraw->surface_list, &ddraw_surface->surface_list_entry);
 
@@ -4747,10 +4747,10 @@ 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, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        void **parent, const struct wined3d_parent_ops **parent_ops, struct wined3d_texture *texture, UINT idx)
 {
-    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, index %u.\n",
-            device_parent, container_parent, volume, parent, parent_ops, idx);
+    TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p, texture %p, index %u.\n",
+            device_parent, container_parent, volume, parent, parent_ops, texture, idx);
 
     *parent = NULL;
     *parent_ops = &ddraw_null_wined3d_parent_ops;
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index ff0621b..f6dd3ad 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -210,7 +210,8 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
         struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN;
 struct wined3d_rendertarget_view *ddraw_surface_get_rendertarget_view(struct ddraw_surface *surface) DECLSPEC_HIDDEN;
 void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct ddraw_texture *texture,
-        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops, UINT idx) DECLSPEC_HIDDEN;
+        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx) DECLSPEC_HIDDEN;
 ULONG ddraw_surface_release_iface(struct ddraw_surface *This) DECLSPEC_HIDDEN;
 HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
         const RECT *rect, BOOL read) DECLSPEC_HIDDEN;
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 0e66a1b..ada8372 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6227,7 +6227,8 @@ fail:
 }
 
 void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct ddraw_texture *texture,
-        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops, UINT idx)
+        struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops,
+        struct wined3d_texture *wined3d_texture, UINT idx)
 {
     DDSURFACEDESC2 *desc = &surface->surface_desc;
     struct wined3d_resource_desc wined3d_desc;
@@ -6244,6 +6245,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, stru
     surface->iface_count = 1;
     surface->version = version;
     surface->ddraw = ddraw;
+    surface->wined3d_texture = wined3d_texture;
     surface->sub_resource_idx = idx;
 
     if (version == 7)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0676948..654b917 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -5414,7 +5414,7 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
     }
 
     if (FAILED(hr = device_parent->ops->surface_created(device_parent,
-            wined3d_texture_get_parent(container), object, &parent, &parent_ops, idx)))
+            wined3d_texture_get_parent(container), object, &parent, &parent_ops, container, idx)))
     {
         WARN("Failed to create surface parent, hr %#x.\n", hr);
         wined3d_surface_destroy(object);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 047251a..6a7600d 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -796,7 +796,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, level)))
+            wined3d_texture_get_parent(container), object, &parent, &parent_ops, container, level)))
     {
         WARN("Failed to create volume parent, hr %#x.\n", hr);
         wined3d_volume_destroy(object);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index adec90a..00d666c 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2031,9 +2031,11 @@ struct wined3d_device_parent_ops
     void (__cdecl *mode_changed)(struct wined3d_device_parent *device_parent);
     void (__cdecl *activate)(struct wined3d_device_parent *device_parent, BOOL activate);
     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, UINT idx);
+            struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops,
+            struct wined3d_texture *texture, UINT idx);
     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, UINT idx);
+            struct wined3d_volume *volume, void **parent, const struct wined3d_parent_ops **parent_ops,
+            struct wined3d_texture *texture, UINT idx);
     HRESULT (__cdecl *create_swapchain_texture)(struct wined3d_device_parent *device_parent, void *parent,
             const struct wined3d_resource_desc *desc, struct wined3d_texture **texture);
     HRESULT (__cdecl *create_swapchain)(struct wined3d_device_parent *device_parent,
-- 
1.9.1




More information about the wine-devel mailing list