summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-01-12 18:17:33 -0800
committerIan Romanick <[email protected]>2018-01-02 16:23:51 -0800
commit44e153616d5f6b02a527510c196dee9ca368542f (patch)
treef5dfff604eab48eb4b347edd5b58e3b7cfb81d0b
parent922ee3b493d3e0bd58525399952e358e0dbd48f7 (diff)
meta/blit: Don't return the texture handle from _mesa_meta_bind_rb_as_tex_image
It's always the same as *texObj->Name. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
-rw-r--r--src/mesa/drivers/common/meta.h1
-rw-r--r--src/mesa/drivers/common/meta_blit.c15
2 files changed, 7 insertions, 9 deletions
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 16dd8e293d4..128c342fba1 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -465,7 +465,6 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target,
extern GLboolean
_mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
struct gl_renderbuffer *rb,
- GLuint *tex,
struct gl_texture_object **texObj);
struct gl_sampler_object *
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index f7e29bcfc6f..4e660d2a571 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -640,10 +640,11 @@ blitframebuffer_texture(struct gl_context *ctx,
srcLevel = readAtt->TextureLevel;
texObj = readAtt->Texture;
} else if (!readAtt->Texture && ctx->Driver.BindRenderbufferTexImage) {
- if (!_mesa_meta_bind_rb_as_tex_image(ctx, rb, &fb_tex_blit.tempTex,
- &texObj))
+ if (!_mesa_meta_bind_rb_as_tex_image(ctx, rb, &texObj))
return false;
+ fb_tex_blit.tempTex = texObj->Name;
+
srcLevel = 0;
if (_mesa_is_winsys_fbo(readFb)) {
GLint temp = srcY0;
@@ -884,7 +885,6 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target,
GLboolean
_mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
struct gl_renderbuffer *rb,
- GLuint *tex,
struct gl_texture_object **texObj)
{
struct gl_texture_image *texImage;
@@ -897,14 +897,12 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
if (tempTex == 0)
return false;
- *tex = tempTex;
-
- _mesa_BindTexture(target, *tex);
- *texObj = _mesa_lookup_texture(ctx, *tex);
+ _mesa_BindTexture(target, tempTex);
+ *texObj = _mesa_lookup_texture(ctx, tempTex);
texImage = _mesa_get_tex_image(ctx, *texObj, target, 0);
if (!ctx->Driver.BindRenderbufferTexImage(ctx, rb, texImage)) {
- _mesa_DeleteTextures(1, tex);
+ _mesa_DeleteTextures(1, &tempTex);
return false;
}
@@ -914,6 +912,7 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
}
assert(target == (*texObj)->Target);
+ assert(tempTex == (*texObj)->Name);
return true;
}