From: Ian Romanick Date: Mon, 19 Apr 2010 22:41:23 +0000 (-0700) Subject: Convert structure field dereferences to HIR X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6efaeeea4489941f4916fda3041c2bf4e22b482e;p=mesa.git Convert structure field dereferences to HIR --- diff --git a/hir_field_selection.cpp b/hir_field_selection.cpp index 17c3f5c5ba3..685cf75dcf0 100644 --- a/hir_field_selection.cpp +++ b/hir_field_selection.cpp @@ -62,7 +62,13 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, expr->primary_expression.identifier); } } else if (op->type->base_type == GLSL_TYPE_STRUCT) { - /* FINISHME: Handle field selection from structures. */ + result = new ir_dereference(op, expr->primary_expression.identifier); + + if (result->type->is_error()) { + _mesa_glsl_error(& loc, state, "Cannot access field `%s' of " + "structure", + expr->primary_expression.identifier); + } } else { _mesa_glsl_error(& loc, state, "Cannot access field `%s' of " "non-structure / non-vector.",