summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2021-01-07 16:18:03 +0100
committerMarge Bot <eric+marge@anholt.net>2021-01-11 15:42:22 +0000
commit5e8f6967b1d148109fbaa38fc4a70f71f8965932 (patch)
tree7fe0e8b53d27fd66e68819dfdcc59479b5243e3e
parent7a3e6f5ac2a3773feb156d4e01bc17061baafb98 (diff)
radv: add support for fast-clearing DCC layers on GFX9+
Layers are contiguous in memory. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8368>
-rw-r--r--src/amd/vulkan/radv_meta_clear.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index 4461ba44c96..66e9db40d04 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1401,6 +1401,7 @@ radv_clear_dcc(struct radv_cmd_buffer *cmd_buffer,
const VkImageSubresourceRange *range, uint32_t value)
{
uint32_t level_count = radv_get_levelCount(image, range);
+ uint32_t layer_count = radv_get_layerCount(image, range);
uint32_t flush_bits = 0;
/* Mark the image as being compressed. */
@@ -1414,7 +1415,9 @@ radv_clear_dcc(struct radv_cmd_buffer *cmd_buffer,
if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) {
/* Mipmap levels aren't implemented. */
assert(level == 0);
- size = image->planes[0].surface.dcc_size;
+
+ offset += image->planes[0].surface.dcc_slice_size * range->baseArrayLayer;
+ size = image->planes[0].surface.dcc_slice_size * layer_count;
} else {
const struct legacy_surf_level *surf_level =
&image->planes[0].surface.u.legacy.level[level];