summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-01-14 11:14:49 -0800
committerIan Romanick <[email protected]>2018-01-02 16:23:51 -0800
commitc36e3d30169da668e6185fbdd135e1b67297815f (patch)
tree24d92e21a0a0aa2a20036db62763c17d8550f1f6
parent05f4be96418b23abb3dc23666d5fa200696b1d4e (diff)
meta/blit: Track temporary texture using gl_texture_object instead of GL API object handle
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
-rw-r--r--src/mesa/drivers/common/meta.h2
-rw-r--r--src/mesa/drivers/common/meta_blit.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 863997e9cc5..252b2367163 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -313,8 +313,8 @@ struct fb_tex_blit_state
struct gl_sampler_object *samp_obj;
struct gl_sampler_object *samp_obj_save;
struct gl_texture_object *tex_obj;
+ struct gl_texture_object *temp_tex_obj;
GLuint stencilSamplingSave;
- GLuint tempTex;
};
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index ea0bd3fead1..0c08109e107 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -644,7 +644,7 @@ blitframebuffer_texture(struct gl_context *ctx,
if (texObj == NULL)
return false;
- fb_tex_blit.tempTex = texObj->Name;
+ fb_tex_blit.temp_tex_obj = texObj;
srcLevel = 0;
if (_mesa_is_winsys_fbo(readFb)) {
@@ -834,7 +834,7 @@ _mesa_meta_fb_tex_blit_begin(struct gl_context *ctx,
blit->samp_obj_save = NULL;
_mesa_reference_sampler_object(ctx, &blit->samp_obj_save,
ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler);
- blit->tempTex = 0;
+ blit->temp_tex_obj = NULL;
}
void
@@ -845,13 +845,13 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target,
_mesa_get_current_tex_object(ctx, target);
/* Either there is no temporary texture or the temporary texture is bound. */
- assert(blit->tempTex == 0 || texObj->Name == blit->tempTex);
+ assert(blit->temp_tex_obj == NULL || blit->temp_tex_obj == texObj);
/* Restore texture object state, the texture binding will be restored by
* _mesa_meta_end(). If the texture is the temporary texture that is about
* to be destroyed, don't bother restoring its state.
*/
- if (blit->tempTex == 0) {
+ if (blit->temp_tex_obj == NULL) {
/* If the target restricts values for base level or max level, we assume
* that the original values were valid.
*/
@@ -880,8 +880,8 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target,
_mesa_reference_sampler_object(ctx, &blit->samp_obj_save, NULL);
_mesa_reference_sampler_object(ctx, &blit->samp_obj, NULL);
- if (blit->tempTex)
- _mesa_DeleteTextures(1, &blit->tempTex);
+ if (blit->temp_tex_obj)
+ _mesa_DeleteTextures(1, &blit->temp_tex_obj->Name);
}
struct gl_texture_object *