[Mesa-dev] [PATCH 13/14] svga: simplify surface propagation code in svga_set_framebuffer_state()

Brian Paul brianp at vmware.com
Fri Aug 26 15:27:17 UTC 2016


Rewrite the comment too.
---
 src/gallium/drivers/svga/svga_pipe_misc.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c
index a26e577..7160154 100644
--- a/src/gallium/drivers/svga/svga_pipe_misc.c
+++ b/src/gallium/drivers/svga/svga_pipe_misc.c
@@ -108,7 +108,6 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe,
 {
    struct svga_context *svga = svga_context(pipe);
    struct pipe_framebuffer_state *dst = &svga->curr.framebuffer;
-   boolean propagate = FALSE;
    unsigned i;
 
    /* make sure any pending drawing calls are flushed before changing
@@ -120,22 +119,15 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe,
    dst->height = fb->height;
    dst->nr_cbufs = fb->nr_cbufs;
 
-   /* check if we need to propagate any of the target surfaces */
+   /* Check if we need to propagate any of the render targets which we may
+    * be unbinding.
+    */
    for (i = 0; i < dst->nr_cbufs; i++) {
       struct pipe_surface *s = i < fb->nr_cbufs ? fb->cbufs[i] : NULL;
       if (dst->cbufs[i] && dst->cbufs[i] != s) {
          if (svga_surface_needs_propagation(dst->cbufs[i])) {
-            propagate = TRUE;
-            break;
-         }
-      }
-   }
-
-   if (propagate) {
-      for (i = 0; i < dst->nr_cbufs; i++) {
-         struct pipe_surface *s = i < fb->nr_cbufs ? fb->cbufs[i] : NULL;
-         if (dst->cbufs[i] && dst->cbufs[i] != s)
             svga_propagate_surface(svga, dst->cbufs[i]);
+         }
       }
    }
 
-- 
1.9.1



More information about the mesa-dev mailing list