From: Marek Olšák Date: Sun, 20 Apr 2014 01:41:47 +0000 (+0200) Subject: st/mesa: remove trailing NULL colorbuffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8a1dfba73e5b675635108e7d8309444704b8fef4;p=mesa.git st/mesa: remove trailing NULL colorbuffers Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Brian Paul --- diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index eb5f783cecb..b195c55b347 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -113,6 +113,12 @@ update_framebuffer_state( struct st_context *st ) pipe_surface_reference(&framebuffer->cbufs[i], NULL); } + /* Remove trailing GL_NONE draw buffers. */ + while (framebuffer->nr_cbufs && + !framebuffer->cbufs[framebuffer->nr_cbufs-1]) { + framebuffer->nr_cbufs--; + } + /* * Depth/Stencil renderbuffer/surface. */