summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-11-10 16:26:38 -0800
committerIan Romanick <[email protected]>2016-01-11 15:38:03 -0800
commitd4094f64c1c1d94125931c95a2dad04ab1261ff2 (patch)
treeed63d5fe463b40f26a2eb008ab46b390930524f7 /src
parent1998af813af1078b4d19750ea4a634da8e42d8ea (diff)
meta/decompress: Track sampler using gl_sampler_object instead of GL API object handle
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/common/meta.c22
-rw-r--r--src/mesa/drivers/common/meta.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 66a71325a85..3fc966c8f40 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 f0ac818019f..d7d8fd38d89 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;
};