From d8c90806e4a103c63de534b2cb4fe662e1bee19d Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Tue, 12 Nov 2024 09:38:52 +0100 Subject: [PATCH] ir3,tu: include ir3 debug flags in shader hash key Many debug flags influence shader codegen but are currently not included in the hash key. This causes surprising effects as cache lookups may return shaders compiled with different debug flags than currently in effect. This patch fixes this by including all debug flags in the shader hash key. Signed-off-by: Job Noorman Fixes: c323848b0b7 ("ir3, tu: Plumb through support for per-shader robustness") Part-of: --- src/freedreno/vulkan/tu_pipeline.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/freedreno/vulkan/tu_pipeline.cc b/src/freedreno/vulkan/tu_pipeline.cc index 5a3dc51bc91..c3514e055bc 100644 --- a/src/freedreno/vulkan/tu_pipeline.cc +++ b/src/freedreno/vulkan/tu_pipeline.cc @@ -1483,6 +1483,8 @@ tu_hash_shaders(unsigned char *hash, } } _mesa_sha1_update(&ctx, &state, sizeof(state)); + enum ir3_shader_debug ir3_debug_key = ir3_shader_debug; + _mesa_sha1_update(&ctx, &ir3_debug_key, sizeof(ir3_debug_key)); _mesa_sha1_final(&ctx, hash); } @@ -1501,6 +1503,8 @@ 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; + _mesa_sha1_update(&ctx, &ir3_debug_key, sizeof(ir3_debug_key)); _mesa_sha1_final(&ctx, hash); }