mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
compiler/glsl: Move glsl_print_type from glsl_types.* to ir_print_visitor.cpp
glsl_print_type only referenced in ir_print_visitor.cpp there is no need expose it Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>
This commit is contained in:
parent
01ddb18427
commit
26c5200acf
3 changed files with 14 additions and 23 deletions
|
|
@ -45,6 +45,20 @@ ir_instruction::fprint(FILE *f) const
|
|||
deconsted->accept(&v);
|
||||
}
|
||||
|
||||
static void
|
||||
glsl_print_type(FILE *f, const glsl_type *t)
|
||||
{
|
||||
if (t->is_array()) {
|
||||
fprintf(f, "(array ");
|
||||
glsl_print_type(f, t->fields.array);
|
||||
fprintf(f, " %u)", t->length);
|
||||
} else if (t->is_struct() && !is_gl_identifier(t->name)) {
|
||||
fprintf(f, "%s@%p", t->name, (void *) t);
|
||||
} else {
|
||||
fprintf(f, "%s", t->name);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
void
|
||||
_mesa_print_ir(FILE *f, exec_list *instructions,
|
||||
|
|
|
|||
|
|
@ -3382,24 +3382,4 @@ 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)
|
||||
{
|
||||
if (t->is_array()) {
|
||||
fprintf(f, "(array ");
|
||||
glsl_print_type(f, t->fields.array);
|
||||
fprintf(f, " %u)", t->length);
|
||||
} else if (t->is_struct() && !is_gl_identifier(t->name)) {
|
||||
fprintf(f, "%s@%p", t->name, (void *) t);
|
||||
} else {
|
||||
fprintf(f, "%s", t->name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,9 +54,6 @@ glsl_type_singleton_decref();
|
|||
extern void
|
||||
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state);
|
||||
|
||||
void
|
||||
glsl_print_type(FILE *f, const struct glsl_type *t);
|
||||
|
||||
void encode_type_to_blob(struct blob *blob, const struct glsl_type *type);
|
||||
|
||||
const struct glsl_type *decode_type_from_blob(struct blob_reader *blob);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue