[PATCH] wined3d: Decrement reference count and take the lock atomically for cached objects.

Henri Verbeet hverbeet at gmail.com
Thu Dec 9 06:53:09 CST 2021


On Wed, 1 Dec 2021 at 13:31, Jan Sikorski <jsikorski at codeweavers.com> wrote:
>
> Samplers, blend states, rasterizer states and depth stencil states can
> be retrieved from the cache in struct d3d_device even after the
> reference count reaches zero, causing memory corruption.
>
I'm signing off on this because it solves a real problem and we're
close to code-freeze, but I don't think this is great. Ultimately,
d3d11 can't rely on wined3d_mutex_lock()/wined3d_mutex_unlock() to
protect its own internal data structures like the state object caches,
simply because they're going to go away. That means the interaction
between the cache, parent_ops, and locking is going to need some more
thought. It may end up being the case that the caches should be
handled be wined3d, for example.



More information about the wine-devel mailing list