aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLMetalCodeGenerator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sksl/SkSLMetalCodeGenerator.h')
-rw-r--r--src/sksl/SkSLMetalCodeGenerator.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sksl/SkSLMetalCodeGenerator.h b/src/sksl/SkSLMetalCodeGenerator.h
index 6f8933c381..a0a0cae986 100644
--- a/src/sksl/SkSLMetalCodeGenerator.h
+++ b/src/sksl/SkSLMetalCodeGenerator.h
@@ -85,10 +85,12 @@ public:
protected:
typedef int Requirements;
+ typedef unsigned int TextureId;
static constexpr Requirements kNo_Requirements = 0;
static constexpr Requirements kInputs_Requirement = 1 << 0;
static constexpr Requirements kOutputs_Requirement = 1 << 1;
static constexpr Requirements kUniforms_Requirement = 1 << 2;
+ static constexpr Requirements kGlobals_Requirement = 1 << 3;
enum IntrinsicKind {
kSpecial_IntrinsicKind
@@ -100,6 +102,8 @@ protected:
void setupIntrinsics();
+ TextureId nextTextureId();
+
void write(const char* s);
void writeLine();
@@ -118,6 +122,8 @@ protected:
void writeOutputStruct();
+ void writeGlobalStruct();
+
void writePrecisionModifier();
void writeType(const Type& type);
@@ -210,6 +216,10 @@ protected:
typedef std::tuple<IntrinsicKind, int32_t, int32_t, int32_t, int32_t> Intrinsic;
std::unordered_map<String, Intrinsic> fIntrinsicMap;
+ std::vector<const VarDeclaration*> fInitNonConstGlobalVars;
+ TextureId fCurrentTextureId = 0;
+ std::unordered_map<String, TextureId> fTextureMap;
+ bool fNeedsGlobalStructInit = false;
const char* fLineEnding;
const Context& fContext;
StringStream fHeader;