From 8a1dfba73e5b675635108e7d8309444704b8fef4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 20 Apr 2014 03:41:47 +0200 Subject: [PATCH] st/mesa: remove trailing NULL colorbuffers Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Brian Paul --- src/mesa/state_tracker/st_atom_framebuffer.c | 6 ++++++ 1 file changed, 6 insertions(+) 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. */ -- 2.30.2