Module: Mesa Branch: main Commit: a9a2eabea88d6946fbe75b8493a00e95ef39e4b5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9a2eabea88d6946fbe75b8493a00e95ef39e4b5
Author: Yonggang Luo <[email protected]> Date: Wed Oct 25 15:17:42 2023 +0800 glsl: move glsl_get_gl_type into glsl/linker_util.h glsl_get_gl_type only accessed in src/compiler/glsl files, do not expose it in libcompiler Signed-off-by: Yonggang Luo <[email protected]> Reviewed-by: Caio Oliveira <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25879> --- src/compiler/glsl/gl_nir_link_uniforms.c | 1 - src/compiler/glsl/gl_nir_link_varyings.c | 1 - src/compiler/glsl/gl_nir_link_xfb.c | 1 - .../glsl/gl_nir_opt_dead_builtin_varyings.c | 1 - src/compiler/glsl/linker_util.h | 7 ++++ src/compiler/nir_gl_types.h | 43 ---------------------- 6 files changed, 7 insertions(+), 47 deletions(-) diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index 674b63de1ca..bdd86180c1f 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -22,7 +22,6 @@ */ #include "nir.h" -#include "nir_gl_types.h" #include "nir_deref.h" #include "gl_nir_linker.h" #include "compiler/glsl/ir_uniform.h" /* for gl_uniform_storage */ diff --git a/src/compiler/glsl/gl_nir_link_varyings.c b/src/compiler/glsl/gl_nir_link_varyings.c index 629cd8b8db4..83ad722e041 100644 --- a/src/compiler/glsl/gl_nir_link_varyings.c +++ b/src/compiler/glsl/gl_nir_link_varyings.c @@ -43,7 +43,6 @@ #include "gl_nir_link_varyings.h" #include "gl_nir_linker.h" #include "linker_util.h" -#include "nir_gl_types.h" #include "string_to_uint_map.h" #define SAFE_MASK_FROM_INDEX(i) (((i) >= 32) ? ~0 : ((1 << (i)) - 1)) diff --git a/src/compiler/glsl/gl_nir_link_xfb.c b/src/compiler/glsl/gl_nir_link_xfb.c index 3492ccdc5a9..a6bb161f2e1 100644 --- a/src/compiler/glsl/gl_nir_link_xfb.c +++ b/src/compiler/glsl/gl_nir_link_xfb.c @@ -22,7 +22,6 @@ */ #include "nir.h" -#include "nir_gl_types.h" #include "nir_xfb_info.h" #include "gl_nir_linker.h" #include "linker_util.h" diff --git a/src/compiler/glsl/gl_nir_opt_dead_builtin_varyings.c b/src/compiler/glsl/gl_nir_opt_dead_builtin_varyings.c index 02068d92f0b..9b3e30d754b 100644 --- a/src/compiler/glsl/gl_nir_opt_dead_builtin_varyings.c +++ b/src/compiler/glsl/gl_nir_opt_dead_builtin_varyings.c @@ -47,7 +47,6 @@ #include "gl_nir_linker.h" #include "linker_util.h" #include "nir_builder.h" -#include "nir_gl_types.h" #include "nir_types.h" #include "compiler/glsl_types.h" diff --git a/src/compiler/glsl/linker_util.h b/src/compiler/glsl/linker_util.h index 1bd9b61eac7..5563a08c24e 100644 --- a/src/compiler/glsl/linker_util.h +++ b/src/compiler/glsl/linker_util.h @@ -27,6 +27,7 @@ #include "util/bitset.h" #include "util/glheader.h" #include "compiler/glsl/list.h" +#include "compiler/glsl_types.h" struct gl_constants; struct gl_shader_program; @@ -41,6 +42,12 @@ is_gl_identifier(const char *s) return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_'; } +static inline GLenum +glsl_get_gl_type(const struct glsl_type *t) +{ + return t->gl_type; +} + #ifdef __cplusplus extern "C" { #endif diff --git a/src/compiler/nir_gl_types.h b/src/compiler/nir_gl_types.h deleted file mode 100644 index 5c77e43a1d7..00000000000 --- a/src/compiler/nir_gl_types.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright © 2017 Igalia - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Neil Roberts. - * - */ - -#ifndef NIR_GL_TYPES_H -#define NIR_GL_TYPES_H - -#include "util/glheader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -static inline GLenum glsl_get_gl_type(const struct glsl_type *t) { return t->gl_type; } - -#ifdef __cplusplus -} -#endif - -#endif
