summaryrefslogtreecommitdiff
path: root/hir_field_selection.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-19 15:41:23 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-28 18:22:54 -0700
commit6efaeeea4489941f4916fda3041c2bf4e22b482e (patch)
treeee3145a07931306d36baeff9543893fe1bece2b3 /hir_field_selection.cpp
parent7ee79fb6b78012abd0ae8e874a7c64550b1cb707 (diff)
Convert structure field dereferences to HIR
Diffstat (limited to 'hir_field_selection.cpp')
-rw-r--r--hir_field_selection.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/hir_field_selection.cpp b/hir_field_selection.cpp
index 17c3f5c5ba..685cf75dcf 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.",