aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-07-04 19:12:13 -0400
committerMarek Olšák <[email protected]>2020-07-07 22:02:06 -0400
commita038863ba07a2e81df6e60ecc500b65ec4a47cb2 (patch)
tree079d727c05f913a0b4da1fcab5ee5df222bd25e2 /src/compiler
parent1d5e1882f662fb4a922353ea272c1e94398f9155 (diff)
glsl: make print_type non-static for debugging
Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ir.h3
-rw-r--r--src/compiler/glsl/ir_print_visitor.cpp20
2 files changed, 12 insertions, 11 deletions
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 90bcc72bcf2..ca91150b576 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -2536,6 +2536,9 @@ extern void _mesa_print_ir(FILE *f, struct exec_list *instructions,
struct _mesa_glsl_parse_state *state);
extern void
+ir_print_type(FILE *f, const struct glsl_type *t);
+
+extern void
fprint_ir(FILE *f, const void *instruction);
extern const struct gl_builtin_uniform_desc *
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index dc057c5a263..57cb5076a4f 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -30,8 +30,6 @@
#include "util/u_string.h"
#include "util/half_float.h"
-static void print_type(FILE *f, const glsl_type *t);
-
void
ir_instruction::print(void) const
{
@@ -61,7 +59,7 @@ _mesa_print_ir(FILE *f, exec_list *instructions,
for (unsigned j = 0; j < s->length; j++) {
fprintf(f, "\t((");
- print_type(f, s->fields.structure[j].type);
+ ir_print_type(f, s->fields.structure[j].type);
fprintf(f, ")(%s))\n", s->fields.structure[j].name);
}
@@ -143,12 +141,12 @@ ir_print_visitor::unique_name(ir_variable *var)
return name;
}
-static void
-print_type(FILE *f, const glsl_type *t)
+extern "C" void
+ir_print_type(FILE *f, const glsl_type *t)
{
if (t->is_array()) {
fprintf(f, "(array ");
- print_type(f, t->fields.array);
+ ir_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);
@@ -225,7 +223,7 @@ void ir_print_visitor::visit(ir_variable *ir)
stream,
interp[ir->data.interpolation]);
- print_type(f, ir->type);
+ ir_print_type(f, ir->type);
fprintf(f, " %s)", unique_name(ir));
}
@@ -236,7 +234,7 @@ void ir_print_visitor::visit(ir_function_signature *ir)
fprintf(f, "(signature ");
indentation++;
- print_type(f, ir->return_type);
+ ir_print_type(f, ir->return_type);
fprintf(f, "\n");
indent();
@@ -290,7 +288,7 @@ void ir_print_visitor::visit(ir_expression *ir)
{
fprintf(f, "(expression ");
- print_type(f, ir->type);
+ ir_print_type(f, ir->type);
fprintf(f, " %s ", ir_expression_operation_strings[ir->operation]);
@@ -314,7 +312,7 @@ void ir_print_visitor::visit(ir_texture *ir)
return;
}
- print_type(f, ir->type);
+ ir_print_type(f, ir->type);
fprintf(f, " ");
ir->sampler->accept(this);
@@ -478,7 +476,7 @@ print_float_constant(FILE *f, float val)
void ir_print_visitor::visit(ir_constant *ir)
{
fprintf(f, "(constant ");
- print_type(f, ir->type);
+ ir_print_type(f, ir->type);
fprintf(f, " (");
if (ir->type->is_array()) {