diff options
author | Paul Berry <stereotype441@gmail.com> | 2011-09-10 07:48:46 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2011-09-14 10:58:56 -0700 |
commit | 00792e3586746c833ffc9bb65712e38038916e06 (patch) | |
tree | ee049da95a89bbb40da576a678f8dee83fe34783 /src/glsl/ir_clone.cpp | |
parent | 373234ce17555376c5cb57a2cdce3038df3f51cd (diff) |
glsl: Remove field array_lvalue from ir_variable.
The array_lvalue field was attempting to enforce the restriction that
whole arrays can't be used on the left-hand side of an assignment in
GLSL 1.10 or GLSL ES, and can't be used as out or inout parameters in
GLSL 1.10.
However, it was buggy (it didn't work properly for built-in arrays),
and it was clumsy (it unnecessarily kept track on a
variable-by-variable basis, and it didn't cover the GLSL ES case).
This patch removes the array_lvalue field completely in favor of
explicit checks in ast_parameter_declarator::hir() (this check is
added) and in do_assignment (this check was already present).
This causes a benign behavioral change: when the user attempts to pass
an array as an out or inout parameter of a function in GLSL 1.10, the
error is now flagged at the time the function definition is
encountered, rather than at the time of invocation. Previously we
allowed such functions to be defined, and only flagged the error if
they were invoked.
Fixes Piglit tests
spec/glsl-1.10/compiler/qualifiers/fn-{out,inout}-array-prohibited*
and
spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r-- | src/glsl/ir_clone.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp index f0757365dd..c1befa95ce 100644 --- a/src/glsl/ir_clone.cpp +++ b/src/glsl/ir_clone.cpp @@ -47,7 +47,6 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const var->centroid = this->centroid; var->invariant = this->invariant; var->interpolation = this->interpolation; - var->array_lvalue = this->array_lvalue; var->location = this->location; var->warn_extension = this->warn_extension; var->origin_upper_left = this->origin_upper_left; |