summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_array_index.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-10-15 14:32:41 +1100
committerTimothy Arceri <[email protected]>2015-10-15 20:35:45 +1100
commit3129359ed7461b90fe6ea70641ec7a858dd656de (patch)
treeaee6cb5dcc219bd053324c205f156b7667ad9fae /src/glsl/ast_array_index.cpp
parent296a7ea471fd327ab60d9723bd395e6b34dc9334 (diff)
glsl: allow AoA to be sized by initializer or constructor
V2: Split out unsized array validation to its own patch as suggested by Samuel. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/glsl/ast_array_index.cpp')
-rw-r--r--src/glsl/ast_array_index.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index 5e8f49d70b0..7855e0a6190 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -28,13 +28,10 @@
void
ast_array_specifier::print(void) const
{
- if (this->is_unsized_array) {
- printf("[ ] ");
- }
-
foreach_list_typed (ast_node, array_dimension, link, &this->array_dimensions) {
printf("[ ");
- array_dimension->print();
+ if (((ast_expression*)array_dimension)->oper != ast_unsized_array_dim)
+ array_dimension->print();
printf("] ");
}
}