aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLLayout.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-11-15 19:09:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-16 00:48:35 +0000
commitbd85a105ba7b3ee2008d20fb9281bfb47325ad0e (patch)
tree6a19f708a7a164dd9662aad528490d23d62def3b /src/sksl/ir/SkSLLayout.h
parentdabc91bc0f42a9484b6025ddc68fa958455fb53c (diff)
Add support for image load to SkSL
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4865 Change-Id: I4647e6b255946ced2b1b8cb05e62f0f5a8ad28b6 Reviewed-on: https://skia-review.googlesource.com/4865 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLLayout.h')
-rw-r--r--src/sksl/ir/SkSLLayout.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/sksl/ir/SkSLLayout.h b/src/sksl/ir/SkSLLayout.h
index dfa396758b..ef2f8c22b2 100644
--- a/src/sksl/ir/SkSLLayout.h
+++ b/src/sksl/ir/SkSLLayout.h
@@ -25,10 +25,12 @@ struct Layout {
, fOriginUpperLeft(layout.fOriginUpperLeft)
, fOverrideCoverage(layout.fOverrideCoverage)
, fBlendSupportAllEquations(layout.fBlendSupportAllEquations)
- , fPushConstant(layout.fPushConstant) {}
+ , fPushConstant(layout.fPushConstant)
+ , fFormat(layout.fFormat) {}
Layout(int location, int binding, int index, int set, int builtin, bool originUpperLeft,
- bool overrideCoverage, bool blendSupportAllEquations, bool pushconstant)
+ bool overrideCoverage, bool blendSupportAllEquations, bool pushconstant,
+ ASTLayout::Format format)
: fLocation(location)
, fBinding(binding)
, fIndex(index)
@@ -37,7 +39,8 @@ struct Layout {
, fOriginUpperLeft(originUpperLeft)
, fOverrideCoverage(overrideCoverage)
, fBlendSupportAllEquations(blendSupportAllEquations)
- , fPushConstant(pushconstant) {}
+ , fPushConstant(pushconstant)
+ , fFormat(format) {}
Layout()
: fLocation(-1)
@@ -48,7 +51,8 @@ struct Layout {
, fOriginUpperLeft(false)
, fOverrideCoverage(false)
, fBlendSupportAllEquations(false)
- , fPushConstant(false) {}
+ , fPushConstant(false)
+ , fFormat(ASTLayout::Format::kUnspecified) {}
std::string description() const {
std::string result;
@@ -89,6 +93,10 @@ struct Layout {
result += separator + "push_constant";
separator = ", ";
}
+ if (ASTLayout::Format::kUnspecified != fFormat) {
+ result += separator + ASTLayout::FormatToStr(fFormat);
+ separator = ", ";
+ }
if (result.length() > 0) {
result = "layout (" + result + ")";
}
@@ -103,7 +111,8 @@ struct Layout {
fBuiltin == other.fBuiltin &&
fOriginUpperLeft == other.fOriginUpperLeft &&
fOverrideCoverage == other.fOverrideCoverage &&
- fBlendSupportAllEquations == other.fBlendSupportAllEquations;
+ fBlendSupportAllEquations == other.fBlendSupportAllEquations &&
+ fFormat == other.fFormat;
}
bool operator!=(const Layout& other) const {
@@ -120,6 +129,7 @@ struct Layout {
bool fOverrideCoverage;
bool fBlendSupportAllEquations;
bool fPushConstant;
+ ASTLayout::Format fFormat;
};
} // namespace