On 01/08/2014 10:23 AM, Marek Olšák wrote:
From: Marek Olšák <marek.ol...@amd.com>

---
  src/gallium/auxiliary/util/u_clear.h       | 4 ++++
  src/gallium/auxiliary/util/u_framebuffer.c | 3 +++
  2 files changed, 7 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_clear.h 
b/src/gallium/auxiliary/util/u_clear.h
index 75047c1..db0b9b3 100644
--- a/src/gallium/auxiliary/util/u_clear.h
+++ b/src/gallium/auxiliary/util/u_clear.h
@@ -47,6 +47,10 @@ util_clear(struct pipe_context *pipe,
     for (i = 0; i < framebuffer->nr_cbufs; i++) {
        if (buffers & (PIPE_CLEAR_COLOR0 << i)) {
           struct pipe_surface *ps = framebuffer->cbufs[i];
+
+         if (!ps)
+            continue;
+
           pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, 
ps->height);
        }
     }

I guess I'd prefer to see these as:

if (ps) {
   pipe->clear_render_target(pipe, ps, ...);
}

instead of using continues.  But not a big deal.

Reviewed-by: Brian Paul <bri...@vmware.com>


diff --git a/src/gallium/auxiliary/util/u_framebuffer.c 
b/src/gallium/auxiliary/util/u_framebuffer.c
index 377b802..2e0ef74 100644
--- a/src/gallium/auxiliary/util/u_framebuffer.c
+++ b/src/gallium/auxiliary/util/u_framebuffer.c
@@ -127,6 +127,9 @@ util_framebuffer_min_size(const struct 
pipe_framebuffer_state *fb,
     unsigned i;

     for (i = 0; i < fb->nr_cbufs; i++) {
+      if (!fb->cbufs[i])
+         continue;
+
        w = MIN2(w, fb->cbufs[i]->width);
        h = MIN2(h, fb->cbufs[i]->height);
     }


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to