summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2019-10-30 14:28:01 +0100
committerDylan Baker <dylan@pnwbakers.com>2019-11-20 08:24:09 -0800
commitb5b09acb748ea4666c4587856af65fbe319f5b49 (patch)
treebc840fc0acbc8c77c2f4a0940ff1e5f8512f0a12
parent38bd621f0d154f2df623cffacc1d7a69faf331f8 (diff)
downloadmesa-b5b09acb748ea4666c4587856af65fbe319f5b49.tar.gz
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@basnieuwenhuizen.nl> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index ae7f5476092..efd07a2a1a5 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -877,6 +877,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.
@@ -999,6 +1002,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. */
@@ -1125,13 +1135,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->has_gfx9_scissor_bug = sscreen->info.family == CHIP_VEGA10 ||
sscreen->info.family == CHIP_RAVEN;
sscreen->has_msaa_sample_loc_bug = (sscreen->info.family >= CHIP_POLARIS10 &&