diff options
author | Samuel Pitoiset <[email protected]> | 2018-04-17 16:05:17 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-04-19 09:10:52 +0200 |
commit | dc3d39771ff561fe3e71aa0d08623e190ff496f9 (patch) | |
tree | dcd108e2d1153b7798c599ade5fe92ad0d0fe4df /src/amd/vulkan/radv_meta_resolve.c | |
parent | 1aefb62f1e85de379d6045f234f32bf6cb924a09 (diff) |
radv: decompress DCC for multisampled source images before resolving
Multisampled source images (ie. color attachments) can be now
DCC compressed, so the driver needs to perform a DCC decompression
pass before resolving
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.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c index d66f1c9f933..f3e088b10c4 100644 --- a/src/amd/vulkan/radv_meta_resolve.c +++ b/src/amd/vulkan/radv_meta_resolve.c @@ -697,7 +697,8 @@ radv_decompress_resolve_subpass_src(struct radv_cmd_buffer *cmd_buffer) region.srcSubresource.mipLevel = 0; region.srcSubresource.layerCount = 1; - radv_decompress_resolve_src(cmd_buffer, src_image, 1, ®ion); + radv_decompress_resolve_src(cmd_buffer, src_image, + src_att.layout, 1, ®ion); } } @@ -707,6 +708,7 @@ radv_decompress_resolve_subpass_src(struct radv_cmd_buffer *cmd_buffer) void radv_decompress_resolve_src(struct radv_cmd_buffer *cmd_buffer, struct radv_image *src_image, + VkImageLayout src_image_layout, uint32_t region_count, const VkImageResolve *regions) { @@ -722,6 +724,17 @@ radv_decompress_resolve_src(struct radv_cmd_buffer *cmd_buffer, range.baseArrayLayer = src_base_layer; range.layerCount = region->srcSubresource.layerCount; - radv_fast_clear_flush_image_inplace(cmd_buffer, src_image, &range); + uint32_t queue_mask = + radv_image_queue_family_mask(src_image, + cmd_buffer->queue_family_index, + cmd_buffer->queue_family_index); + + if (radv_layout_dcc_compressed(src_image, src_image_layout, + queue_mask)) { + radv_decompress_dcc(cmd_buffer, src_image, &range); + } else { + radv_fast_clear_flush_image_inplace(cmd_buffer, + src_image, &range); + } } } |