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

Unified Diff: src/sksl/ir/SkSLLayout.h

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/ir/SkSLIntLiteral.h ('k') | src/sksl/ir/SkSLModifiers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/ir/SkSLLayout.h
diff --git a/src/sksl/ir/SkSLLayout.h b/src/sksl/ir/SkSLLayout.h
index bab2f0e0dbd0457d16405572e5746045fd7ecdd3..d8dc98096fa776778db6ca59bcead192054156a5 100644
--- a/src/sksl/ir/SkSLLayout.h
+++ b/src/sksl/ir/SkSLLayout.h
@@ -21,14 +21,16 @@ struct Layout {
, fBinding(layout.fBinding)
, fIndex(layout.fIndex)
, fSet(layout.fSet)
- , fBuiltin(layout.fBuiltin) {}
+ , fBuiltin(layout.fBuiltin)
+ , fOriginUpperLeft(layout.fOriginUpperLeft) {}
- Layout(int location, int binding, int index, int set, int builtin)
+ Layout(int location, int binding, int index, int set, int builtin, bool originUpperLeft)
: fLocation(location)
, fBinding(binding)
, fIndex(index)
, fSet(set)
- , fBuiltin(builtin) {}
+ , fBuiltin(builtin)
+ , fOriginUpperLeft(originUpperLeft) {}
std::string description() const {
std::string result;
@@ -53,6 +55,10 @@ struct Layout {
result += separator + "builtin = " + to_string(fBuiltin);
separator = ", ";
}
+ if (fOriginUpperLeft) {
+ result += separator + "origin_upper_left";
+ separator = ", ";
+ }
if (result.length() > 0) {
result = "layout (" + result + ")";
}
@@ -71,11 +77,14 @@ struct Layout {
return !(*this == other);
}
- const int fLocation;
- const int fBinding;
- const int fIndex;
- const int fSet;
- const int fBuiltin;
+ // everything but builtin is in the GLSL spec; builtin comes from SPIR-V and identifies which
+ // particular builtin value this object represents.
+ int fLocation;
+ int fBinding;
+ int fIndex;
+ int fSet;
+ int fBuiltin;
+ bool fOriginUpperLeft;
};
} // namespace
« no previous file with comments | « src/sksl/ir/SkSLIntLiteral.h ('k') | src/sksl/ir/SkSLModifiers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698