[PATCH 4/5] wined3d: Remove the resource_acquire call in resource_cleanup.

Henri Verbeet hverbeet at gmail.com
Thu Mar 10 03:06:39 CST 2022


On Thu, 10 Mar 2022 at 08:43, Stefan Dösinger <stefandoesinger at gmail.com> wrote:
> > Am 09.03.2022 um 20:57 schrieb Henri Verbeet <hverbeet at gmail.com>:
> > On Wed, 9 Mar 2022 at 11:48, Stefan Dösinger <stefan at 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.



More information about the wine-devel mailing list