diff options
author | Samuel Pitoiset <[email protected]> | 2019-06-10 17:45:32 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-06-11 08:06:39 +0200 |
commit | b06d1f029dd3f41a74043dfabd9aa2a1fa23ef27 (patch) | |
tree | c2a7521dec17793ad095782ced9d49adf64aa444 /src/amd | |
parent | 4efbd963ec6cd92c2a8455087e20cdf11016499f (diff) |
radv: do not decompress all image layers before resolving inside a subpass
When decompressing resolve source images, we should rely on the
framebuffer layer count instead of resolving all images layers.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-By: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c index 0a7affb2f11..f1fa05cf8b3 100644 --- a/src/amd/vulkan/radv_meta_resolve.c +++ b/src/amd/vulkan/radv_meta_resolve.c @@ -707,6 +707,10 @@ radv_decompress_resolve_subpass_src(struct radv_cmd_buffer *cmd_buffer) { const struct radv_subpass *subpass = cmd_buffer->state.subpass; struct radv_framebuffer *fb = cmd_buffer->state.framebuffer; + uint32_t layer_count = fb->layers; + + if (subpass->view_mask) + layer_count = util_last_bit(subpass->view_mask); for (uint32_t i = 0; i < subpass->color_count; ++i) { struct radv_subpass_attachment src_att = subpass->color_attachments[i]; @@ -715,14 +719,16 @@ radv_decompress_resolve_subpass_src(struct radv_cmd_buffer *cmd_buffer) if (dest_att.attachment == VK_ATTACHMENT_UNUSED) continue; - struct radv_image *src_image = - fb->attachments[src_att.attachment].attachment->image; + struct radv_image_view *src_iview = + fb->attachments[src_att.attachment].attachment; + struct radv_image *src_image = src_iview->image; VkImageResolve region = {}; region.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; region.srcSubresource.baseArrayLayer = 0; region.srcSubresource.mipLevel = 0; - region.srcSubresource.layerCount = src_image->info.array_size; + region.srcSubresource.baseArrayLayer = src_iview->base_layer; + region.srcSubresource.layerCount = layer_count; radv_decompress_resolve_src(cmd_buffer, src_image, src_att.layout, 1, ®ion); |