From: Brian Paul Date: Wed, 19 Mar 2008 23:04:49 +0000 (-0600) Subject: gallium: need to set/save framebuffer state in st_context since we use it elsewhere X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11c34dc644fe58b8178ab9142929a6685e3c0848;p=mesa.git gallium: need to set/save framebuffer state in st_context since we use it elsewhere --- diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index c8fa0cbdfb6..43259c3ecb1 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -45,39 +45,39 @@ static void update_framebuffer_state( struct st_context *st ) { - struct pipe_framebuffer_state framebuffer; + struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer; struct gl_framebuffer *fb = st->ctx->DrawBuffer; struct st_renderbuffer *strb; GLuint i; - memset(&framebuffer, 0, sizeof(framebuffer)); + memset(framebuffer, 0, sizeof(*framebuffer)); /* 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++) { + 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->cbufs[i] = strb->surface; } strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer); if (strb) { strb = st_renderbuffer(strb->Base.Wrapped); assert(strb->surface); - framebuffer.zsbuf = strb->surface; + framebuffer->zsbuf = strb->surface; } else { strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer); if (strb) { strb = st_renderbuffer(strb->Base.Wrapped); assert(strb->surface); - framebuffer.zsbuf = strb->surface; + framebuffer->zsbuf = strb->surface; } } - cso_set_framebuffer(st->cso_context, &framebuffer); + cso_set_framebuffer(st->cso_context, framebuffer); }