From 0b1fd84950c75e0e6a6052f2b787ada486abe398 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 10 Aug 2021 02:18:15 -0400 Subject: [PATCH] radeonsi: handle NO_OPT_VARIANT in si_shader_select_with_key so as not to change the keys in si_context Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_state_shaders.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 87300f8..efb689e 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -2086,9 +2086,6 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh default: assert(0); } - - if (unlikely(sctx->screen->debug_flags & DBG(NO_OPT_VARIANT))) - memset(&key->opt, 0, sizeof(key->opt)); } static void si_build_shader_variant(struct si_shader *shader, int thread_index, bool low_priority) @@ -2209,6 +2206,12 @@ int si_shader_select_with_key(struct si_screen *sscreen, struct si_shader_ctx_st */ struct si_shader_key local_key; + if (unlikely(sscreen->debug_flags & DBG(NO_OPT_VARIANT))) { + /* Disable shader variant optimizations. */ + key = use_local_key_copy(key, &local_key); + memset(&local_key.opt, 0, sizeof(key->opt)); + } + again: /* Check if we don't need to change anything. * This path is also used for most shaders that don't need multiple -- 2.7.4