diff --git a/src/freedreno/ir3/ir3_compiler.h b/src/freedreno/ir3/ir3_compiler.h index 3894d040cc4..494ff7c3259 100644 --- a/src/freedreno/ir3/ir3_compiler.h +++ b/src/freedreno/ir3/ir3_compiler.h @@ -378,6 +378,21 @@ ir3_debug_print(struct ir3 *ir, const char *when) } } +/* Return the debug flags that influence shader codegen and should be included + * in the hash key. Note that we use a deny list so that we don't accidentally + * forget to include new flags. + */ +static inline enum ir3_shader_debug +ir3_shader_debug_hash_key() +{ + return (enum ir3_shader_debug)( + ir3_shader_debug & + ~(IR3_DBG_SHADER_VS | IR3_DBG_SHADER_TCS | IR3_DBG_SHADER_TES | + IR3_DBG_SHADER_GS | IR3_DBG_SHADER_FS | IR3_DBG_SHADER_CS | + IR3_DBG_DISASM | IR3_DBG_OPTMSGS | IR3_DBG_NOCACHE | + IR3_DBG_SHADER_INTERNAL | IR3_DBG_SCHEDMSGS | IR3_DBG_RAMSGS)); +} + ENDC; #endif /* IR3_COMPILER_H_ */ diff --git a/src/freedreno/ir3/ir3_disk_cache.c b/src/freedreno/ir3/ir3_disk_cache.c index d4e8fd5c950..1d35b435eb2 100644 --- a/src/freedreno/ir3/ir3_disk_cache.c +++ b/src/freedreno/ir3/ir3_disk_cache.c @@ -44,7 +44,7 @@ ir3_disk_cache_init(struct ir3_compiler *compiler) char timestamp[41]; _mesa_sha1_format(timestamp, id_sha1); - uint64_t driver_flags = ir3_shader_debug; + uint64_t driver_flags = ir3_shader_debug_hash_key(); compiler->disk_cache = disk_cache_create(renderer, timestamp, driver_flags); } diff --git a/src/freedreno/vulkan/tu_pipeline.cc b/src/freedreno/vulkan/tu_pipeline.cc index c3514e055bc..1a794256ae0 100644 --- a/src/freedreno/vulkan/tu_pipeline.cc +++ b/src/freedreno/vulkan/tu_pipeline.cc @@ -1483,7 +1483,7 @@ tu_hash_shaders(unsigned char *hash, } } _mesa_sha1_update(&ctx, &state, sizeof(state)); - enum ir3_shader_debug ir3_debug_key = ir3_shader_debug; + enum ir3_shader_debug ir3_debug_key = ir3_shader_debug_hash_key(); _mesa_sha1_update(&ctx, &ir3_debug_key, sizeof(ir3_debug_key)); _mesa_sha1_final(&ctx, hash); } @@ -1503,7 +1503,7 @@ tu_hash_compute(unsigned char *hash, _mesa_sha1_update(&ctx, layout->sha1, sizeof(layout->sha1)); tu_hash_stage(&ctx, pipeline_flags, stage, NULL, key); - enum ir3_shader_debug ir3_debug_key = ir3_shader_debug; + enum ir3_shader_debug ir3_debug_key = ir3_shader_debug_hash_key(); _mesa_sha1_update(&ctx, &ir3_debug_key, sizeof(ir3_debug_key)); _mesa_sha1_final(&ctx, hash);