meta/blit: Group the SamplerParameteri calls with the other sampler operations
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 9 Nov 2015 19:39:15 +0000 (11:39 -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_blit.c

index 4dbf0a763087da644192cf7d4f644a5064360da3..42121509bf9099c52ba62e28ec704d1754a58f03 100644 (file)
@@ -896,17 +896,17 @@ _mesa_meta_setup_sampler(struct gl_context *ctx,
 
    _mesa_GenSamplers(1, &sampler);
    _mesa_BindSampler(ctx->Texture.CurrentUnit, sampler);
+   _mesa_SamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, tex_filter);
+   _mesa_SamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, tex_filter);
+   _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
    /* Prepare src texture state */
    _mesa_BindTexture(target, texObj->Name);
-   _mesa_SamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, tex_filter);
-   _mesa_SamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, tex_filter);
    if (target != GL_TEXTURE_RECTANGLE_ARB) {
       _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel);
       _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel);
    }
-   _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-   _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
    return sampler;
 }