radv: simplify a condition in radv_src_access_flush()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 18 Jul 2018 14:19:07 +0000 (16:19 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 20 Jul 2018 08:17:17 +0000 (10:17 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 032b701561fe4834525d707814d943fc7d08a149..f9f57a106567b23ad95774efae1918530113cbf2 100644 (file)
@@ -1975,10 +1975,12 @@ radv_src_access_flush(struct radv_cmd_buffer *cmd_buffer,
        enum radv_cmd_flush_bits flush_bits = 0;
        uint32_t b;
 
-       if (image && !radv_image_has_CB_metadata(image))
-               flush_CB_meta = false;
-       if (image && !radv_image_has_htile(image))
-               flush_DB_meta = false;
+       if (image) {
+               if (!radv_image_has_CB_metadata(image))
+                       flush_CB_meta = false;
+               if (!radv_image_has_htile(image))
+                       flush_DB_meta = false;
+       }
 
        for_each_bit(b, src_flags) {
                switch ((VkAccessFlagBits)(1 << b)) {