v3d: don't build disk cache access on shader disablement

Don't build shader cache related functions when shader cache is disabled
on compile time.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14512
Backport-to: 25.3
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 0cab626014)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39117>
This commit is contained in:
Juan A. Suarez Romero 2025-12-22 16:48:59 +01:00 committed by Dylan Baker
parent d83987ecef
commit bff3239a67
2 changed files with 5 additions and 1 deletions

View file

@ -354,7 +354,7 @@
"description": "v3d: don't build disk cache access on shader disablement",
"nominated": true,
"nomination_type": 4,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -749,6 +749,7 @@ v3d_screen_get_compatible_tlb_format(struct pipe_screen *screen,
}
}
#ifdef ENABLE_SHADER_CACHE
static struct disk_cache *
v3d_screen_get_disk_shader_cache(struct pipe_screen *pscreen)
{
@ -756,6 +757,7 @@ v3d_screen_get_disk_shader_cache(struct pipe_screen *pscreen)
return screen->disk_cache;
}
#endif
static int
v3d_screen_get_fd(struct pipe_screen *pscreen)
@ -833,7 +835,9 @@ v3d_screen_create(int fd, const struct pipe_screen_config *config,
pscreen->get_name = v3d_screen_get_name;
pscreen->get_vendor = v3d_screen_get_vendor;
pscreen->get_device_vendor = v3d_screen_get_vendor;
#ifdef ENABLE_SHADER_CACHE
pscreen->get_disk_shader_cache = v3d_screen_get_disk_shader_cache;
#endif
pscreen->query_dmabuf_modifiers = v3d_screen_query_dmabuf_modifiers;
pscreen->is_dmabuf_modifier_supported =
v3d_screen_is_dmabuf_modifier_supported;