From 8ebc7dcb59a69763cc369af7c723e40a3fd29f7f Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sun, 17 Mar 2019 03:18:29 +0100 Subject: [PATCH] radv: Allow fast clears with concurrent queue mask for some layouts. For VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL and VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL we do not care about the queue mask because 1) using these is only allowed on the gfx queue 2) transitions for these are only allowed on the gfx queue. This enables some fast clears for Doom that uses VK_SHARING_MODE_CONCURRENT. Reviewed-by: Samuel Pitoiset --- src/amd/vulkan/radv_image.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index fc8c6a2ebfe..dba8c1f4502 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1222,8 +1222,8 @@ bool radv_layout_has_htile(const struct radv_image *image, return radv_image_has_htile(image) && (layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL || - layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) && - queue_mask == (1u << RADV_QUEUE_GENERAL); + (layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL && + queue_mask == (1u << RADV_QUEUE_GENERAL))); } bool radv_layout_is_htile_compressed(const struct radv_image *image, @@ -1235,16 +1235,15 @@ bool radv_layout_is_htile_compressed(const struct radv_image *image, return radv_image_has_htile(image) && (layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL || - layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) && - queue_mask == (1u << RADV_QUEUE_GENERAL); + (layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL && + queue_mask == (1u << RADV_QUEUE_GENERAL))); } bool radv_layout_can_fast_clear(const struct radv_image *image, VkImageLayout layout, unsigned queue_mask) { - return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL && - queue_mask == (1u << RADV_QUEUE_GENERAL); + return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; } bool radv_layout_dcc_compressed(const struct radv_image *image, -- 2.30.2