[Mesa-dev] [PATCH 02/18] mesa: Add _mesa_set_sampler_filters method
Ian Romanick
idr at freedesktop.org
Fri Jan 8 18:59:08 PST 2016
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)
+{
+ 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
More information about the mesa-dev
mailing list