On 1/31/22 08:11, Henri Verbeet wrote:
On Mon, 31 Jan 2022 at 04:05, Zebediah Figura zfigura@codeweavers.com wrote:
The ultimate idea being to set a cap on the amount of persistent BO memory, in which case we need to arbitrarily mark BOs as persistent.
Could the "arbitrary" part be avoided? In particular, what would prevent us from unmapping less recently used mappings when we run into the cap?
Nothing, really. We could relatively easily use an LRU list, or periodically garbage-collect unused mappings, for two possibilities.
I think it's a bit orthogonal to this patch, though. No matter what criteria we use to determine whether a mapping is persistent in wined3d_bo_*_map(), or to possibly unmap it later, we'll at least want some of these users of bo->persistent.
I'm also inclined to argue there's no reason not to accept 4/4 now, and later (assuming we need to) implement a more complex and optimized scheme on top of that. Although it could probably do with a bit more factored out into the "adjust_mapped_memory" helpers.