diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 6e84faff6b5..a0703ab5263 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -219,7 +219,6 @@ struct d3d9_surface struct d3d9_resource resource; struct wined3d_texture *wined3d_texture; unsigned int sub_resource_idx; - struct wined3d_surface *wined3d_surface; struct list rtv_entry; struct wined3d_rendertarget_view *wined3d_rtv; IDirect3DDevice9Ex *parent_device; @@ -229,8 +228,8 @@ struct d3d9_surface }; struct wined3d_rendertarget_view *d3d9_surface_get_rendertarget_view(struct d3d9_surface *surface) DECLSPEC_HIDDEN; -void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, - struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; +void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) 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 3b1c8597498..e51cdd51850 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3618,7 +3618,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent if (!(d3d_surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_surface)))) return E_OUTOFMEMORY; - surface_init(d3d_surface, wined3d_texture, sub_resource_idx, surface, parent_ops); + surface_init(d3d_surface, wined3d_texture, sub_resource_idx, parent_ops); *parent = d3d_surface; TRACE("Created surface %p.\n", d3d_surface); diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index 833c1f49a9c..c3032dc9021 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -71,7 +71,7 @@ static ULONG WINAPI d3d9_surface_AddRef(IDirect3DSurface9 *iface) wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_incref(surface->wined3d_rtv); - wined3d_surface_incref(surface->wined3d_surface); + wined3d_texture_incref(surface->wined3d_texture); wined3d_mutex_unlock(); } @@ -101,7 +101,7 @@ static ULONG WINAPI d3d9_surface_Release(IDirect3DSurface9 *iface) wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_decref(surface->wined3d_rtv); - wined3d_surface_decref(surface->wined3d_surface); + wined3d_texture_decref(surface->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, as it may cause the device to be destroyed. */ @@ -357,8 +357,8 @@ static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops = surface_wined3d_object_destroyed, }; -void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, - struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) +void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) { struct wined3d_resource_desc desc; IDirect3DBaseTexture9 *texture; @@ -366,7 +366,6 @@ void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_ surface->IDirect3DSurface9_iface.lpVtbl = &d3d9_surface_vtbl; d3d9_resource_init(&surface->resource); surface->resource.refcount = 0; - surface->wined3d_surface = wined3d_surface; list_init(&surface->rtv_entry); surface->container = wined3d_texture_get_parent(wined3d_texture); surface->wined3d_texture = wined3d_texture;