radv: Also skip DCC clear flushes for compute.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 26 Dec 2016 23:57:36 +0000 (00:57 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 27 Dec 2016 03:27:13 +0000 (03:27 +0000)
(airlied: fixes DOOM hang with compute queue enabled)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_image.c
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_private.h

index d29432b64e82580ec6e0af1d1ab7ffd076fca666..fdb35a0060d1f730feb34f456a31bbd9fba2c8fc 100644 (file)
@@ -2398,8 +2398,8 @@ static void radv_handle_cmask_image_transition(struct radv_cmd_buffer *cmd_buffe
                        radv_initialise_cmask(cmd_buffer, image, 0xccccccccu);
                else
                        radv_initialise_cmask(cmd_buffer, image, 0xffffffffu);
-       } else if (radv_layout_has_cmask(image, src_layout, src_queue_mask) &&
-                  !radv_layout_has_cmask(image, dst_layout, dst_queue_mask)) {
+       } else if (radv_layout_can_fast_clear(image, src_layout, src_queue_mask) &&
+                  !radv_layout_can_fast_clear(image, dst_layout, dst_queue_mask)) {
                radv_fast_clear_flush_image_inplace(cmd_buffer, image);
        }
 }
@@ -2425,13 +2425,15 @@ static void radv_handle_dcc_image_transition(struct radv_cmd_buffer *cmd_buffer,
                                             struct radv_image *image,
                                             VkImageLayout src_layout,
                                             VkImageLayout dst_layout,
+                                            unsigned src_queue_mask,
+                                            unsigned dst_queue_mask,
                                             VkImageSubresourceRange range,
                                             VkImageAspectFlags pending_clears)
 {
        if (src_layout == VK_IMAGE_LAYOUT_UNDEFINED) {
                radv_initialize_dcc(cmd_buffer, image, 0x20202020u);
-       } else if(src_layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL &&
-                 dst_layout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) {
+       } else if (radv_layout_can_fast_clear(image, src_layout, src_queue_mask) &&
+                  !radv_layout_can_fast_clear(image, dst_layout, dst_queue_mask)) {
                radv_fast_clear_flush_image_inplace(cmd_buffer, image);
        }
 }
@@ -2477,7 +2479,9 @@ static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
 
        if (image->surface.dcc_size)
                radv_handle_dcc_image_transition(cmd_buffer, image, src_layout,
-                                                dst_layout, range, pending_clears);
+                                                dst_layout, src_queue_mask,
+                                                dst_queue_mask, range,
+                                                pending_clears);
 }
 
 void radv_CmdPipelineBarrier(
index 6e03f496d4b5b890df2322c4f4df9116b6315bb3..8af064b41dc60875a517e89211ad4e3fbe96c700 100644 (file)
@@ -893,9 +893,9 @@ bool radv_layout_can_expclear(const struct radv_image *image,
                layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
 }
 
-bool radv_layout_has_cmask(const struct radv_image *image,
-                          VkImageLayout layout,
-                          unsigned queue_mask)
+bool radv_layout_can_fast_clear(const struct radv_image *image,
+                               VkImageLayout layout,
+                               unsigned queue_mask)
 {
        return (layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL ||
                layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) &&
index b7263dde01ef46e5ab7096f7f0774d1385470955..cb2aa1aa721ded5374a6b744998505202394770b 100644 (file)
@@ -805,7 +805,7 @@ emit_fast_color_clear(struct radv_cmd_buffer *cmd_buffer,
        if (!cmd_buffer->device->allow_fast_clears)
                return false;
 
-       if (!radv_layout_has_cmask(iview->image, image_layout, radv_image_queue_family_mask(iview->image, cmd_buffer->queue_family_index)))
+       if (!radv_layout_can_fast_clear(iview->image, image_layout, radv_image_queue_family_mask(iview->image, cmd_buffer->queue_family_index)))
                goto fail;
        if (vk_format_get_blocksizebits(iview->image->vk_format) > 64)
                goto fail;
index e15556ea57b1301f128049862a6d89097908c1da..f76d38dba68f4a05928eb7b3a083c3c09c292e28 100644 (file)
@@ -1029,9 +1029,9 @@ bool radv_layout_is_htile_compressed(const struct radv_image *image,
                                      VkImageLayout layout);
 bool radv_layout_can_expclear(const struct radv_image *image,
                               VkImageLayout layout);
-bool radv_layout_has_cmask(const struct radv_image *image,
-                          VkImageLayout layout,
-                          unsigned queue_mask);
+bool radv_layout_can_fast_clear(const struct radv_image *image,
+                               VkImageLayout layout,
+                               unsigned queue_mask);
 
 
 unsigned radv_image_queue_family_mask(const struct radv_image *image, int family);