]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.cpp
Support layout qualifiers on GLSL interface blocks
[libs/gl.git] / source / glsl / parser.cpp
index 8f2160a626674675b1f63b76ce5dc992d92451ff..ac35216a4cdd164aeb80b1d1f597e4b1fb4803ec 100644 (file)
@@ -273,6 +273,12 @@ RefPtr<Statement> Parser::parse_global_declaration()
                        tokenizer.expect(";");
                        return iface_lo;
                }
+               else if(is_interface_qualifier(token) && tokenizer.peek_token(2)=="{")
+               {
+                       RefPtr<InterfaceBlock> iface = parse_interface_block();
+                       iface->layout = layout;
+                       return iface;
+               }
                else
                {
                        RefPtr<VariableDeclaration> var = parse_variable_declaration();
@@ -792,7 +798,7 @@ RefPtr<InterfaceBlock> Parser::parse_interface_block()
        if(!is_interface_qualifier(iface->interface))
                throw parse_error(tokenizer.get_location(), iface->interface, "an interface qualifier");
 
-       iface->name = expect_identifier();
+       iface->block_name = expect_identifier();
        iface->members = new Block;
        parse_block(*iface->members, true, &Parser::parse_variable_declaration_with_layout);
        if(!check(";"))