From 76812339f7cf4c742cec5b65bf3598dd965cfc53 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 6 Jun 2019 12:03:10 +0200 Subject: [PATCH] radv: decompress mipmapped depth/stencil images during transitions Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_cmd_buffer.c | 9 ++------- src/amd/vulkan/radv_meta.h | 4 ++-- src/amd/vulkan/radv_meta_decompress.c | 6 +++--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 952f5e7d54c..232cbff5c89 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -5104,16 +5104,11 @@ static void radv_handle_depth_image_transition(struct radv_cmd_buffer *cmd_buffe radv_initialize_htile(cmd_buffer, image, range, clear_value); } else if (radv_layout_is_htile_compressed(image, src_layout, src_render_loop, src_queue_mask) && !radv_layout_is_htile_compressed(image, dst_layout, dst_render_loop, dst_queue_mask)) { - VkImageSubresourceRange local_range = *range; - local_range.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; - local_range.baseMipLevel = 0; - local_range.levelCount = 1; - cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_DB | RADV_CMD_FLAG_FLUSH_AND_INV_DB_META; - radv_decompress_depth_image_inplace(cmd_buffer, image, - &local_range, sample_locs); + radv_decompress_depth_image_inplace(cmd_buffer, image, range, + sample_locs); cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_DB | RADV_CMD_FLAG_FLUSH_AND_INV_DB_META; diff --git a/src/amd/vulkan/radv_meta.h b/src/amd/vulkan/radv_meta.h index e916b788d0e..53c562b5df6 100644 --- a/src/amd/vulkan/radv_meta.h +++ b/src/amd/vulkan/radv_meta.h @@ -169,11 +169,11 @@ void radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer, void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, - VkImageSubresourceRange *subresourceRange, + const VkImageSubresourceRange *subresourceRange, struct radv_sample_locations_state *sample_locs); void radv_resummarize_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, - VkImageSubresourceRange *subresourceRange, + const VkImageSubresourceRange *subresourceRange, struct radv_sample_locations_state *sample_locs); void radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c index 3a0228c9dea..649a22cda74 100644 --- a/src/amd/vulkan/radv_meta_decompress.c +++ b/src/amd/vulkan/radv_meta_decompress.c @@ -430,7 +430,7 @@ radv_process_depth_image_layer(struct radv_cmd_buffer *cmd_buffer, static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, - VkImageSubresourceRange *subresourceRange, + const VkImageSubresourceRange *subresourceRange, struct radv_sample_locations_state *sample_locs, enum radv_depth_op op) { @@ -501,7 +501,7 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, - VkImageSubresourceRange *subresourceRange, + const VkImageSubresourceRange *subresourceRange, struct radv_sample_locations_state *sample_locs) { assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL); @@ -511,7 +511,7 @@ void radv_decompress_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, void radv_resummarize_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, - VkImageSubresourceRange *subresourceRange, + const VkImageSubresourceRange *subresourceRange, struct radv_sample_locations_state *sample_locs) { assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL); -- 2.30.2