From 3738606a52b585108d709ce6be8565fc6144cbc7 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 10 Aug 2007 11:35:57 -0600 Subject: [PATCH] more render to texture work --- src/mesa/state_tracker/st_cb_fbo.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 99c00916f48..64ec8022164 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -283,26 +283,23 @@ st_render_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att) { struct st_context *st = ctx->st; + struct st_renderbuffer *strb = st_renderbuffer(att->Renderbuffer); struct pipe_context *pipe = st->pipe; struct pipe_framebuffer_state framebuffer; - struct pipe_surface *texsurface; struct pipe_mipmap_tree *mt; mt = st_get_texobj_mipmap_tree(att->Texture); - texsurface = pipe->get_tex_surface(pipe, mt, - att->CubeMapFace, - att->TextureLevel, - att->Zoffset); + /* the renderbuffer's surface is inside the mipmap_tree: */ + strb->surface = pipe->get_tex_surface(pipe, mt, + att->CubeMapFace, + att->TextureLevel, + att->Zoffset); - /* - * XXX basically like this... set the current color (or depth) - * drawing surface to be the given texture renderbuffer. - */ + /* update pipe's framebuffer state */ memset(&framebuffer, 0, sizeof(framebuffer)); framebuffer.num_cbufs = 1; - framebuffer.cbufs[0] = texsurface; - + framebuffer.cbufs[0] = strb->surface; if (memcmp(&framebuffer, &st->state.framebuffer, sizeof(framebuffer)) != 0) { st->state.framebuffer = framebuffer; st->pipe->set_framebuffer_state( st->pipe, &framebuffer ); -- 2.30.2