Skip to content

Draft: radv/amdgpu: Add basic BO cache.

Bas Nieuwenhuizen requested to merge bnieuwenhuizen/mesa:upstream-bo-cache into main

Just a basic system of bucketizing and putting stuff in a free list.


  1. Only use up to 20% of memory in the cache.
  2. Anything that can fail due to lack of buffer memory, we retry after freeing buffers in the cache.

Open risks:

  1. We use a single free list which could be a problem with a ton of buffers.
  2. There is no good tracking across memory domains, which means we could cause extra spilling from VRAM on dGPUs.
  3. The bucketizing could cause significant extra memory overhead.

I haven't had the time to do thorough testing on this, so this puts it behind a perftest flag.

v2: Only do it for cmdbuffers & upload buffers becuase of mystery hangs in Elden Ring.

Edited by Bas Nieuwenhuizen

Merge request reports