From 29a948e06d49ef113014020b74434b1223ba44f2 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 12 Jan 2016 18:21:18 -0800 Subject: [PATCH] meta/blit: Since _mesa_meta_bind_rb_as_tex_image has only one output, return it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Ian Romanick Reviewed-by: Tapani Pälli --- src/mesa/drivers/common/meta.h | 5 ++--- src/mesa/drivers/common/meta_blit.c | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index 128c342fba1..a41de8bfea6 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -462,10 +462,9 @@ extern void _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target, struct fb_tex_blit_state *blit); -extern GLboolean +extern struct gl_texture_object * _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx, - struct gl_renderbuffer *rb, - struct gl_texture_object **texObj); + struct gl_renderbuffer *rb); struct gl_sampler_object * _mesa_meta_setup_sampler(struct gl_context *ctx, diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c index 4e660d2a571..d33624d1745 100644 --- a/src/mesa/drivers/common/meta_blit.c +++ b/src/mesa/drivers/common/meta_blit.c @@ -640,7 +640,8 @@ 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, &texObj)) + texObj = _mesa_meta_bind_rb_as_tex_image(ctx, rb); + if (texObj == NULL) return false; fb_tex_blit.tempTex = texObj->Name; @@ -882,12 +883,12 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target, _mesa_DeleteTextures(1, &blit->tempTex); } -GLboolean +struct gl_texture_object * _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx, - struct gl_renderbuffer *rb, - struct gl_texture_object **texObj) + struct gl_renderbuffer *rb) { struct gl_texture_image *texImage; + struct gl_texture_object *texObj; GLuint tempTex; const GLenum target = rb->NumSamples > 1 ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D; @@ -895,15 +896,15 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx, tempTex = 0; _mesa_GenTextures(1, &tempTex); if (tempTex == 0) - return false; + return NULL; _mesa_BindTexture(target, tempTex); - *texObj = _mesa_lookup_texture(ctx, tempTex); - texImage = _mesa_get_tex_image(ctx, *texObj, target, 0); + 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, &tempTex); - return false; + return NULL; } if (ctx->Driver.FinishRenderTexture && !rb->NeedsFinishRenderTexture) { @@ -911,9 +912,9 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx, ctx->Driver.FinishRenderTexture(ctx, rb); } - assert(target == (*texObj)->Target); - assert(tempTex == (*texObj)->Name); - return true; + assert(target == texObj->Target); + assert(tempTex == texObj->Name); + return texObj; } struct gl_sampler_object * -- 2.30.2