radv: fix fast clearing depth images with mips on GFX10+

Found by inspection.

Cc: 21.2 mesa-stable
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/12325>
(cherry picked from commit b16f3261a7)
This commit is contained in:
Samuel Pitoiset 2021-08-11 14:06:09 +02:00 committed by Dylan Baker
parent 22406c6316
commit 1225326046
2 changed files with 9 additions and 1 deletions

View file

@ -139,7 +139,7 @@
"description": "radv: fix fast clearing depth images with mips on GFX10+",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -986,6 +986,14 @@ radv_can_fast_clear_depth(struct radv_cmd_buffer *cmd_buffer, const struct radv_
!radv_is_fast_clear_stencil_allowed(clear_value))))
return false;
if (iview->image->info.levels > 1) {
uint32_t last_level = iview->base_mip + iview->level_count - 1;
if (last_level >= iview->image->planes[0].surface.num_meta_levels) {
/* Do not fast clears if one level can't be fast cleared. */
return false;
}
}
return true;
}