From e53d6ab39bf04b2bb39ad23d5990494321ee77ce Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 9 Apr 2009 14:57:41 -0600 Subject: st: rearrange some code to be a little more clear --- src/mesa/state_tracker/st_cb_fbo.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 92d53da4dbc..1590f275e2a 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -96,28 +96,22 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, pipe_surface_reference( &strb->surface, NULL ); pipe_texture_reference( &strb->texture, NULL ); - + /* Setup new texture template. + */ memset(&template, 0, sizeof(template)); - + template.target = PIPE_TEXTURE_2D; if (strb->format != PIPE_FORMAT_NONE) { template.format = strb->format; } else { template.format = st_choose_renderbuffer_format(pipe, internalFormat); } - - strb->Base.Width = width; - strb->Base.Height = height; - init_renderbuffer_bits(strb, template.format); - - template.target = PIPE_TEXTURE_2D; pf_get_block(template.format, &template.block); template.width[0] = width; template.height[0] = height; template.depth[0] = 1; template.last_level = 0; template.nr_samples = rb->NumSamples; - if (pf_is_depth_stencil(template.format)) { template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL; } @@ -126,6 +120,10 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, PIPE_TEXTURE_USAGE_RENDER_TARGET); } + /* init renderbuffer fields */ + strb->Base.Width = width; + strb->Base.Height = height; + init_renderbuffer_bits(strb, template.format); /* Probably need dedicated flags for surface usage too: */ -- cgit v1.2.3