zink: implement an extremely dumb resource memory cache

Graphics / Mesa 3D Graphics Library / Mesa - Mike Blumenkrantz [gmail.com] - 12 March 2021 17:21 UTC

this stores a number (currently 5) of backing allocations for resources for later reuse when creating matching resources

because this is on the screen object it requires locking, but this is still far faster than allocating new memory each time

980a8b3fc0e zink: implement an extremely dumb resource memory cache
src/gallium/drivers/zink/zink_resource.c | 63 ++++++++++++++++++++++++++++++--
src/gallium/drivers/zink/zink_resource.h | 9 ++++-
src/gallium/drivers/zink/zink_screen.c | 19 +++++++++-
src/gallium/drivers/zink/zink_screen.h | 5 +++
4 files changed, 90 insertions(+), 6 deletions(-)

Upstream: cgit.freedesktop.org


  • Share