summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-04-09 14:57:41 -0600
committerBrian Paul <[email protected]>2009-04-09 15:02:48 -0600
commite53d6ab39bf04b2bb39ad23d5990494321ee77ce (patch)
treecfcdb4830672fe5552358c376a4292ea15fa64c7
parent227aa0070d3b13baaa87270fd1a45fa5904ae3dc (diff)
st: rearrange some code to be a little more clear
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c16
1 files changed, 7 insertions, 9 deletions
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:
*/