diff options
author | Bas Nieuwenhuizen <[email protected]> | 2016-12-27 00:57:36 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-12-27 03:27:13 +0000 |
commit | 059af2515ad778f569e999547cb44a195f66c198 (patch) | |
tree | 4e9af6d081071f2046a79812ecdee58e3a373687 /src/amd | |
parent | 3fd306b4232656914267bca824b7dde4be0e2ffb (diff) |
radv: Also skip DCC clear flushes for compute.
(airlied: fixes DOOM hang with compute queue enabled)
Reviewed-by: Dave Airlie <[email protected]>
Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 14 | ||||
-rw-r--r-- | src/amd/vulkan/radv_image.c | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_clear.c | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_private.h | 6 |
4 files changed, 16 insertions, 12 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index d29432b64e8..fdb35a0060d 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -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( diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 6e03f496d4b..8af064b41dc 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -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) && diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index b7263dde01e..cb2aa1aa721 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -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; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index e15556ea57b..f76d38dba68 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -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); |