radv: only allow cmask/dcc in color optimal.
authorDave Airlie <airlied@redhat.com>
Thu, 29 Dec 2016 23:11:19 +0000 (23:11 +0000)
committerDave Airlie <airlied@redhat.com>
Fri, 30 Dec 2016 00:04:16 +0000 (00:04 +0000)
I had this on transfers due to the clear color cmd, but
it seems like that path shouldn't get fast clears.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c

index a3f5676a2923d58a935dbe37ba4360f260417b72..9c0bba2165b94f4cdfbca493c6704abb4cb1d0e2 100644 (file)
@@ -712,7 +712,7 @@ radv_image_create(VkDevice _device,
        image->size = image->surface.bo_size;
        image->alignment = image->surface.bo_alignment;
 
-       if (image->exclusive || (image->queue_family_mask & 1) == 1)
+       if (image->exclusive || image->queue_family_mask == 1)
                can_cmask_dcc = true;
 
        if ((pCreateInfo->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) &&
@@ -900,8 +900,7 @@ 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) &&
+       return layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL &&
                queue_mask == (1u << RADV_QUEUE_GENERAL);
 }