v3d: add support for on-disk shader cache
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Mon, 14 Mar 2022 15:22:58 +0000 (16:22 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 18 Mar 2022 08:58:01 +0000 (08:58 +0000)
commit4468db20f7f335394cbac489e6c0ade86356a44d
tree030c5f70ce45e4ee0256184d6fea4604d1c18588
parenta929bafc775f7316b2e7a0a186610b8155d58ac5
v3d: add support for on-disk shader cache

It stores the compiled shaders on disk so further executions will load
them from disk instead of compiling, improving the overall performance.

This is noticeable in games where they suddenly get stuck for a while
because they start to compile one or more shaders.

v2:
 - Remove comment (Alejandro)
 - Use malloc() + helper to simplify code (Alejandro)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15380>
src/gallium/drivers/v3d/meson.build
src/gallium/drivers/v3d/v3d_context.h
src/gallium/drivers/v3d/v3d_disk_cache.c [new file with mode: 0644]
src/gallium/drivers/v3d/v3d_program.c
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/v3d/v3d_screen.h