aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ast
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-11-15 12:53:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-11-15 12:53:06 -0800
commitfa5f65ac61fd525029aa9dab161ffe4896c10f6d (patch)
tree759d6a3b9602b86deec1028e081c0ceaf1004751 /src/sksl/ast
parent3667b4970d6972675be58a331be7c5ba02f3d39e (diff)
added support for push_constant layout
Diffstat (limited to 'src/sksl/ast')
-rw-r--r--src/sksl/ast/SkSLASTLayout.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sksl/ast/SkSLASTLayout.h b/src/sksl/ast/SkSLASTLayout.h
index 515eb2bdbb..2aec31e4df 100644
--- a/src/sksl/ast/SkSLASTLayout.h
+++ b/src/sksl/ast/SkSLASTLayout.h
@@ -19,9 +19,9 @@ namespace SkSL {
* layout (location = 0) int x;
*/
struct ASTLayout : public ASTNode {
- // For all parameters, a -1 means no value
+ // For int parameters, a -1 means no value
ASTLayout(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)
@@ -29,7 +29,8 @@ struct ASTLayout : public ASTNode {
, fBuiltin(builtin)
, fOriginUpperLeft(originUpperLeft)
, fOverrideCoverage(overrideCoverage)
- , fBlendSupportAllEquations(blendSupportAllEquations) {}
+ , fBlendSupportAllEquations(blendSupportAllEquations)
+ , fPushConstant(pushConstant) {}
std::string description() const {
std::string result;
@@ -66,6 +67,10 @@ struct ASTLayout : public ASTNode {
result += separator + "blend_support_all_equations";
separator = ", ";
}
+ if (fPushConstant) {
+ result += separator + "push_constant";
+ separator = ", ";
+ }
if (result.length() > 0) {
result = "layout (" + result + ")";
}
@@ -80,6 +85,7 @@ struct ASTLayout : public ASTNode {
const bool fOriginUpperLeft;
const bool fOverrideCoverage;
const bool fBlendSupportAllEquations;
+ const bool fPushConstant;
};
} // namespace