glsl: make use of glsl_type::is_record()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
Samuel Pitoiset
2017-04-21 10:32:39 +02:00
parent cd78ab55d0
commit 64db02b5fa
5 changed files with 6 additions and 8 deletions

View File

@@ -46,8 +46,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
YYLTYPE loc = expr->get_location();
if (op->type->is_error()) {
/* silently propagate the error */
} else if (op->type->base_type == GLSL_TYPE_STRUCT
|| op->type->is_interface()) {
} else if (op->type->is_record() || op->type->is_interface()) {
result = new(ctx) ir_dereference_record(op,
expr->primary_expression.identifier);

View File

@@ -1237,7 +1237,7 @@ ir_constant::has_value(const ir_constant *c) const
return true;
}
if (this->type->base_type == GLSL_TYPE_STRUCT) {
if (this->type->is_record()) {
const exec_node *a_node = this->components.get_head_raw();
const exec_node *b_node = c->components.get_head_raw();

View File

@@ -149,8 +149,7 @@ print_type(FILE *f, const glsl_type *t)
fprintf(f, "(array ");
print_type(f, t->fields.array);
fprintf(f, " %u)", t->length);
} else if ((t->base_type == GLSL_TYPE_STRUCT)
&& !is_gl_identifier(t->name)) {
} else if (t->is_record() && !is_gl_identifier(t->name)) {
fprintf(f, "%s@%p", t->name, (void *) t);
} else {
fprintf(f, "%s", t->name);