| Index: src/sksl/SkSLParser.cpp
|
| diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp
|
| index 58ec750168c84299a58671868d556955e45b98e3..80ef870a48e9dbec4b3ed160db075d4da44768fd 100644
|
| --- a/src/sksl/SkSLParser.cpp
|
| +++ b/src/sksl/SkSLParser.cpp
|
| @@ -535,8 +535,7 @@ int Parser::layoutInt() {
|
| return -1;
|
| }
|
|
|
| -/* LAYOUT LPAREN IDENTIFIER EQ INT_LITERAL (COMMA IDENTIFIER EQ INT_LITERAL)*
|
| - RPAREN */
|
| +/* LAYOUT LPAREN IDENTIFIER (EQ INT_LITERAL)? (COMMA IDENTIFIER (EQ INT_LITERAL)?)* RPAREN */
|
| ASTLayout Parser::layout() {
|
| int location = -1;
|
| int binding = -1;
|
| @@ -548,11 +547,13 @@ ASTLayout Parser::layout() {
|
| bool overrideCoverage = false;
|
| bool blendSupportAllEquations = false;
|
| ASTLayout::Format format = ASTLayout::Format::kUnspecified;
|
| + bool pushConstant = false;
|
| if (this->peek().fKind == Token::LAYOUT) {
|
| this->nextToken();
|
| if (!this->expect(Token::LPAREN, "'('")) {
|
| return ASTLayout(location, binding, index, set, builtin, inputAttachmentIndex,
|
| - originUpperLeft, overrideCoverage, blendSupportAllEquations, format);
|
| + originUpperLeft, overrideCoverage, blendSupportAllEquations, format,
|
| + pushConstant);
|
| }
|
| for (;;) {
|
| Token t = this->nextToken();
|
| @@ -576,6 +577,8 @@ ASTLayout Parser::layout() {
|
| blendSupportAllEquations = true;
|
| } else if (ASTLayout::ReadFormat(t.fText, &format)) {
|
| // AST::ReadFormat stored the result in 'format'.
|
| + } else if (t.fText == "push_constant") {
|
| + pushConstant = true;
|
| } else {
|
| this->error(t.fPosition, ("'" + t.fText +
|
| "' is not a valid layout qualifier").c_str());
|
| @@ -590,7 +593,7 @@ ASTLayout Parser::layout() {
|
| }
|
| }
|
| return ASTLayout(location, binding, index, set, builtin, inputAttachmentIndex, originUpperLeft,
|
| - overrideCoverage, blendSupportAllEquations, format);
|
| + overrideCoverage, blendSupportAllEquations, format, pushConstant);
|
| }
|
|
|
| /* layout? (UNIFORM | CONST | IN | OUT | INOUT | LOWP | MEDIUMP | HIGHP | FLAT | NOPERSPECTIVE)* */
|
|
|