summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-01-12 18:21:18 -0800
committerIan Romanick <[email protected]>2018-01-02 16:23:51 -0800
commit29a948e06d49ef113014020b74434b1223ba44f2 (patch)
tree18203f4bbc307a025ddd40f0c7ed3ae9a8233a19
parent44e153616d5f6b02a527510c196dee9ca368542f (diff)
meta/blit: Since _mesa_meta_bind_rb_as_tex_image has only one output, return it
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
-rw-r--r--src/mesa/drivers/common/meta.h5
-rw-r--r--src/mesa/drivers/common/meta_blit.c23
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 *