radeonsi: merge 2 identical if statements in si_clear
authorMarek Olšák <marek.olsak@amd.com>
Wed, 28 Mar 2018 01:57:26 +0000 (21:57 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 13 Apr 2018 16:31:04 +0000 (12:31 -0400)
and other cleanups

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeonsi/si_clear.c

index 5be78ca3e6f0239e2dddf1e6db9532ef6b60c196..f8136d2b2c4310efd8f5164c92d2d9fd172d2136 100644 (file)
@@ -528,20 +528,13 @@ static void si_clear(struct pipe_context *ctx, unsigned buffers,
                si_do_fast_color_clear(sctx, &buffers, color);
                if (!buffers)
                        return; /* all buffers have been fast cleared */
-       }
-
-       if (buffers & PIPE_CLEAR_COLOR) {
-               int i;
 
                /* These buffers cannot use fast clear, make sure to disable expansion. */
-               for (i = 0; i < fb->nr_cbufs; i++) {
+               for (unsigned i = 0; i < fb->nr_cbufs; i++) {
                        struct r600_texture *tex;
 
                        /* If not clearing this buffer, skip. */
-                       if (!(buffers & (PIPE_CLEAR_COLOR0 << i)))
-                               continue;
-
-                       if (!fb->cbufs[i])
+                       if (!(buffers & (PIPE_CLEAR_COLOR0 << i)) || !fb->cbufs[i])
                                continue;
 
                        tex = (struct r600_texture *)fb->cbufs[i]->texture;