aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLLayout.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2016-11-28 16:30:17 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-28 22:38:47 +0000
commit19671772c1a03bd973fae54dead4defc9ee1d4c3 (patch)
treeb84497e9cf024f7d5dcfec6235ce8838bb25e1d8 /src/sksl/ir/SkSLLayout.h
parent59f9edb321ea29f7349bd4f13f3473e54831598a (diff)
added support for layout(offset=...) to skslc
BUG=skia: Change-Id: Idc1118503f9703496a0c852f0d8840b26e08b9fb Reviewed-on: https://skia-review.googlesource.com/5283 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLLayout.h')
-rw-r--r--src/sksl/ir/SkSLLayout.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/sksl/ir/SkSLLayout.h b/src/sksl/ir/SkSLLayout.h
index b2c158eeef..75650e271d 100644
--- a/src/sksl/ir/SkSLLayout.h
+++ b/src/sksl/ir/SkSLLayout.h
@@ -77,10 +77,11 @@ struct Layout {
return false;
}
- Layout(int location, int binding, int index, int set, int builtin, int inputAttachmentIndex,
- bool originUpperLeft, bool overrideCoverage, bool blendSupportAllEquations,
- Format format, bool pushconstant)
+ Layout(int location, int offset, int binding, int index, int set, int builtin,
+ int inputAttachmentIndex, bool originUpperLeft, bool overrideCoverage,
+ bool blendSupportAllEquations, Format format, bool pushconstant)
: fLocation(location)
+ , fOffset(offset)
, fBinding(binding)
, fIndex(index)
, fSet(set)
@@ -94,6 +95,7 @@ struct Layout {
Layout()
: fLocation(-1)
+ , fOffset(-1)
, fBinding(-1)
, fIndex(-1)
, fSet(-1)
@@ -112,6 +114,10 @@ struct Layout {
result += separator + "location = " + to_string(fLocation);
separator = ", ";
}
+ if (fOffset >= 0) {
+ result += separator + "offset = " + to_string(fOffset);
+ separator = ", ";
+ }
if (fBinding >= 0) {
result += separator + "binding = " + to_string(fBinding);
separator = ", ";
@@ -160,6 +166,7 @@ struct Layout {
bool operator==(const Layout& other) const {
return fLocation == other.fLocation &&
+ fOffset == other.fOffset &&
fBinding == other.fBinding &&
fIndex == other.fIndex &&
fSet == other.fSet &&
@@ -176,6 +183,7 @@ struct Layout {
}
int fLocation;
+ int fOffset;
int fBinding;
int fIndex;
int fSet;