]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.cpp
Support specialization constants in the GLSL compiler
[libs/gl.git] / source / glsl / parser.cpp
index b493c677d3d4007a4c9d8c285ba6d8c4b99fc9f3..5ffc2a9b023f284b2837990e06f7a8533955d5fc 100644 (file)
@@ -327,7 +327,15 @@ RefPtr<Layout> Parser::parse_layout()
                qual.name = token;
 
                if((qual.has_value = check("=")))
-                       qual.value = expect_integer();
+               {
+                       if(qual.name=="constant_id" && tokenizer.peek_token()=="auto")
+                       {
+                               qual.value = -1;
+                               tokenizer.parse_token();
+                       }
+                       else
+                               qual.value = expect_integer();
+               }
 
                if(tokenizer.peek_token()==")")
                        break;