X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglsl%2Fhir_field_selection.cpp;h=0035a5f81fd972aec13c75aecdce70ca4f11054d;hb=f01f754ca13373d62f5f4ba5ff76d83aa4eac62b;hp=3c33127b5f88b004ec03996fc7faa50b78abc876;hpb=1218430e1200a08cd64b6555d3fd1fd0274ad9e5;p=mesa.git diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp index 3c33127b5f8..0035a5f81fd 100644 --- a/src/glsl/hir_field_selection.cpp +++ b/src/glsl/hir_field_selection.cpp @@ -61,7 +61,8 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, _mesa_glsl_error(& loc, state, "Invalid swizzle / mask `%s'", expr->primary_expression.identifier); } - } else if (op->type->base_type == GLSL_TYPE_STRUCT) { + } else if (op->type->base_type == GLSL_TYPE_STRUCT + || op->type->base_type == GLSL_TYPE_INTERFACE) { result = new(ctx) ir_dereference_record(op, expr->primary_expression.identifier); @@ -72,8 +73,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, } } else if (expr->subexpressions[1] != NULL) { /* Handle "method calls" in GLSL 1.20 - namely, array.length() */ - if (state->language_version < 120) - _mesa_glsl_error(&loc, state, "Methods not supported in GLSL 1.10."); + state->check_version(120, 300, &loc, "Methods not supported"); ast_expression *call = expr->subexpressions[1]; assert(call->oper == ast_function_call); @@ -98,5 +98,5 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, expr->primary_expression.identifier); } - return result ? result : ir_call::get_error_instruction(ctx); + return result ? result : ir_rvalue::error_value(ctx); }