]> git.tdb.fi Git - libs/gl.git/commitdiff
Parse array sizes for interface blocks
authorMikko Rasa <tdb@tdb.fi>
Sat, 9 Apr 2022 16:24:53 +0000 (19:24 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 9 Apr 2022 16:24:53 +0000 (19:24 +0300)
This fixes the last failing test case.

source/glsl/parser.cpp

index 8c10c443002e130fa01f42b32ceb18cbe5f4d772..ca1f3156d1179b1bd1e9091bdf645e9184e10b67 100644 (file)
@@ -851,7 +851,11 @@ RefPtr<StructDeclaration> Parser::parse_interface_block()
                if(check("["))
                {
                        var->array = true;
-                       tokenizer.expect("]");
+                       if(!check("]"))
+                       {
+                               var->array_size = parse_expression();
+                               tokenizer.expect("]");
+                       }
                }
                tokenizer.expect(";");
        }