Revert "compiler: Combine duplicated implementation of is_gl_identifier into glsl_types.h"

This reverts commit f9860a84b3.  It's a
bit annoying having this scattered around but it's 100% a GLSL thing and
there's no reason why it should go in glsl_types.h.  The fact that
glsl_print_type() even uses it is a bit sketchy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24491>
This commit is contained in:
Faith Ekstrand
2023-08-04 06:28:19 -05:00
committed by Marge Bot
parent b89a48e00d
commit bf6d6a0934
7 changed files with 51 additions and 9 deletions

View File

@@ -47,6 +47,15 @@ struct uniform_array_info {
BITSET_WORD *indices;
};
/**
* Built-in / reserved GL variables names start with "gl_"
*/
static inline bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
static unsigned
uniform_storage_size(const struct glsl_type *type)
{

View File

@@ -1777,6 +1777,15 @@ varying_matches_compute_packing_order(const nir_variable *var)
}
}
/**
* Built-in / reserved GL variables names start with "gl_"
*/
static bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
/**
* Record the given producer/consumer variable pair in the list of variables
* that should later be assigned locations.

View File

@@ -299,6 +299,15 @@ disable_varying_optimizations_for_sso(struct gl_shader_program *prog)
}
}
/**
* Built-in / reserved GL variables names start with "gl_"
*/
static inline bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
static bool
inout_has_same_location(const nir_variable *var, unsigned stage)
{

View File

@@ -92,6 +92,15 @@ initialise_varying_info(struct varying_info *info, nir_variable_mode mode,
memset(info->backcolor, 0, sizeof(info->backcolor));
}
/**
* Built-in / reserved GL variables names start with "gl_"
*/
static bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
static void
gather_info_on_varying_deref(struct varying_info *info, nir_deref_instr *deref)
{

View File

@@ -2483,6 +2483,15 @@ prototype_string(const glsl_type *return_type, const char *name,
const char *
mode_string(const ir_variable *var);
/**
* Built-in / reserved GL variables names start with "gl_"
*/
static inline bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
extern "C" {
#endif /* __cplusplus */

View File

@@ -3353,6 +3353,12 @@ glsl_get_sampler_dim_coordinate_components(enum glsl_sampler_dim dim)
}
}
static inline bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
void
glsl_print_type(FILE *f, const glsl_type *t)
{

View File

@@ -289,15 +289,6 @@ enum {
GLSL_PRECISION_LOW
};
/**
* Built-in / reserved GL variables names start with "gl_"
*/
static inline bool
is_gl_identifier(const char *s)
{
return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
}
#ifdef __cplusplus
} /* extern "C" */
#endif