Commit 38f3d59e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Send resource destruction through the command stream.

parent 8cb66987
...@@ -4993,8 +4993,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso ...@@ -4993,8 +4993,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
context_resource_released(device, resource, type);
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{ {
if ((rtv = device->fb.render_targets[i]) && rtv->resource == resource) if ((rtv = device->fb.render_targets[i]) && rtv->resource == resource)
......
...@@ -233,6 +233,14 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * ...@@ -233,6 +233,14 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
return WINED3D_OK; return WINED3D_OK;
} }
static void wined3d_resource_destroy_object(void *object)
{
struct wined3d_resource *resource = object;
wined3d_resource_free_sysmem(resource);
context_resource_released(resource->device, resource, resource->type);
}
void resource_cleanup(struct wined3d_resource *resource) void resource_cleanup(struct wined3d_resource *resource)
{ {
const struct wined3d *d3d = resource->device->wined3d; const struct wined3d *d3d = resource->device->wined3d;
...@@ -245,9 +253,8 @@ void resource_cleanup(struct wined3d_resource *resource) ...@@ -245,9 +253,8 @@ void resource_cleanup(struct wined3d_resource *resource)
adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size); adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size);
} }
wined3d_resource_free_sysmem(resource);
device_resource_released(resource->device, resource); device_resource_released(resource->device, resource);
wined3d_cs_emit_destroy_object(resource->device->cs, wined3d_resource_destroy_object, resource);
} }
void resource_unload(struct wined3d_resource *resource) void resource_unload(struct wined3d_resource *resource)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment