summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-04-17 16:05:17 +0200
committerSamuel Pitoiset <[email protected]>2018-04-19 09:10:52 +0200
commitdc3d39771ff561fe3e71aa0d08623e190ff496f9 (patch)
treedcd108e2d1153b7798c599ade5fe92ad0d0fe4df /src
parent1aefb62f1e85de379d6045f234f32bf6cb924a09 (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')
-rw-r--r--src/amd/vulkan/radv_meta.h1
-rw-r--r--src/amd/vulkan/radv_meta_resolve.c17
-rw-r--r--src/amd/vulkan/radv_meta_resolve_cs.c2
-rw-r--r--src/amd/vulkan/radv_meta_resolve_fs.c2
4 files changed, 18 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_meta.h b/src/amd/vulkan/radv_meta.h
index 47eec5cd6a0..4a9abae30ac 100644
--- a/src/amd/vulkan/radv_meta.h
+++ b/src/amd/vulkan/radv_meta.h
@@ -195,6 +195,7 @@ void 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);
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, &region);
+ radv_decompress_resolve_src(cmd_buffer, src_image,
+ src_att.layout, 1, &region);
}
}
@@ -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);
+ }
}
}
diff --git a/src/amd/vulkan/radv_meta_resolve_cs.c b/src/amd/vulkan/radv_meta_resolve_cs.c
index ede55f6d005..274e64999a5 100644
--- a/src/amd/vulkan/radv_meta_resolve_cs.c
+++ b/src/amd/vulkan/radv_meta_resolve_cs.c
@@ -388,7 +388,7 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
{
struct radv_meta_saved_state saved_state;
- radv_decompress_resolve_src(cmd_buffer, src_image,
+ radv_decompress_resolve_src(cmd_buffer, src_image, src_image_layout,
region_count, regions);
radv_meta_save(&saved_state, cmd_buffer,
diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c
index 499b3ae27af..ef8c1d8b1da 100644
--- a/src/amd/vulkan/radv_meta_resolve_fs.c
+++ b/src/amd/vulkan/radv_meta_resolve_fs.c
@@ -458,7 +458,7 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
unsigned dst_layout = radv_meta_dst_layout_from_layout(dest_image_layout);
VkRenderPass rp;
- radv_decompress_resolve_src(cmd_buffer, src_image,
+ radv_decompress_resolve_src(cmd_buffer, src_image, src_image_layout,
region_count, regions);
rp = device->meta_state.resolve_fragment.rc[samples_log2].render_pass[fs_key][dst_layout];