On Thu, 10 Mar 2022 at 08:43, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 09.03.2022 um 20:57 schrieb Henri Verbeet hverbeet@gmail.com: On Wed, 9 Mar 2022 at 11:48, Stefan Dösinger stefan@codeweavers.com wrote:
@@ -253,7 +253,6 @@ void resource_cleanup(struct wined3d_resource *resource)
device_resource_released(resource->device, resource); }
- wined3d_resource_acquire(resource); wined3d_cs_destroy_object(resource->device->cs, wined3d_resource_destroy_object, resource);
}
Is that safe? If yes, the reason why is useful information to include in the commit message.
Afaiu this codepath is called in case of a creation error, and the resource_acquire here is to balance the now-gone resource_release in the destroy callback. I'll double-check if I read things right and add more details in the commit.
For textures in particular, when we take the wined3d_texture_cleanup_sync() path, we can't heap_free() the texture object until wined3d_resource_destroy_object() has finished executing.