From: Marek Olšák Date: Tue, 22 Sep 2020 06:35:53 +0000 (-0400) Subject: radeonsi: move debug options from si_disk_cache_create to si_get_ir_cache_key X-Git-Tag: upstream/21.0.0~5173 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98188409d115d08f3b4e99cdb942118acdf71513;p=platform%2Fupstream%2Fmesa.git radeonsi: move debug options from si_disk_cache_create to si_get_ir_cache_key Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index e044f29..0ceda62 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -906,18 +906,8 @@ static void si_disk_cache_create(struct si_screen *sscreen) _mesa_sha1_final(&ctx, sha1); disk_cache_format_hex_id(cache_id, sha1, 20 * 2); -/* These flags affect shader compilation. */ -#define ALL_FLAGS (DBG(GISEL) | DBG(KILL_PS_INF_INTERP) | DBG(CLAMP_DIV_BY_ZERO)) - uint64_t shader_debug_flags = sscreen->debug_flags & ALL_FLAGS; - - /* Add the high bits of 32-bit addresses, which affects - * how 32-bit addresses are expanded to 64 bits. - */ - STATIC_ASSERT(ALL_FLAGS <= UINT_MAX); - assert((int16_t)sscreen->info.address32_hi == (int32_t)sscreen->info.address32_hi); - shader_debug_flags |= (uint64_t)(sscreen->info.address32_hi & 0xffff) << 32; - - sscreen->disk_shader_cache = disk_cache_create(sscreen->info.name, cache_id, shader_debug_flags); + sscreen->disk_shader_cache = disk_cache_create(sscreen->info.name, cache_id, + sscreen->info.address32_hi); } static void si_set_max_shader_compiler_threads(struct pipe_screen *screen, unsigned max_threads) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index af1e3e2..910697a 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -80,7 +80,15 @@ void si_get_ir_cache_key(struct si_shader_selector *sel, bool ngg, bool es, shader_variant_flags |= 1 << 3; /* This varies depending on whether compute-based culling is enabled. */ - shader_variant_flags |= sel->screen->num_vbos_in_user_sgprs << 4; + assert(sel->screen->num_vbos_in_user_sgprs <= 7); + shader_variant_flags |= MIN2(sel->screen->num_vbos_in_user_sgprs, 7) << 4; + + if (sel->screen->options.no_infinite_interp) + shader_variant_flags |= 1 << 7; + if (sel->screen->options.clamp_div_by_zero) + shader_variant_flags |= 1 << 8; + if (sel->screen->debug_flags & DBG(GISEL)) + shader_variant_flags |= 1 << 9; struct mesa_sha1 ctx; _mesa_sha1_init(&ctx);