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

Unified Diff: src/sksl/SkSLParser.cpp

Issue 2185393003: added initial GLSL support to skslc (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixed gn build Created 4 years, 4 months 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/SkSLIRGenerator.cpp ('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 edff0c67d15516a9f4b4f8def23c9bdced04ea36..d6acc7d8a877c8e0998985c7338410da0a2eadb1 100644
--- a/src/sksl/SkSLParser.cpp
+++ b/src/sksl/SkSLParser.cpp
@@ -14,11 +14,26 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
#pragma clang diagnostic ignored "-Wnull-conversion"
+#pragma clang diagnostic ignored "-Wsign-compare"
+#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4018)
#endif
#include "lex.sksl.c"
#ifdef __clang__
#pragma clang diagnostic pop
#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
#undef register
#include "ast/SkSLASTBinaryExpression.h"
@@ -471,10 +486,11 @@ ASTLayout Parser::layout() {
int index = -1;
int set = -1;
int builtin = -1;
+ bool originUpperLeft = false;
if (this->peek().fKind == Token::LAYOUT) {
this->nextToken();
if (!this->expect(Token::LPAREN, "'('")) {
- return ASTLayout(location, binding, index, set, builtin);
+ return ASTLayout(location, binding, index, set, builtin, originUpperLeft);
}
for (;;) {
Token t = this->nextToken();
@@ -488,6 +504,8 @@ ASTLayout Parser::layout() {
set = this->layoutInt();
} else if (t.fText == "builtin") {
builtin = this->layoutInt();
+ } else if (t.fText == "origin_upper_left") {
+ originUpperLeft = true;
} else {
this->error(t.fPosition, ("'" + t.fText +
"' is not a valid layout qualifier").c_str());
@@ -501,11 +519,10 @@ ASTLayout Parser::layout() {
}
}
}
- return ASTLayout(location, binding, index, set, builtin);
+ return ASTLayout(location, binding, index, set, builtin, originUpperLeft);
}
-/* layout? (UNIFORM | CONST | IN | OUT | INOUT | LOWP |
- MEDIUMP | HIGHP)* */
+/* layout? (UNIFORM | CONST | IN | OUT | INOUT | LOWP | MEDIUMP | HIGHP | FLAT | NOPERSPECTIVE)* */
ASTModifiers Parser::modifiers() {
ASTLayout layout = this->layout();
int flags = 0;
@@ -545,6 +562,14 @@ ASTModifiers Parser::modifiers() {
this->nextToken();
flags |= ASTModifiers::kHighp_Flag;
break;
+ case Token::FLAT:
+ this->nextToken();
+ flags |= ASTModifiers::kFlat_Flag;
+ break;
+ case Token::NOPERSPECTIVE:
+ this->nextToken();
+ flags |= ASTModifiers::kNoPerspective_Flag;
+ break;
default:
return ASTModifiers(layout, flags);
}
« no previous file with comments | « src/sksl/SkSLIRGenerator.cpp ('k') | src/sksl/SkSLSPIRVCodeGenerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698