diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2015-11-14 07:56:10 -0800 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2015-11-14 07:56:10 -0800 |
commit | 1469ccb7464836c752fa2664c36d8fae7e80606c (patch) | |
tree | 6f15e2eeb7e16e4085a0c58d50a36a4c12b231a5 /src/glsl/ast_function.cpp | |
parent | e8f51fe4deb5082fece5f8cb167b89b0f03eb244 (diff) | |
parent | f94e1d97381ec787c2abbbcd5265252596217e33 (diff) | |
download | external_mesa3d-1469ccb7464836c752fa2664c36d8fae7e80606c.zip external_mesa3d-1469ccb7464836c752fa2664c36d8fae7e80606c.tar.gz external_mesa3d-1469ccb7464836c752fa2664c36d8fae7e80606c.tar.bz2 |
Merge remote-tracking branch 'mesa-public/master' into vulkan
This pulls in Matt's big compiler refactor.
Diffstat (limited to 'src/glsl/ast_function.cpp')
-rw-r--r-- | src/glsl/ast_function.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index e4e4a3f..466ece6 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -256,18 +256,10 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, actual->variable_referenced()->name); return false; } else if (!actual->is_lvalue()) { - /* Even though ir_binop_vector_extract is not an l-value, let it - * slop through. generate_call will handle it correctly. - */ - ir_expression *const expr = ((ir_rvalue *) actual)->as_expression(); - if (expr == NULL - || expr->operation != ir_binop_vector_extract - || !expr->operands[0]->is_lvalue()) { - _mesa_glsl_error(&loc, state, - "function parameter '%s %s' is not an lvalue", - mode, formal->name); - return false; - } + _mesa_glsl_error(&loc, state, + "function parameter '%s %s' is not an lvalue", + mode, formal->name); + return false; } } @@ -376,12 +368,8 @@ fix_parameter(void *mem_ctx, ir_rvalue *actual, const glsl_type *formal_type, ir_rvalue *lhs = actual; if (expr != NULL && expr->operation == ir_binop_vector_extract) { - rhs = new(mem_ctx) ir_expression(ir_triop_vector_insert, - expr->operands[0]->type, - expr->operands[0]->clone(mem_ctx, NULL), - rhs, - expr->operands[1]->clone(mem_ctx, NULL)); - lhs = expr->operands[0]->clone(mem_ctx, NULL); + lhs = new(mem_ctx) ir_dereference_array(expr->operands[0]->clone(mem_ctx, NULL), + expr->operands[1]->clone(mem_ctx, NULL)); } ir_assignment *const assignment_2 = new(mem_ctx) ir_assignment(lhs, rhs); |