diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_framebuffer.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_atom_framebuffer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c index a17417c35..b195c55b3 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/mesalib/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. */ @@ -147,11 +153,10 @@ update_framebuffer_state( struct st_context *st ) } #endif - /* _mesa_test_framebuffer_completeness refuses framebuffers with no - * attachments, so this should never happen. - */ - assert(framebuffer->width != UINT_MAX); - assert(framebuffer->height != UINT_MAX); + if (framebuffer->width == UINT_MAX) + framebuffer->width = 0; + if (framebuffer->height == UINT_MAX) + framebuffer->height = 0; cso_set_framebuffer(st->cso_context, framebuffer); } |