summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-12-29 22:46:27 +0000
committerDave Airlie <[email protected]>2016-12-30 00:04:01 +0000
commit1814df7ea7e92095dafed1b825f8d5897371af21 (patch)
tree97e7a2f43131342548db549c3caccc0c5f208bc0 /src
parenta4d1eb443ecd2c34ce67f07a6a7078bf8a4f359c (diff)
radv: only allow cmask/dcc on exclusive or concurrent with graphics queue.
Otherwise we don't get the barriers to flush dcc etc. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_image.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 8af064b41dc..a3f5676a292 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -674,7 +674,7 @@ radv_image_create(VkDevice _device,
RADV_FROM_HANDLE(radv_device, device, _device);
const VkImageCreateInfo *pCreateInfo = create_info->vk_info;
struct radv_image *image = NULL;
-
+ bool can_cmask_dcc = false;
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO);
radv_assert(pCreateInfo->mipLevels > 0);
@@ -712,15 +712,18 @@ 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)
+ can_cmask_dcc = true;
+
if ((pCreateInfo->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) &&
- image->surface.dcc_size)
+ image->surface.dcc_size && can_cmask_dcc)
radv_image_alloc_dcc(device, image);
else
image->surface.dcc_size = 0;
if ((pCreateInfo->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) &&
pCreateInfo->mipLevels == 1 &&
- !image->surface.dcc_size && image->extent.depth == 1)
+ !image->surface.dcc_size && image->extent.depth == 1 && can_cmask_dcc)
radv_image_alloc_cmask(device, image);
if (image->samples > 1 && vk_format_is_color(pCreateInfo->format)) {
radv_image_alloc_fmask(device, image);