summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-02 17:17:47 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-02 17:17:47 -0700
commit9d975377ca6dae7805804c0fbe625bb7c5f9e095 (patch)
treead2a5b01dcf2f29d9a53ec01787356f511afaa86 /ir.cpp
parent2d946634eb3761dbec5aa8806fc36ff6d65b4f9c (diff)
Track whether whole-arrays are assignable
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is. This causes the following tests to pass: glslparsertest/glsl2/array-09.vert glslparsertest/glsl2/array-13.vert
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/ir.cpp b/ir.cpp
index ef93c40619..c900a285bc 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -200,18 +200,14 @@ ir_dereference::is_lvalue()
if (var == NULL)
return false;
- /* Arrays are not assignable in GLSL 1.10, but in GLSL 1.20 and later they
- * are.
- */
- /* FINISHME: Handle GLSL 1.10 vs 1.20 differences. */
- if (this->type->base_type == GLSL_TYPE_ARRAY)
- return false;
-
if (mode == ir_reference_variable) {
ir_variable *const as_var = var->as_variable();
if (as_var == NULL)
return false;
+ if (as_var->type->is_array() && !as_var->array_lvalue)
+ return false;
+
return !as_var->read_only;
} else if (mode == ir_reference_array) {
/* FINISHME: Walk up the dereference chain and figure out if