From a48d767cf2ec82d0c0f893a22d22e8593901b206 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Jul 2007 14:13:48 -0600 Subject: Add a quad 'bufloop' stage to handle glDrawBuffer(GL_FRONT_AND_BACK). This removes the notion of multiple color buffers from all other stages. Will need a bit more work when shaders with multiple render targets arrive. --- src/mesa/pipe/softpipe/sp_quad.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/pipe/softpipe/sp_quad.c') diff --git a/src/mesa/pipe/softpipe/sp_quad.c b/src/mesa/pipe/softpipe/sp_quad.c index 419a720de9..5f34f5f1b3 100644 --- a/src/mesa/pipe/softpipe/sp_quad.c +++ b/src/mesa/pipe/softpipe/sp_quad.c @@ -21,6 +21,16 @@ sp_build_quad_pipeline(struct softpipe_context *sp) sp->quad.first = sp->quad.blend; } + if (sp->framebuffer.num_cbufs == 1) { + /* the usual case: write to exactly one colorbuf */ + sp->cbuf = sp->framebuffer.cbufs[0]; + } + else { + /* insert bufloop stage */ + sp->quad.bufloop->next = sp->quad.first; + sp->quad.first = sp->quad.bufloop; + } + if ( sp->stencil.front_enabled || sp->stencil.front_enabled) { sp->quad.stencil_test->next = sp->quad.first; -- cgit v1.2.3