aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_resolve_fs.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-04-11 14:09:16 +0200
committerSamuel Pitoiset <[email protected]>2018-04-12 09:58:44 +0200
commitab0e625a671d19bb6a736d663bbc6fa5fd9ecd06 (patch)
tree50b5dc10ab0b81bf5988f4ba63be3d292a935c31 /src/amd/vulkan/radv_meta_resolve_fs.c
parented93d90a67d31fc396e64d566e2ac58e2994a4e3 (diff)
radv: add radv_decompress_resolve_{subpass}_src() helpers
This helper shares common code before resolving using either a fragment or a compute shader. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_resolve_fs.c')
-rw-r--r--src/amd/vulkan/radv_meta_resolve_fs.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c
index 08c9282bf0d..499b3ae27af 100644
--- a/src/amd/vulkan/radv_meta_resolve_fs.c
+++ b/src/amd/vulkan/radv_meta_resolve_fs.c
@@ -457,19 +457,9 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
unsigned fs_key = radv_format_meta_fs_key(dest_image->vk_format);
unsigned dst_layout = radv_meta_dst_layout_from_layout(dest_image_layout);
VkRenderPass rp;
- for (uint32_t r = 0; r < region_count; ++r) {
- const VkImageResolve *region = &regions[r];
- const uint32_t src_base_layer =
- radv_meta_get_iview_layer(src_image, &region->srcSubresource,
- &region->srcOffset);
- VkImageSubresourceRange range;
- range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- range.baseMipLevel = region->srcSubresource.mipLevel;
- range.levelCount = 1;
- range.baseArrayLayer = src_base_layer;
- range.layerCount = region->srcSubresource.layerCount;
- radv_fast_clear_flush_image_inplace(cmd_buffer, src_image, &range);
- }
+
+ radv_decompress_resolve_src(cmd_buffer, src_image,
+ region_count, regions);
rp = device->meta_state.resolve_fragment.rc[samples_log2].render_pass[fs_key][dst_layout];
@@ -618,6 +608,8 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer)
RADV_CMD_FLAG_INV_GLOBAL_L2 |
RADV_CMD_FLAG_INV_VMEM_L1;
+ radv_decompress_resolve_subpass_src(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];
@@ -629,16 +621,6 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer)
struct radv_image_view *dest_iview = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment;
struct radv_image_view *src_iview = cmd_buffer->state.framebuffer->attachments[src_att.attachment].attachment;
- {
- VkImageSubresourceRange range;
- range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- range.baseMipLevel = 0;
- range.levelCount = 1;
- range.baseArrayLayer = 0;
- range.layerCount = 1;
- radv_fast_clear_flush_image_inplace(cmd_buffer, src_iview->image, &range);
- }
-
struct radv_subpass resolve_subpass = {
.color_count = 1,
.color_attachments = (VkAttachmentReference[]) { dest_att },