diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2015-11-10 16:26:38 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2016-01-11 15:38:03 -0800 |
commit | d4094f64c1c1d94125931c95a2dad04ab1261ff2 (patch) | |
tree | ed63d5fe463b40f26a2eb008ab46b390930524f7 | |
parent | 1998af813af1078b4d19750ea4a634da8e42d8ea (diff) |
meta/decompress: Track sampler using gl_sampler_object instead of GL API object handle
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
-rw-r--r-- | src/mesa/drivers/common/meta.c | 22 | ||||
-rw-r--r-- | src/mesa/drivers/common/meta.h | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 66a71325a8..3fc966c8f4 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2986,8 +2986,8 @@ meta_decompress_cleanup(struct gl_context *ctx, _mesa_reference_buffer_object(ctx, &decompress->buf_obj, NULL); } - if (decompress->Sampler != 0) - _mesa_DeleteSamplers(1, &decompress->Sampler); + if (decompress->samp_obj != NULL) + _mesa_DeleteSamplers(1, &decompress->samp_obj->Name); memset(decompress, 0, sizeof(*decompress)); } @@ -3113,25 +3113,25 @@ decompress_texture_image(struct gl_context *ctx, &decompress->buf_obj, 3); } - if (!decompress->Sampler) { - struct gl_sampler_object *samp_obj; + if (decompress->samp_obj == NULL) { + GLuint sampler; - _mesa_GenSamplers(1, &decompress->Sampler); + _mesa_GenSamplers(1, &sampler); - samp_obj = _mesa_lookup_samplerobj(ctx, decompress->Sampler); - assert(samp_obj != NULL && samp_obj->Name == decompress->Sampler); + decompress->samp_obj = _mesa_lookup_samplerobj(ctx, sampler); + assert(decompress->samp_obj != NULL && decompress->samp_obj->Name == sampler); - _mesa_BindSampler(ctx->Texture.CurrentUnit, decompress->Sampler); + _mesa_bind_sampler(ctx, ctx->Texture.CurrentUnit, decompress->samp_obj); /* nearest filtering */ - _mesa_set_sampler_filters(ctx, samp_obj, GL_NEAREST, GL_NEAREST); + _mesa_set_sampler_filters(ctx, decompress->samp_obj, GL_NEAREST, GL_NEAREST); /* No sRGB decode or encode.*/ if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_set_sampler_srgb_decode(ctx, samp_obj, GL_SKIP_DECODE_EXT); + _mesa_set_sampler_srgb_decode(ctx, decompress->samp_obj, GL_SKIP_DECODE_EXT); } } else { - _mesa_BindSampler(ctx->Texture.CurrentUnit, decompress->Sampler); + _mesa_bind_sampler(ctx, ctx->Texture.CurrentUnit, decompress->samp_obj); } /* Silence valgrind warnings about reading uninitialized stack. */ diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index f0ac818019..d7d8fd38d8 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -392,7 +392,7 @@ struct decompress_state GLuint VAO; struct decompress_fbo_state byteFBO, floatFBO; struct gl_buffer_object *buf_obj; - GLuint Sampler; + struct gl_sampler_object *samp_obj; struct blit_shader_table shaders; }; |