Mesa (staging/19.2): radeonsi: fix shader disk cache key

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 20 00:56:27 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: 9264d749ba3871aaf16f2ad73c97203de89b4dca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9264d749ba3871aaf16f2ad73c97203de89b4dca

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Mon Nov  4 15:04:20 2019 +0100

radeonsi: fix shader disk cache key

Use unsigned values otherwise signed extension will produce a 64 bits value where
the 32 left-most bits are 1.

Fixes: 2afeed30101 ("radeonsi: tell the shader disk cache what IR is used")

---

 src/gallium/drivers/radeonsi/si_pipe.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index efd07a2a1a5..02c9da3b69a 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -878,8 +878,9 @@ static void si_disk_cache_create(struct si_screen *sscreen)
 	#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);
+	assert(!(shader_debug_flags & (1u << 31)));
+	shader_debug_flags |= (uint32_t)
+		((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.




More information about the mesa-commit mailing list