summaryrefslogtreecommitdiff
path: root/src/compiler/nir_types.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-10-05 11:58:59 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-10-06 02:13:36 -0700
commitf7659e02c320fa9aac82e094e01786d2a5eb91e3 (patch)
tree2314a4e4023bf8efcb612c5017a0806ff9e88787 /src/compiler/nir_types.cpp
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 <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Diffstat (limited to 'src/compiler/nir_types.cpp')
-rw-r--r--src/compiler/nir_types.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index f694a84e72c..d1458134c0a 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -28,32 +28,10 @@
#include "nir_types.h"
#include "compiler/glsl/ir.h"
-void
-glsl_print_type(const glsl_type *type, FILE *fp)
-{
- if (type->base_type == GLSL_TYPE_ARRAY) {
- glsl_print_type(type->fields.array, fp);
- fprintf(fp, "[%u]", type->length);
- } else if ((type->base_type == GLSL_TYPE_STRUCT)
- && !is_gl_identifier(type->name)) {
- fprintf(fp, "%s@%p", type->name, (void *) type);
- } else {
- fprintf(fp, "%s", type->name);
- }
-}
-
-void
-glsl_print_struct(const glsl_type *type, FILE *fp)
-{
- assert(type->base_type == GLSL_TYPE_STRUCT);
-
- fprintf(fp, "struct {\n");
- for (unsigned i = 0; i < type->length; i++) {
- fprintf(fp, "\t");
- glsl_print_type(type->fields.structure[i].type, fp);
- fprintf(fp, " %s;\n", type->fields.structure[i].name);
- }
- fprintf(fp, "}\n");
+const char *
+glsl_get_type_name(const glsl_type *type)
+{
+ return type->name;
}
const glsl_type *