radeonsi: add num_layers variable into si_do_fast_color_clear

in preparation for the next commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
This commit is contained in:
Marek Olšák 2021-03-19 20:45:08 -04:00 committed by Marge Bot
parent 1936a046b1
commit cb6e1c7c11

View file

@ -461,9 +461,11 @@ static void si_do_fast_color_clear(struct si_context *sctx, unsigned *buffers,
if (sctx->chip_class >= GFX9 && tex->buffer.b.b.last_level > 0)
continue;
unsigned num_layers = util_num_layers(&tex->buffer.b.b, level);
/* the clear is allowed if all layers are bound */
if (fb->cbufs[i]->u.tex.first_layer != 0 ||
fb->cbufs[i]->u.tex.last_layer != util_max_layer(&tex->buffer.b.b, 0)) {
fb->cbufs[i]->u.tex.last_layer != num_layers - 1) {
continue;
}