summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_framebuffer.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-04-15 13:23:23 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-04-15 13:23:23 +1000
commit276e177dfb644c60af6247598cda6c1c49dfea7b (patch)
treedac9407ee5e6cb67af67d8b52603ab8e2d5312ae /src/mesa/state_tracker/st_atom_framebuffer.c
parent7f811f2c42937f254ae1b11e5b0ece765a8ea31b (diff)
parentd3878b070b7b5084526b65499737cc686a6039b6 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_atom_framebuffer.c')
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index 02573af8f0..14eeb58cc1 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);
@@ -81,6 +84,14 @@ update_framebuffer_state( struct st_context *st )
}
cso_set_framebuffer(st->cso_context, framebuffer);
+
+ if (fb->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) {
+ if (st->frontbuffer_status == FRONT_STATUS_COPY_OF_BACK) {
+ /* XXX copy back buf to front? */
+ }
+ /* we're assuming we'll really draw to the front buffer */
+ st->frontbuffer_status = FRONT_STATUS_DIRTY;
+ }
}