[Mesa-dev] [PATCH 02/18] mesa: Add _mesa_set_sampler_filters method

Jason Ekstrand jason at jlekstrand.net
Sat Jan 9 12:49:04 PST 2016


On Jan 8, 2016 6:59 PM, "Ian Romanick" <idr at freedesktop.org> wrote:
>
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/main/samplerobj.c | 12 ++++++++++++
>  src/mesa/main/samplerobj.h |  5 +++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
> index 17b3400..3f48ab9f 100644
> --- a/src/mesa/main/samplerobj.c
> +++ b/src/mesa/main/samplerobj.c
> @@ -509,6 +509,18 @@ set_sampler_wrap_r(struct gl_context *ctx, struct
gl_sampler_object *samp,
>     return INVALID_PARAM;
>  }
>
> +void
> +_mesa_set_sampler_filters(struct gl_context *ctx,
> +                          struct gl_sampler_object *samp,
> +                          GLenum min_filter, GLenum mag_filter)
> +{

Maybe add asserts like you did on the others?

> +   if (samp->MinFilter == min_filter && samp->MagFilter == mag_filter)
> +      return;
> +
> +   flush(ctx);
> +   samp->MinFilter = min_filter;
> +   samp->MagFilter = mag_filter;
> +}
>
>  static GLuint
>  set_sampler_min_filter(struct gl_context *ctx, struct gl_sampler_object
*samp,
> diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
> index 1817c1a..c35052e 100644
> --- a/src/mesa/main/samplerobj.h
> +++ b/src/mesa/main/samplerobj.h
> @@ -84,6 +84,11 @@ extern void
>  _mesa_set_sampler_wrap(struct gl_context *ctx, struct gl_sampler_object
*samp,
>                         GLenum s, GLenum t, GLenum r);
>
> +extern void
> +_mesa_set_sampler_filters(struct gl_context *ctx,
> +                          struct gl_sampler_object *samp,
> +                          GLenum min_filter, GLenum mag_filter);
> +
>  void GLAPIENTRY
>  _mesa_GenSamplers(GLsizei count, GLuint *samplers);
>  void GLAPIENTRY
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20160109/e4ee6e4e/attachment.html>


More information about the mesa-dev mailing list