[Mesa-dev] [PATCH 13/18] meta/decompress: Use internal functions for sampler object access

Ian Romanick idr at freedesktop.org
Fri Jan 8 18:59:19 PST 2016


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/common/meta.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 36bed77..66a7132 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3114,15 +3114,20 @@ decompress_texture_image(struct gl_context *ctx,
    }
 
    if (!decompress->Sampler) {
+      struct gl_sampler_object *samp_obj;
+
       _mesa_GenSamplers(1, &decompress->Sampler);
+
+      samp_obj = _mesa_lookup_samplerobj(ctx, decompress->Sampler);
+      assert(samp_obj != NULL && samp_obj->Name == decompress->Sampler);
+
       _mesa_BindSampler(ctx->Texture.CurrentUnit, decompress->Sampler);
       /* nearest filtering */
-      _mesa_SamplerParameteri(decompress->Sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-      _mesa_SamplerParameteri(decompress->Sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+      _mesa_set_sampler_filters(ctx, samp_obj, GL_NEAREST, GL_NEAREST);
+
       /* No sRGB decode or encode.*/
       if (ctx->Extensions.EXT_texture_sRGB_decode) {
-         _mesa_SamplerParameteri(decompress->Sampler, GL_TEXTURE_SRGB_DECODE_EXT,
-                             GL_SKIP_DECODE_EXT);
+         _mesa_set_sampler_srgb_decode(ctx, samp_obj, GL_SKIP_DECODE_EXT);
       }
 
    } else {
-- 
2.5.0



More information about the mesa-dev mailing list