X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglsl%2Fhir_field_selection.cpp;h=0035a5f81fd972aec13c75aecdce70ca4f11054d;hb=f01f754ca13373d62f5f4ba5ff76d83aa4eac62b;hp=db1e06932f4596f15bc0e1e2a37164ce562d8116;hpb=094cf8c199930d958d9e1139467eb8579d082df6;p=mesa.git diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp index db1e06932f4..0035a5f81fd 100644 --- a/src/glsl/hir_field_selection.cpp +++ b/src/glsl/hir_field_selection.cpp @@ -22,13 +22,12 @@ */ #include "ir.h" -#include "main/imports.h" -#include "symbol_table.h" +#include "program/symbol_table.h" #include "glsl_parser_extras.h" #include "ast.h" #include "glsl_types.h" -struct ir_rvalue * +ir_rvalue * _mesa_ast_field_selection_to_hir(const ast_expression *expr, exec_list *instructions, struct _mesa_glsl_parse_state *state) @@ -62,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); @@ -73,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); @@ -99,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); }