diff options
Diffstat (limited to 'src')
-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); |