Mesa (main): mesa: move is_wrap_gl_clamp() to samplerobj.h and deduplicate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 15 19:22:51 UTC 2022


Module: Mesa
Branch: main
Commit: c17bfc5309c56ba94db4c7dcf4e51863ea130b7a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c17bfc5309c56ba94db4c7dcf4e51863ea130b7a

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jul 14 10:54:49 2022 -0400

mesa: move is_wrap_gl_clamp() to samplerobj.h and deduplicate

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>

---

 src/mesa/main/samplerobj.c              | 6 ------
 src/mesa/main/samplerobj.h              | 6 ++++++
 src/mesa/main/texparam.c                | 6 ------
 src/mesa/state_tracker/st_atom_shader.c | 7 -------
 4 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index bb86b0f4d67..d8a75de0e36 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -532,12 +532,6 @@ flush(struct gl_context *ctx)
 #define INVALID_PNAME 0x101
 #define INVALID_VALUE 0x102
 
-static inline GLboolean
-is_wrap_gl_clamp(GLint param)
-{
-   return param == GL_CLAMP || param == GL_MIRROR_CLAMP_EXT;
-}
-
 static GLuint
 set_sampler_wrap_s(struct gl_context *ctx, struct gl_sampler_object *samp,
                    GLint param)
diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
index 3e92b473f61..0e4b7e1d567 100644
--- a/src/mesa/main/samplerobj.h
+++ b/src/mesa/main/samplerobj.h
@@ -183,6 +183,12 @@ _mesa_lower_gl_clamp(struct gl_context *ctx, struct gl_sampler_object *samp)
    }
 }
 
+static inline GLboolean
+is_wrap_gl_clamp(GLint param)
+{
+   return param == GL_CLAMP || param == GL_MIRROR_CLAMP_EXT;
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index c2936cbbe08..feb68a70d2c 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -248,12 +248,6 @@ _mesa_target_allows_setting_sampler_parameters(GLenum target)
 }
 
 
-static inline GLboolean
-is_wrap_gl_clamp(GLint param)
-{
-   return param == GL_CLAMP || param == GL_MIRROR_CLAMP_EXT;
-}
-
 /**
  * Set an integer-valued texture parameter
  * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index da0473b9184..c60bd2ec289 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -72,13 +72,6 @@ get_texture_index(struct gl_context *ctx, const unsigned unit)
    return index;
 }
 
-
-static inline GLboolean
-is_wrap_gl_clamp(GLint param)
-{
-   return param == GL_CLAMP || param == GL_MIRROR_CLAMP_EXT;
-}
-
 static void
 update_gl_clamp(struct st_context *st, struct gl_program *prog, uint32_t *gl_clamp)
 {



More information about the mesa-commit mailing list