From f0f9a22609ccf2b8edc5760480f1a7a78cb504d7 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 Jul 2007 16:17:14 -0600 Subject: minor changes, comments about multiple color buffers, MRT. --- src/mesa/pipe/softpipe/sp_quad_bufloop.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/pipe/softpipe') diff --git a/src/mesa/pipe/softpipe/sp_quad_bufloop.c b/src/mesa/pipe/softpipe/sp_quad_bufloop.c index 977cc74c26..76e7fd5889 100644 --- a/src/mesa/pipe/softpipe/sp_quad_bufloop.c +++ b/src/mesa/pipe/softpipe/sp_quad_bufloop.c @@ -23,9 +23,15 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad) /* make copy of original colors since they can get modified * by blending and masking. + * XXX we won't have to do this if the fragment program actually emits + * N separate colors and we're drawing to N color buffers (MRT). + * But if we emitted one color and glDrawBuffer(GL_FRONT_AND_BACK) is + * in effect, we need to save/restore colors like this. */ memcpy(tmp, quad->outputs.color, sz); + assert(softpipe->framebuffer.num_cbufs <= PIPE_MAX_COLOR_BUFS); + for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) { /* set current cbuffer */ softpipe->cbuf = softpipe->framebuffer.cbufs[i]; @@ -45,7 +51,8 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad) /** * Create the colorbuffer loop stage. - * This is used to implement GL_FRONT_AND_BACK rendering. + * This is used to implement multiple render targets and GL_FRONT_AND_BACK + * rendering. */ struct quad_stage *sp_quad_bufloop_stage( struct softpipe_context *softpipe ) { -- cgit v1.2.3