From ed2e2038de1e74f6caab347be8b072c256d2b946 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Mon, 4 Sep 2023 18:30:24 +0800 Subject: [PATCH] radeonsi: disk cache remove llvm dependancy when use aco MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This re-enable disk cache when use aco. Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- 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);