diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-07-23 21:59:01 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-07-24 01:50:52 +0200 |
commit | ea08a296fe226f5e67366b4db420c2322f38774c (patch) | |
tree | a52007d0342ab27b86a54b565be7dd545b36a363 /src/amd/vulkan/radv_meta_resolve.c | |
parent | bfe8134472f90a1790ca37ed2aaad420efe5dff5 (diff) |
radv: Handle VK_ATTACHMENT_UNUSED in color attachments.
This just sets them to INVALID COLOR, instead of shifting the
attachments together.
This also fixes a number of cases where we use it first and only
then check if it is VK_ATTACHMENT_UNUSED.
Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_resolve.c')
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve.c | 12 |
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; |