On Wed, 1 Dec 2021 at 13:31, Jan Sikorski jsikorski@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.