radeonsi: fix shader disk cache key
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 4 Nov 2019 14:04:20 +0000 (15:04 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 6 Nov 2019 09:15:37 +0000 (10:15 +0100)
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

index 7b68afddcb2e3629d61ffe3626d9bc415d9520f4..1be3db4602bb9a64663f205cd08ba6dbeb91de7f 100644 (file)
@@ -904,8 +904,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 */
        #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.
 
        /* Add the high bits of 32-bit addresses, which affects
         * how 32-bit addresses are expanded to 64 bits.