diff options
author | Ian Romanick <[email protected]> | 2015-11-09 11:55:59 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-01-11 15:38:03 -0800 |
commit | 08822b4b43e3bc51bbcc42ab01ba1095b30a9298 (patch) | |
tree | bdb9044eb11f202d07610c5a0453a0fba77137a1 /src/mesa/main/samplerobj.c | |
parent | 3029d60de7244ed8c460ad8ee2408d27ed494a6b (diff) |
mesa: Add _mesa_set_sampler_wrap method
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main/samplerobj.c')
-rw-r--r-- | src/mesa/main/samplerobj.c | 16 |
1 files changed, 16 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 |