summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_clear.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-06-27 15:06:15 +0200
committerSamuel Pitoiset <[email protected]>2019-07-01 14:58:56 +0200
commitcc50c85e1378c560785cf8b241ffa4cdb36f0c29 (patch)
tree788873fb7e14800f4b951b49a847459ea3929e7a /src/amd/vulkan/radv_meta_clear.c
parent3fd21a6b776e0f874e0e14d9943ac2b06bcc4aad (diff)
radv: make sure to mark the image as compressed when clearing DCC levels
Found while working on DCC for arrays. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_clear.c')
-rw-r--r--src/amd/vulkan/radv_meta_clear.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index 091b73841f8..b0b17f4f7b3 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1367,7 +1367,7 @@ radv_clear_fmask(struct radv_cmd_buffer *cmd_buffer,
return radv_fill_buffer(cmd_buffer, image->bo, offset, size, value);
}
-uint32_t
+static uint32_t
radv_dcc_clear_level(struct radv_cmd_buffer *cmd_buffer,
const struct radv_image *image,
uint32_t level, uint32_t value)
@@ -1383,9 +1383,11 @@ radv_dcc_clear_level(struct radv_cmd_buffer *cmd_buffer,
const struct legacy_surf_level *surf_level =
&image->planes[0].surface.u.legacy.level[level];
- /* If this is 0, fast clear isn't possible. */
- assert(surf_level->dcc_fast_clear_size);
-
+ /* If dcc_fast_clear_size is 0 (which might happens for
+ * mipmaps) the fill buffer operation below is a no-op. This
+ * can only happen during initialization as the fast clear path
+ * fallbacks to slow clears if one level can't be fast cleared.
+ */
offset += surf_level->dcc_offset;
size = surf_level->dcc_fast_clear_size;
}