diff options
author | Brian <[email protected]> | 2008-04-14 20:57:15 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2008-04-14 20:57:15 -0600 |
commit | e4b3c13d7a7dbd716bdf4b4d2dda8c6e579bd2d1 (patch) | |
tree | 549f3385bdc299365f919afedcf791f41cd0a0ec /src/mesa/state_tracker | |
parent | b54225ccd6d3bc1b678e27c2f00ebddf5bf1046d (diff) |
gallium: fix multi drawbuffer fb state
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_framebuffer.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 8a95096ec9a..14eeb58cc1b 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -48,7 +48,7 @@ update_framebuffer_state( struct st_context *st ) struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer; struct gl_framebuffer *fb = st->ctx->DrawBuffer; struct st_renderbuffer *strb; - GLuint i; + GLuint i, j; memset(framebuffer, 0, sizeof(*framebuffer)); @@ -58,11 +58,14 @@ update_framebuffer_state( struct st_context *st ) /* Examine Mesa's ctx->DrawBuffer->_ColorDrawBuffers state * to determine which surfaces to draw to */ - framebuffer->num_cbufs = fb->_NumColorDrawBuffers[0]; - for (i = 0; i < framebuffer->num_cbufs; i++) { - strb = st_renderbuffer(fb->_ColorDrawBuffers[0][i]); - assert(strb->surface); - framebuffer->cbufs[i] = strb->surface; + framebuffer->num_cbufs = 0; + for (j = 0; j < MAX_DRAW_BUFFERS; j++) { + for (i = 0; i < fb->_NumColorDrawBuffers[j]; i++) { + strb = st_renderbuffer(fb->_ColorDrawBuffers[j][i]); + assert(strb->surface); + framebuffer->cbufs[framebuffer->num_cbufs] = strb->surface; + framebuffer->num_cbufs++; + } } strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer); |