summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-04-22 10:38:41 -0700
committerEric Anholt <[email protected]>2013-05-06 14:33:38 -0700
commit749a92786d378ee55cf9ebbbe8596c217fbae0f9 (patch)
tree57b80a3a7cc6378d6db4b8172ea56e58f3410f44 /src/mesa/state_tracker
parent5b9609f59ac4e9079a6dea1212178070a45ab8e9 (diff)
mesa: Make core Mesa allocate the texture renderbuffer wrapper.
Every driver did the same thing. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 7335bb4bac5..affe6561b15 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -390,8 +390,8 @@ st_render_texture(struct gl_context *ctx,
{
struct st_context *st = st_context(ctx);
struct pipe_context *pipe = st->pipe;
- struct st_renderbuffer *strb;
- struct gl_renderbuffer *rb;
+ struct gl_renderbuffer *rb = att->Renderbuffer;
+ struct st_renderbuffer *strb = st_renderbuffer(rb);
struct pipe_resource *pt;
struct st_texture_object *stObj;
const struct gl_texture_image *texImage;
@@ -406,24 +406,6 @@ st_render_texture(struct gl_context *ctx,
/* get pointer to texture image we're rendeing to */
texImage = _mesa_get_attachment_teximage(att);
- /* create new renderbuffer which wraps the texture image.
- * Use the texture's name as the renderbuffer's name so that we have
- * something that's non-zero (to determine vertical orientation) and
- * possibly helpful for debugging.
- */
- rb = st_new_renderbuffer(ctx, att->Texture->Name);
- if (!rb) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture()");
- return;
- }
-
- _mesa_reference_renderbuffer(&att->Renderbuffer, rb);
- assert(rb->RefCount == 1);
- rb->AllocStorage = NULL; /* should not get called */
- strb = st_renderbuffer(rb);
-
- assert(strb->Base.RefCount > 0);
-
/* get the texture for the texture object */
stObj = st_texture_object(att->Texture);