summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-10-05 11:58:59 -0700
committerKenneth Graunke <[email protected]>2016-10-06 02:13:36 -0700
commitf7659e02c320fa9aac82e094e01786d2a5eb91e3 (patch)
tree2314a4e4023bf8efcb612c5017a0806ff9e88787 /src/compiler/nir
parent0408d50f43d8520d9feb3faef6e6f31871d18a74 (diff)
nir: Delete open coded type printing.
glsl_print_type() prints arrays of arrays incorrectly. For example, a type with name float[3][7] would be printed as float[7][3]. (This is an array of length 3 containing arrays of 7 floats.) cdecl says that the type name is correct. glsl_print_type() doesn't really do anything above and beyond printing type->name, and glsl_print_struct() wasn't used at all. So, drop them. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_print.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 9fa024ea783..35f64684d29 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -391,9 +391,8 @@ print_var_decl(nir_variable *var, print_state *state)
const char *const wonly = (var->data.image.write_only) ? "writeonly " : "";
fprintf(fp, "%s%s%s%s%s", coher, volat, restr, ronly, wonly);
- glsl_print_type(var->type, fp);
-
- fprintf(fp, " %s", get_var_name(var, state));
+ fprintf(fp, "%s %s", glsl_get_type_name(var->type),
+ get_var_name(var, state));
if (var->data.mode == nir_var_shader_in ||
var->data.mode == nir_var_shader_out ||
@@ -457,8 +456,8 @@ static void
print_arg(nir_variable *var, print_state *state)
{
FILE *fp = state->fp;
- glsl_print_type(var->type, fp);
- fprintf(fp, " %s", get_var_name(var, state));
+ fprintf(fp, "%s %s", glsl_get_type_name(var->type),
+ get_var_name(var, state));
}
static void
@@ -1097,14 +1096,13 @@ print_function(nir_function *function, print_state *state)
unreachable("Invalid parameter type");
}
- glsl_print_type(function->params[i].type, fp);
+ fprintf(fp, "%s", glsl_get_type_name(function->params[i].type));
}
if (function->return_type != NULL) {
if (function->num_params != 0)
fprintf(fp, ", ");
- fprintf(fp, "returning ");
- glsl_print_type(function->return_type, fp);
+ fprintf(fp, "returning %s", glsl_get_type_name(function->return_type));
}
fprintf(fp, "\n");