From f7659e02c320fa9aac82e094e01786d2a5eb91e3 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 5 Oct 2016 11:58:59 -0700 Subject: 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 Reviewed-by: Timothy Arceri --- src/compiler/nir/nir_print.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/compiler/nir') diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 9fa024e..35f6468 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"); -- cgit v1.1