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 <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12343>
This commit is contained in:
Marek Olšák 2021-08-10 02:18:15 -04:00 committed by Marge Bot
parent 03b5a94258
commit 0b1fd84950

View file

@ -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