aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLParser.cpp
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-11-15 12:53:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-11-15 12:53:06 -0800
commitfa5f65ac61fd525029aa9dab161ffe4896c10f6d (patch)
tree759d6a3b9602b86deec1028e081c0ceaf1004751 /src/sksl/SkSLParser.cpp
parent3667b4970d6972675be58a331be7c5ba02f3d39e (diff)
added support for push_constant layout
Diffstat (limited to 'src/sksl/SkSLParser.cpp')
-rw-r--r--src/sksl/SkSLParser.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp
index 324bd41c86..154989fe84 100644
--- a/src/sksl/SkSLParser.cpp
+++ b/src/sksl/SkSLParser.cpp
@@ -526,8 +526,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;
@@ -537,11 +536,12 @@ ASTLayout Parser::layout() {
bool originUpperLeft = false;
bool overrideCoverage = false;
bool blendSupportAllEquations = false;
+ bool pushConstant = false;
if (this->peek().fKind == Token::LAYOUT) {
this->nextToken();
if (!this->expect(Token::LPAREN, "'('")) {
return ASTLayout(location, binding, index, set, builtin, originUpperLeft,
- overrideCoverage, blendSupportAllEquations);
+ overrideCoverage, blendSupportAllEquations, pushConstant);
}
for (;;) {
Token t = this->nextToken();
@@ -561,6 +561,8 @@ ASTLayout Parser::layout() {
overrideCoverage = true;
} else if (t.fText == "blend_support_all_equations") {
blendSupportAllEquations = true;
+ } else if (t.fText == "push_constant") {
+ pushConstant = true;
} else {
this->error(t.fPosition, ("'" + t.fText +
"' is not a valid layout qualifier").c_str());
@@ -575,7 +577,7 @@ ASTLayout Parser::layout() {
}
}
return ASTLayout(location, binding, index, set, builtin, originUpperLeft, overrideCoverage,
- blendSupportAllEquations);
+ blendSupportAllEquations, pushConstant);
}
/* layout? (UNIFORM | CONST | IN | OUT | INOUT | LOWP | MEDIUMP | HIGHP | FLAT | NOPERSPECTIVE)* */