Module: Mesa Branch: main Commit: ed2e2038de1e74f6caab347be8b072c256d2b946 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed2e2038de1e74f6caab347be8b072c256d2b946
Author: Qiang Yu <[email protected]> Date: Mon Sep 4 18:30:24 2023 +0800 radeonsi: disk cache remove llvm dependancy when use aco This re-enable disk cache when use aco. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Qiang Yu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632> --- src/gallium/drivers/radeonsi/si_pipe.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index c824236774c..48431df1eab 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -1118,7 +1118,7 @@ static void si_test_gds_memory_management(struct si_context *sctx, unsigned allo static void si_disk_cache_create(struct si_screen *sscreen) { /* Don't use the cache if shader dumping is enabled. */ - if (sscreen->debug_flags & (DBG_ALL_SHADERS | DBG(USE_ACO))) + if (sscreen->debug_flags & DBG_ALL_SHADERS) return; struct mesa_sha1 ctx; @@ -1127,9 +1127,18 @@ static void si_disk_cache_create(struct si_screen *sscreen) _mesa_sha1_init(&ctx); - if (!disk_cache_get_function_identifier(si_disk_cache_create, &ctx) || + if (!disk_cache_get_function_identifier(si_disk_cache_create, &ctx)) + return; + + /* ACO and LLVM shader binary have different cache id distinguished by if adding + * the LLVM function identifier. ACO is a built-in component in mesa, so no need + * to add aco function here. + */ +#ifdef LLVM_AVAILABLE + if (!sscreen->use_aco && !disk_cache_get_function_identifier(LLVMInitializeAMDGPUTargetInfo, &ctx)) return; +#endif _mesa_sha1_final(&ctx, sha1); mesa_bytes_to_hex(cache_id, sha1, 20);
