summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-04-20 03:41:47 +0200
committerMarek Olšák <[email protected]>2014-04-25 01:33:12 +0200
commit8a1dfba73e5b675635108e7d8309444704b8fef4 (patch)
tree3d8dc2724045b7ad43bf03fd63c20b236f823e26
parente522c455e40b06a89885d413d564df40015259b3 (diff)
st/mesa: remove trailing NULL colorbuffers
Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c6
1 files changed, 6 insertions, 0 deletions
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.
*/