radv: Fix warning in 32-bit build.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 30 Sep 2019 21:20:05 +0000 (23:20 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 3 Oct 2019 13:06:08 +0000 (13:06 +0000)
uintptr_t is 32 bits in a 32-bits build, resulting in shifting out
of bounds.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_cmd_buffer.c

index f93195be4c09b8947b58f49134041b8f0b05333f..1e5e28341358eec900d5c65a9f8698ccfd542aec 100644 (file)
@@ -556,8 +556,9 @@ radv_save_pipeline(struct radv_cmd_buffer *cmd_buffer,
                assert(!"invalid ring type");
        }
 
-       data[0] = (uintptr_t)pipeline;
-       data[1] = (uintptr_t)pipeline >> 32;
+       uint64_t pipeline_address = (uintptr_t)pipeline;
+       data[0] = pipeline_address;
+       data[1] = pipeline_address >> 32;
 
        radv_emit_write_data_packet(cmd_buffer, va, 2, data);
 }