summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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:
*/