Mesa (staging/19.3): radeonsi: tell the shader disk cache what IR is used
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Oct 31 22:15:29 UTC 2019
Module: Mesa
Branch: staging/19.3
Commit: 307e5cc8fd7537d5faa0a2b6ca35076252fc9b15
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=307e5cc8fd7537d5faa0a2b6ca35076252fc9b15
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Wed Oct 30 14:28:01 2019 +0100
radeonsi: tell the shader disk cache what IR is used
Until 8bef4df196fbb the IR (TGSI or NIR) was used in disk_cache driver_flags.
This commit restores this features to avoid crashing when switching from
one IR to the other.
As radeonsi's default is TGSI, I used "driver_flags & 0x8000000 = 0" for TGSI
to keep the same driver_flags.
Fixes: 8bef4df196f ("radeonsi: add si_debug_options for convenient adding/removing of options")
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
(cherry picked from commit 2afeed301010917c4eae55dcd2544f9d329df934)
---
src/gallium/drivers/radeonsi/si_pipe.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 01c9d89ab4f..7b68afddcb2 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -903,6 +903,9 @@ static void si_disk_cache_create(struct si_screen *sscreen)
/* These flags affect shader compilation. */
#define ALL_FLAGS (DBG(SI_SCHED) | DBG(GISEL))
uint64_t shader_debug_flags = sscreen->debug_flags & ALL_FLAGS;
+ /* Reserve left-most bit for tgsi/nir selector */
+ assert(!(shader_debug_flags & (1 << 31)));
+ shader_debug_flags |= ((sscreen->options.enable_nir & 0x1) << 31);
/* Add the high bits of 32-bit addresses, which affects
* how 32-bit addresses are expanded to 64 bits.
@@ -1026,6 +1029,13 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
return NULL;
}
+ {
+#define OPT_BOOL(name, dflt, description) \
+ sscreen->options.name = \
+ driQueryOptionb(config->options, "radeonsi_"#name);
+#include "si_debug_options.h"
+ }
+
si_disk_cache_create(sscreen);
/* Determine the number of shader compiler threads. */
@@ -1146,13 +1156,6 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
sscreen->commutative_blend_add =
driQueryOptionb(config->options, "radeonsi_commutative_blend_add");
- {
-#define OPT_BOOL(name, dflt, description) \
- sscreen->options.name = \
- driQueryOptionb(config->options, "radeonsi_"#name);
-#include "si_debug_options.h"
- }
-
sscreen->use_ngg = sscreen->info.chip_class >= GFX10 &&
sscreen->info.family != CHIP_NAVI14 &&
!(sscreen->debug_flags & DBG(NO_NGG));
More information about the mesa-commit
mailing list