radv: fix wmaybe-uninitialized in radv_meta_fast_clear.c
authorAndres Rodriguez <andresx7@gmail.com>
Wed, 18 Jul 2018 18:18:57 +0000 (14:18 -0400)
committerAndres Rodriguez <andresx7@gmail.com>
Wed, 18 Jul 2018 19:32:51 +0000 (15:32 -0400)
Assignment and usage of this variable both happen inside an
if(rad_image_has_dcc()) {} blocks. It seems gcc plays it safe and
assumes that both function calls could have different return values.

But in this case we should be safe.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_meta_fast_clear.c

index 932a6c93aa2dded38ea494bc9be47ac5660a31f5..b42a6783fd289a4f29ad3e081a441a69ba805242 100644 (file)
@@ -586,7 +586,7 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer,
        VkDevice device_h = radv_device_to_handle(cmd_buffer->device);
        VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
        uint32_t layer_count = radv_get_layerCount(image, subresourceRange);
-       bool old_predicating;
+       bool old_predicating = false;
        VkPipeline pipeline;
 
        assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);