diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_fbo.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 4452e523b..826722be8 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -38,7 +38,6 @@ #include "main/fbobject.h" #include "main/framebuffer.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/renderbuffer.h" #include "pipe/p_context.h" @@ -391,11 +390,10 @@ 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; struct pipe_surface surf_tmpl; if (!st_finalize_texture(ctx, pipe, att->Texture)) @@ -404,27 +402,6 @@ st_render_texture(struct gl_context *ctx, pt = st_get_texobj_resource(att->Texture); assert(pt); - /* 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); @@ -434,11 +411,6 @@ st_render_texture(struct gl_context *ctx, strb->rtt_face = att->CubeMapFace; strb->rtt_slice = att->Zoffset; - rb->Width = texImage->Width2; - rb->Height = texImage->Height2; - rb->_BaseFormat = texImage->_BaseFormat; - rb->InternalFormat = texImage->InternalFormat; - pipe_resource_reference( &strb->texture, pt ); pipe_surface_release(pipe, &strb->surface); @@ -477,10 +449,9 @@ st_render_texture(struct gl_context *ctx, * Called via ctx->Driver.FinishRenderTexture. */ static void -st_finish_render_texture(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att) +st_finish_render_texture(struct gl_context *ctx, struct gl_renderbuffer *rb) { - struct st_renderbuffer *strb = st_renderbuffer(att->Renderbuffer); + struct st_renderbuffer *strb = st_renderbuffer(rb); if (!strb) return; @@ -527,7 +498,7 @@ st_validate_attachment(struct gl_context *ctx, return GL_FALSE; format = stObj->pt->format; - texFormat = _mesa_get_attachment_teximage_const(att)->TexFormat; + texFormat = att->Renderbuffer->TexImage->TexFormat; /* If the encoding is sRGB and sRGB rendering cannot be enabled, * check for linear format support instead. |