diff options
author | Timothy Liang <timliang@google.com> | 2018-06-07 09:55:33 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-08 13:51:41 +0000 |
commit | 651286f5d81859d39d2eee43a53fbc266df85f66 (patch) | |
tree | f1ae0033c176b79e86567f238efb2c8f08f1da15 /src/sksl/SkSLMetalCodeGenerator.h | |
parent | 229f4d93c185cb14f249b6abbdad0397a9397c76 (diff) |
fixed vec3 size differences and mod calculation of skslc msl backend
Bug: skia:
Change-Id: I5dc6d956463845627a1a2debee5ac8856e5e2e8d
Reviewed-on: https://skia-review.googlesource.com/132500
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Timothy Liang <timliang@google.com>
Diffstat (limited to 'src/sksl/SkSLMetalCodeGenerator.h')
-rw-r--r-- | src/sksl/SkSLMetalCodeGenerator.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sksl/SkSLMetalCodeGenerator.h b/src/sksl/SkSLMetalCodeGenerator.h index 3f0bc2862b..d5a8ca12fa 100644 --- a/src/sksl/SkSLMetalCodeGenerator.h +++ b/src/sksl/SkSLMetalCodeGenerator.h @@ -13,6 +13,7 @@ #include <unordered_map> #include "SkSLCodeGenerator.h" +#include "SkSLMemoryLayout.h" #include "SkSLStringStream.h" #include "ir/SkSLBinaryExpression.h" #include "ir/SkSLBoolLiteral.h" @@ -79,6 +80,7 @@ public: MetalCodeGenerator(const Context* context, const Program* program, ErrorReporter* errors, OutputStream* out) : INHERITED(program, errors, out) + , fReservedWords({"atan2", "rsqrt", "dfdx", "dfdy"}) , fLineEnding("\n") , fContext(*context) { this->setupIntrinsics(); @@ -102,6 +104,7 @@ protected: enum SpecialIntrinsic { kTexture_SpecialIntrinsic, + kMod_SpecialIntrinsic, }; enum MetalIntrinsic { @@ -161,6 +164,8 @@ protected: void writeVarInitializer(const Variable& var, const Expression& value); + void writeName(const String& name); + void writeVarDeclarations(const VarDeclarations& decl, bool global); void writeFragCoord(); @@ -231,6 +236,7 @@ protected: typedef std::pair<IntrinsicKind, int32_t> Intrinsic; std::unordered_map<String, Intrinsic> fIntrinsicMap; + std::unordered_set<String> fReservedWords; std::vector<const VarDeclaration*> fInitNonConstGlobalVars; std::vector<const Variable*> fTextures; std::unordered_map<const Type::Field*, const InterfaceBlock*> fInterfaceBlockMap; |