Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: src/sksl/SkSLParser.cpp

Issue 2187433003: added support for push_constant layout (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/SkSLMemoryLayout.h ('k') | src/sksl/SkSLSPIRVCodeGenerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)* */
« no previous file with comments | « src/sksl/SkSLMemoryLayout.h ('k') | src/sksl/SkSLSPIRVCodeGenerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698