summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2014-11-12 10:02:35 -0800
committerLaura Ekstrand <laura@jlekstrand.net>2014-11-12 10:02:35 -0800
commit9d028ba28cc987bea2eafe7a1d4e63d6c2de4eb0 (patch)
treee5e01f8ba2b56d68ae8dc44c1ab51333e70a38c7
parent431651916a1e7d4d4c8f602a36a25b7da911630f (diff)
Refactored _mesa_meta_bind_rb_as_tex_image.bindless-metaarb_direct_state_access
-rw-r--r--src/mesa/drivers/common/meta.h3
-rw-r--r--src/mesa/drivers/common/meta_blit.c15
-rw-r--r--src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c3
3 files changed, 10 insertions, 11 deletions
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 3038bae4dd..e861a2bf73 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -458,8 +458,7 @@ _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,
- struct gl_texture_object **texObj1,
- struct gl_texture_object **texObj2,
+ struct gl_texture_object **texObjPtr,
GLenum *target);
GLuint
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index 5efeaacfb9..a78917f20c 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -585,9 +585,10 @@ blitframebuffer_texture(struct gl_context *ctx,
target = texObj->Target;
} else if (!readAtt->Texture && ctx->Driver.BindRenderbufferTexImage) {
if (!_mesa_meta_bind_rb_as_tex_image(ctx, rb, &fb_tex_blit.tempTexObj,
- &texObj, &target))
+ &target))
return false;
+ texObj = fb_tex_blit.tempTexObj;
srcLevel = 0;
if (_mesa_is_winsys_fbo(readFb)) {
GLint temp = srcY0;
@@ -804,12 +805,11 @@ _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,
- struct gl_texture_object **texObj1,
- struct gl_texture_object **texObj2,
+ struct gl_texture_object **texObjPtr,
GLenum *target)
{
struct gl_texture_image *texImage;
- GLuint name;
+ GLuint name = 0;
if (rb->NumSamples > 1)
*target = GL_TEXTURE_2D_MULTISAMPLE;
@@ -819,11 +819,10 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
_mesa_CreateTextures(*target, 1, &name);
if (name == 0)
return false;
- *texObj1 = _mesa_lookup_texture(ctx, name);
+ *texObjPtr = _mesa_lookup_texture(ctx, name);
- _mesa_bind_texture_unit(ctx, ctx->Texture.CurrentUnit, *texObj1);
- *texObj2 = *texObj1;
- texImage = _mesa_get_tex_image(ctx, *texObj1, *target, 0);
+ _mesa_bind_texture_unit(ctx, ctx->Texture.CurrentUnit, *texObjPtr);
+ texImage = _mesa_get_tex_image(ctx, *texObjPtr, *target, 0);
if (!ctx->Driver.BindRenderbufferTexImage(ctx, rb, texImage)) {
_mesa_DeleteTextures(1, &name);
diff --git a/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c b/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
index b291d8f1d7..23ce5c23dd 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
@@ -388,9 +388,10 @@ set_read_rb_tex_image(struct gl_context *ctx, struct fb_tex_blit_state *blit,
level = att->TextureLevel;
} else {
if (!_mesa_meta_bind_rb_as_tex_image(ctx, rb, &blit->tempTexObj,
- &tex_obj, target)) {
+ target)) {
return false;
}
+ tex_obj = blit->tempTexObj;
}
blit->baseLevelSave = tex_obj->BaseLevel;