diff options
author | ethannicholas <ethannicholas@google.com> | 2016-08-03 12:43:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-03 12:43:36 -0700 |
commit | f789b3893579b773bb4d7be6c2c65311500b53bb (patch) | |
tree | ffb4c1c5775ba6379a9e504534171a67fa1803c5 /src/sksl/ir/SkSLLayout.h | |
parent | e57b8c9a790253df1e2f0663bf63f8d6e04227d1 (diff) |
added initial GLSL support to skslc
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185393003
Review-Url: https://codereview.chromium.org/2185393003
Diffstat (limited to 'src/sksl/ir/SkSLLayout.h')
-rw-r--r-- | src/sksl/ir/SkSLLayout.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/sksl/ir/SkSLLayout.h b/src/sksl/ir/SkSLLayout.h index bab2f0e0db..d8dc98096f 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 |