From 08822b4b43e3bc51bbcc42ab01ba1095b30a9298 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 9 Nov 2015 11:55:59 -0800 Subject: [PATCH] mesa: Add _mesa_set_sampler_wrap method Signed-off-by: Ian Romanick Reviewed-by: Jason Ekstrand --- src/mesa/main/samplerobj.c | 16 ++++++++++++++++ src/mesa/main/samplerobj.h | 4 ++++ 2 files changed, 20 insertions(+) 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 -- 2.30.2