summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_resolve.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-06-14 15:15:09 +0200
committerSamuel Pitoiset <[email protected]>2019-06-17 22:20:53 +0200
commit7971697efe77545229184fd70188b9415ee0653d (patch)
tree2a93d173b76ff193cde110c7dd8451e535c8f9b1 /src/amd/vulkan/radv_meta_resolve.c
parent38aa386e96e96ad1a2cd9191c47d1603f2f2e1bd (diff)
radv: store the DCC predicate for each mip
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_resolve.c')
-rw-r--r--src/amd/vulkan/radv_meta_resolve.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c
index 8c4bfa63ac7..73a4bbe0789 100644
--- a/src/amd/vulkan/radv_meta_resolve.c
+++ b/src/amd/vulkan/radv_meta_resolve.c
@@ -463,9 +463,6 @@ void radv_CmdResolveImage(
if (src_image->info.array_size > 1)
radv_finishme("vkCmdResolveImage: multisample array images");
- if (radv_image_has_dcc(dest_image)) {
- radv_initialize_dcc(cmd_buffer, dest_image, 0xffffffff);
- }
unsigned fs_key = radv_format_meta_fs_key(dest_image->vk_format);
for (uint32_t r = 0; r < region_count; ++r) {
const VkImageResolve *region = &regions[r];
@@ -509,6 +506,17 @@ void radv_CmdResolveImage(
const struct VkOffset3D dstOffset =
radv_sanitize_image_offset(dest_image->type, region->dstOffset);
+ if (radv_image_has_dcc(dest_image)) {
+ VkImageSubresourceRange range = {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
+ .baseMipLevel = region->dstSubresource.mipLevel,
+ .levelCount = 1,
+ .baseArrayLayer = dest_base_layer,
+ .layerCount = region->dstSubresource.layerCount,
+ };
+
+ radv_initialize_dcc(cmd_buffer, dest_image, &range, 0xffffffff);
+ }
for (uint32_t layer = 0; layer < region->srcSubresource.layerCount;
++layer) {
@@ -669,7 +677,15 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer)
struct radv_image *dst_img = dest_iview->image;
if (radv_image_has_dcc(dst_img)) {
- radv_initialize_dcc(cmd_buffer, dst_img, 0xffffffff);
+ VkImageSubresourceRange range = {
+ .aspectMask = dest_iview->aspect_mask,
+ .baseMipLevel = dest_iview->base_mip,
+ .levelCount = dest_iview->level_count,
+ .baseArrayLayer = dest_iview->base_layer,
+ .layerCount = dest_iview->layer_count,
+ };
+
+ radv_initialize_dcc(cmd_buffer, dst_img, &range, 0xffffffff);
cmd_buffer->state.attachments[dest_att.attachment].current_layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
}