gallium/util: minor clean-ups in u_framebuffer.c

Replace tabs w/ spaces, move vars.

Signed-off-by: Brian Paul <brian.paul@broadcom.com>
Reviewed-by: Neha Bhende <neha.bhende@broadcom.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35238>
This commit is contained in:
Brian Paul 2025-03-25 16:49:02 -06:00 committed by Marge Bot
parent 64da531799
commit ce70baeef3

View file

@ -27,7 +27,7 @@
/**
* @file
* Framebuffer utility functions.
*
*
* @author Brian Paul
*/
@ -184,28 +184,28 @@ util_framebuffer_min_size(const struct pipe_framebuffer_state *fb,
unsigned
util_framebuffer_get_num_layers(const struct pipe_framebuffer_state *fb)
{
unsigned i, num_layers = 0;
/**
* In the case of ARB_framebuffer_no_attachment
* we obtain the number of layers directly from
* the framebuffer state.
*/
if (!(fb->nr_cbufs || fb->zsbuf.texture))
return fb->layers;
/**
* In the case of ARB_framebuffer_no_attachment
* we obtain the number of layers directly from
* the framebuffer state.
*/
if (!(fb->nr_cbufs || fb->zsbuf.texture))
return fb->layers;
unsigned num_layers = 0;
for (i = 0; i < fb->nr_cbufs; i++) {
if (fb->cbufs[i].texture) {
unsigned num = fb->cbufs[i].last_layer - fb->cbufs[i].first_layer + 1;
num_layers = MAX2(num_layers, num);
}
}
if (fb->zsbuf.texture) {
unsigned num = fb->zsbuf.last_layer -
fb->zsbuf.first_layer + 1;
num_layers = MAX2(num_layers, num);
}
return num_layers;
for (unsigned i = 0; i < fb->nr_cbufs; i++) {
if (fb->cbufs[i].texture) {
unsigned num = fb->cbufs[i].last_layer - fb->cbufs[i].first_layer + 1;
num_layers = MAX2(num_layers, num);
}
}
if (fb->zsbuf.texture) {
unsigned num = fb->zsbuf.last_layer -
fb->zsbuf.first_layer + 1;
num_layers = MAX2(num_layers, num);
}
return num_layers;
}