meta/decompress: Use internal functions for sampler object access
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 10 Nov 2015 23:33:20 +0000 (15:33 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 11 Jan 2016 23:38:03 +0000 (15:38 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/common/meta.c

index 36bed77b48199f4fbc89e7f7a0a94a1e6d889f60..66a71325a8580b3a5798817f7cadf233f90c8db6 100644 (file)
@@ -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 {