Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: src/sksl/ir/SkSLFieldAccess.h

Issue 2185393003: added initial GLSL support to skslc (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added initial GLSL support to skslc Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/sksl/ir/SkSLFieldAccess.h
diff --git a/src/sksl/ir/SkSLFieldAccess.h b/src/sksl/ir/SkSLFieldAccess.h
index f09c3a344709e3a4f2ceb922c2c531055c8e0d93..0ec1922685984c4ff64a439813071884f994fc36 100644
--- a/src/sksl/ir/SkSLFieldAccess.h
+++ b/src/sksl/ir/SkSLFieldAccess.h
@@ -17,10 +17,11 @@ namespace SkSL {
* An expression which extracts a field from a struct, as in 'foo.bar'.
*/
struct FieldAccess : public Expression {
- FieldAccess(std::unique_ptr<Expression> base, int fieldIndex)
+ FieldAccess(std::unique_ptr<Expression> base, int fieldIndex, bool inAnonymousInterfaceBlock)
: INHERITED(base->fPosition, kFieldAccess_Kind, base->fType.fields()[fieldIndex].fType)
, fBase(std::move(base))
- , fFieldIndex(fieldIndex) {}
+ , fFieldIndex(fieldIndex)
+ , fInAnonymousInterfaceBlock(inAnonymousInterfaceBlock) {}
virtual std::string description() const override {
return fBase->description() + "." + fBase->fType.fields()[fFieldIndex].fName;
@@ -28,6 +29,9 @@ struct FieldAccess : public Expression {
const std::unique_ptr<Expression> fBase;
const int fFieldIndex;
+ // if true, this field access is to a field of an anonymous interface block (and thus, the field
+ // name is actually in global scope, so only the field name needs to be written in GLSL)
+ const bool fInAnonymousInterfaceBlock;
typedef Expression INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698