diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2008-09-11 20:08:44 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2008-09-11 20:09:14 +0100 |
commit | b66ee9e32fa044b39588df67c00858bbab64f13d (patch) | |
tree | be4808c5b980641fe0ca9f081fec2fe5807f8937 /src/mesa | |
parent | 7ee599d30b9538b41bc082e71f9e800acbf09759 (diff) |
st: adapt to new framebuffer struct, with one FIXME outstanding
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_atom_framebuffer.c | 29 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_blit.c | 2 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 80df3b0506..d3886f95cd 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -95,7 +95,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, j; + GLuint i; memset(framebuffer, 0, sizeof(*framebuffer)); @@ -108,20 +108,18 @@ update_framebuffer_state( struct st_context *st ) * to determine which surfaces to draw to */ 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]); - - /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/ - if (strb->rtt) { - /* rendering to a GL texture, may have to update surface */ - update_renderbuffer_surface(st, strb); - } + for (i = 0; i < fb->_NumColorDrawBuffers; i++) { + strb = st_renderbuffer(fb->_ColorDrawBuffers[i]); - assert(strb->surface); - framebuffer->cbufs[framebuffer->num_cbufs] = strb->surface; - framebuffer->num_cbufs++; + /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/ + if (strb->rtt) { + /* rendering to a GL texture, may have to update surface */ + update_renderbuffer_surface(st, strb); } + + assert(strb->surface); + framebuffer->cbufs[framebuffer->num_cbufs] = strb->surface; + framebuffer->num_cbufs++; } strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer); @@ -146,6 +144,7 @@ update_framebuffer_state( struct st_context *st ) cso_set_framebuffer(st->cso_context, framebuffer); +#if 0 if (fb->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) { if (st->frontbuffer_status == FRONT_STATUS_COPY_OF_BACK) { /* XXX copy back buf to front? */ @@ -153,6 +152,10 @@ update_framebuffer_state( struct st_context *st ) /* we're assuming we'll really draw to the front buffer */ st->frontbuffer_status = FRONT_STATUS_DIRTY; } +#else +#warning "fix me" + st->frontbuffer_status = FRONT_STATUS_DIRTY; +#endif } diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index 327bafeb98..2852623472 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -79,7 +79,7 @@ st_BlitFramebuffer(GLcontext *ctx, struct st_renderbuffer *srcRb = st_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer); struct st_renderbuffer *dstRb = - st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]); + st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); struct pipe_surface *srcSurf = srcRb->surface; struct pipe_surface *dstSurf = dstRb->surface; |