wined3d: Send rendertarget view destruction through the command stream.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-06-21 10:32:47 +02:00 committed by Alexandre Julliard
parent 8a8b57ce3d
commit 7fe9858988
1 changed files with 8 additions and 1 deletions

View File

@ -33,6 +33,11 @@ ULONG CDECL wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *v
return refcount;
}
static void wined3d_rendertarget_view_destroy_object(void *object)
{
HeapFree(GetProcessHeap(), 0, object);
}
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
{
ULONG refcount = InterlockedDecrement(&view->refcount);
@ -41,11 +46,13 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v
if (!refcount)
{
struct wined3d_device *device = view->resource->device;
/* Call wined3d_object_destroyed() before releasing the resource,
* since releasing the resource may end up destroying the parent. */
view->parent_ops->wined3d_object_destroyed(view->parent);
wined3d_resource_decref(view->resource);
HeapFree(GetProcessHeap(), 0, view);
wined3d_cs_emit_destroy_object(device->cs, wined3d_rendertarget_view_destroy_object, view);
}
return refcount;