summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-11-09 11:55:59 -0800
committerIan Romanick <[email protected]>2016-01-11 15:38:03 -0800
commit08822b4b43e3bc51bbcc42ab01ba1095b30a9298 (patch)
treebdb9044eb11f202d07610c5a0453a0fba77137a1
parent3029d60de7244ed8c460ad8ee2408d27ed494a6b (diff)
mesa: Add _mesa_set_sampler_wrap method
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/mesa/main/samplerobj.c16
-rw-r--r--src/mesa/main/samplerobj.h4
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 676dd367b3f..17b34005263 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -444,6 +444,22 @@ flush(struct gl_context *ctx)
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
}
+void
+_mesa_set_sampler_wrap(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLenum s, GLenum t, GLenum r)
+{
+ assert(validate_texture_wrap_mode(ctx, s));
+ assert(validate_texture_wrap_mode(ctx, t));
+ assert(validate_texture_wrap_mode(ctx, r));
+
+ if (samp->WrapS == s && samp->WrapT == t && samp->WrapR == r)
+ return;
+
+ flush(ctx);
+ samp->WrapS = s;
+ samp->WrapT = t;
+ samp->WrapR = r;
+}
#define INVALID_PARAM 0x100
#define INVALID_PNAME 0x101
diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
index 7bea9111480..1817c1a4468 100644
--- a/src/mesa/main/samplerobj.h
+++ b/src/mesa/main/samplerobj.h
@@ -80,6 +80,10 @@ _mesa_new_sampler_object(struct gl_context *ctx, GLuint name);
extern void
_mesa_init_sampler_object_functions(struct dd_function_table *driver);
+extern void
+_mesa_set_sampler_wrap(struct gl_context *ctx, struct gl_sampler_object *samp,
+ GLenum s, GLenum t, GLenum r);
+
void GLAPIENTRY
_mesa_GenSamplers(GLsizei count, GLuint *samplers);
void GLAPIENTRY