diff options
author | ethannicholas <ethannicholas@google.com> | 2016-11-15 12:53:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-15 12:53:06 -0800 |
commit | fa5f65ac61fd525029aa9dab161ffe4896c10f6d (patch) | |
tree | 759d6a3b9602b86deec1028e081c0ceaf1004751 /src/sksl/ir/SkSLLayout.h | |
parent | 3667b4970d6972675be58a331be7c5ba02f3d39e (diff) |
added support for push_constant layout
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187433003
Review-Url: https://codereview.chromium.org/2187433003
Diffstat (limited to 'src/sksl/ir/SkSLLayout.h')
-rw-r--r-- | src/sksl/ir/SkSLLayout.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/sksl/ir/SkSLLayout.h b/src/sksl/ir/SkSLLayout.h index 24087d0612..dfa396758b 100644 --- a/src/sksl/ir/SkSLLayout.h +++ b/src/sksl/ir/SkSLLayout.h @@ -24,10 +24,11 @@ struct Layout { , fBuiltin(layout.fBuiltin) , fOriginUpperLeft(layout.fOriginUpperLeft) , fOverrideCoverage(layout.fOverrideCoverage) - , fBlendSupportAllEquations(layout.fBlendSupportAllEquations) {} + , fBlendSupportAllEquations(layout.fBlendSupportAllEquations) + , fPushConstant(layout.fPushConstant) {} Layout(int location, int binding, int index, int set, int builtin, bool originUpperLeft, - bool overrideCoverage, bool blendSupportAllEquations) + bool overrideCoverage, bool blendSupportAllEquations, bool pushconstant) : fLocation(location) , fBinding(binding) , fIndex(index) @@ -35,7 +36,19 @@ struct Layout { , fBuiltin(builtin) , fOriginUpperLeft(originUpperLeft) , fOverrideCoverage(overrideCoverage) - , fBlendSupportAllEquations(blendSupportAllEquations) {} + , fBlendSupportAllEquations(blendSupportAllEquations) + , fPushConstant(pushconstant) {} + + Layout() + : fLocation(-1) + , fBinding(-1) + , fIndex(-1) + , fSet(-1) + , fBuiltin(-1) + , fOriginUpperLeft(false) + , fOverrideCoverage(false) + , fBlendSupportAllEquations(false) + , fPushConstant(false) {} std::string description() const { std::string result; @@ -72,6 +85,10 @@ struct Layout { result += separator + "blend_support_all_equations"; separator = ", "; } + if (fPushConstant) { + result += separator + "push_constant"; + separator = ", "; + } if (result.length() > 0) { result = "layout (" + result + ")"; } @@ -93,16 +110,16 @@ struct Layout { return !(*this == other); } - // 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; + int fOffset; bool fOriginUpperLeft; bool fOverrideCoverage; bool fBlendSupportAllEquations; + bool fPushConstant; }; } // namespace |