From 1a535722d31d967c934f7b4d5485de34ae120200 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Wed, 9 Dec 2020 14:41:32 +0100 Subject: [PATCH] v3d: use job's nr_cbufs field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of computing the number of color buffers in the start binning function, just use the job's nr_cbufs, which already contains that value. Reviewed-by: Alejandro PiƱeiro Reviewed-by: Jose Maria Casanova Crespo Signed-off-by: Juan A. Suarez Romero Part-of: --- src/gallium/drivers/v3d/v3dx_draw.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 9fcdc86111c..ab27d774eba 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -81,10 +81,6 @@ v3d_start_binning(struct v3d_context *v3d, struct v3d_job *job) tsda_per_tile_size, "TSDA"); - ubyte nr_cbufs = V3D_MAX_DRAW_BUFFERS; - while (nr_cbufs > 0 && !job->cbufs[nr_cbufs - 1]) - nr_cbufs--; - #if V3D_VERSION >= 41 /* This must go before the binning mode configuration. It is * required for layered framebuffers to work. @@ -101,7 +97,7 @@ v3d_start_binning(struct v3d_context *v3d, struct v3d_job *job) config.width_in_pixels = job->draw_width; config.height_in_pixels = job->draw_height; config.number_of_render_targets = - MAX2(nr_cbufs, 1); + MAX2(job->nr_cbufs, 1); config.multisample_mode_4x = job->msaa; @@ -127,7 +123,7 @@ v3d_start_binning(struct v3d_context *v3d, struct v3d_job *job) config.height_in_tiles = job->draw_tiles_y; /* Must be >= 1 */ config.number_of_render_targets = - MAX2(nr_cbufs, 1); + MAX2(job->nr_cbufs, 1); config.multisample_mode_4x = job->msaa;