summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/vulkan/radv_meta_resolve.c')
-rw-r--r--src/amd/vulkan/radv_meta_resolve.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c
index a0edfb915cd..6cd0c381a54 100644
--- a/src/amd/vulkan/radv_meta_resolve.c
+++ b/src/amd/vulkan/radv_meta_resolve.c
@@ -560,6 +560,11 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer)
for (uint32_t i = 0; i < subpass->color_count; ++i) {
VkAttachmentReference src_att = subpass->color_attachments[i];
VkAttachmentReference dest_att = subpass->resolve_attachments[i];
+
+ if (src_att.attachment == VK_ATTACHMENT_UNUSED ||
+ dest_att.attachment == VK_ATTACHMENT_UNUSED)
+ continue;
+
struct radv_image *dst_img = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment->image;
struct radv_image *src_img = cmd_buffer->state.framebuffer->attachments[src_att.attachment].attachment->image;
@@ -582,10 +587,13 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer)
for (uint32_t i = 0; i < subpass->color_count; ++i) {
VkAttachmentReference src_att = subpass->color_attachments[i];
VkAttachmentReference dest_att = subpass->resolve_attachments[i];
- struct radv_image *dst_img = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment->image;
- if (dest_att.attachment == VK_ATTACHMENT_UNUSED)
+
+ if (src_att.attachment == VK_ATTACHMENT_UNUSED ||
+ dest_att.attachment == VK_ATTACHMENT_UNUSED)
continue;
+ struct radv_image *dst_img = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment->image;
+
if (dst_img->surface.dcc_size) {
radv_initialize_dcc(cmd_buffer, dst_img, 0xffffffff);
cmd_buffer->state.attachments[dest_att.attachment].current_layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;