From: Marek Olšák Date: Mon, 21 Nov 2016 19:39:27 +0000 (+0100) Subject: radeonsi: add a debug flag that disables optimized shader variants X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5302ad9365844d86ae84df7dcf561c2f2174dc3;p=mesa.git radeonsi: add a debug flag that disables optimized shader variants Reviewed-by: Edward O'Callaghan Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 1a7a712beb2..15e8a12647e 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -671,6 +671,7 @@ static const struct debug_named_value common_debug_options[] = { { "noasm", DBG_NO_ASM, "Don't print disassembled shaders"}, { "preoptir", DBG_PREOPT_IR, "Print the LLVM IR before initial optimizations" }, { "checkir", DBG_CHECK_IR, "Enable additional sanity checks on shader IR" }, + { "nooptvariant", DBG_NO_OPT_VARIANT, "Disable compiling optimized shader variants." }, { "testdma", DBG_TEST_DMA, "Invoke SDMA tests and exit." }, diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 941fc377a51..25d40da931e 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -79,6 +79,7 @@ #define DBG_NO_ASM (1 << 14) #define DBG_PREOPT_IR (1 << 15) #define DBG_CHECK_IR (1 << 16) +#define DBG_NO_OPT_VARIANT (1 << 17) /* gaps */ #define DBG_TEST_DMA (1 << 20) /* Bits 21-31 are reserved for the r600g driver. */ diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index fd0be300650..0afc3b4fc9d 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1121,6 +1121,11 @@ static int si_shader_select_with_key(struct si_screen *sscreen, struct si_shader_selector *sel = state->cso; struct si_shader *current = state->current; struct si_shader *iter, *shader = NULL; + + if (unlikely(sscreen->b.chip_class & DBG_NO_OPT_VARIANT)) { + memset(&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