Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 Google LLC |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SKSL_DSLWRITER |
| 9 | #define SKSL_DSLWRITER |
| 10 | |
Ethan Nicholas | dd2fdea | 2021-07-20 15:23:04 -0400 | [diff] [blame^] | 11 | #include "include/core/SkStringView.h" |
Ethan Nicholas | daed259 | 2021-03-04 14:30:25 -0500 | [diff] [blame] | 12 | #include "include/private/SkSLModifiers.h" |
Ethan Nicholas | 24c1772 | 2021-03-09 13:10:59 -0500 | [diff] [blame] | 13 | #include "include/private/SkSLStatement.h" |
Ethan Nicholas | daed259 | 2021-03-04 14:30:25 -0500 | [diff] [blame] | 14 | #include "include/sksl/DSLExpression.h" |
| 15 | #include "include/sksl/DSLStatement.h" |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 16 | #include "src/sksl/SkSLMangler.h" |
John Stiles | 4599050 | 2021-02-16 10:55:27 -0500 | [diff] [blame] | 17 | #include "src/sksl/SkSLOperators.h" |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 18 | #include "src/sksl/SkSLParsedModule.h" |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 19 | #include "src/sksl/ir/SkSLExpressionStatement.h" |
| 20 | #include "src/sksl/ir/SkSLProgram.h" |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 21 | #if !defined(SKSL_STANDALONE) && SK_SUPPORT_GPU |
| 22 | #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" |
| 23 | #endif // !defined(SKSL_STANDALONE) && SK_SUPPORT_GPU |
John Stiles | 3befaf2 | 2021-04-23 14:42:22 -0400 | [diff] [blame] | 24 | #include <list> |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 25 | #include <stack> |
| 26 | |
| 27 | class AutoDSLContext; |
| 28 | |
| 29 | namespace SkSL { |
| 30 | |
| 31 | class Compiler; |
| 32 | class Context; |
| 33 | class IRGenerator; |
Ethan Nicholas | daed259 | 2021-03-04 14:30:25 -0500 | [diff] [blame] | 34 | class ProgramElement; |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 35 | class SymbolTable; |
| 36 | class Type; |
Ethan Nicholas | daed259 | 2021-03-04 14:30:25 -0500 | [diff] [blame] | 37 | class Variable; |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 38 | |
| 39 | namespace dsl { |
| 40 | |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 41 | class DSLGlobalVar; |
| 42 | class DSLParameter; |
| 43 | class DSLVar; |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 44 | class ErrorHandler; |
| 45 | |
| 46 | /** |
| 47 | * Thread-safe class that tracks per-thread state associated with DSL output. This class is for |
| 48 | * internal use only. |
| 49 | */ |
| 50 | class DSLWriter { |
| 51 | public: |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 52 | DSLWriter(SkSL::Compiler* compiler, SkSL::ProgramKind kind, |
| 53 | const SkSL::ProgramSettings& settings, SkSL::ParsedModule module, bool isModule); |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 54 | |
Ethan Nicholas | 0584ac0 | 2021-02-17 10:48:14 -0500 | [diff] [blame] | 55 | ~DSLWriter(); |
| 56 | |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 57 | /** |
| 58 | * Returns the Compiler used by DSL operations in the current thread. |
| 59 | */ |
| 60 | static SkSL::Compiler& Compiler() { |
| 61 | return *Instance().fCompiler; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Returns the IRGenerator used by DSL operations in the current thread. |
| 66 | */ |
| 67 | static SkSL::IRGenerator& IRGenerator(); |
| 68 | |
| 69 | /** |
| 70 | * Returns the Context used by DSL operations in the current thread. |
| 71 | */ |
| 72 | static const SkSL::Context& Context(); |
| 73 | |
| 74 | /** |
Ethan Nicholas | 459777a | 2021-07-16 11:16:27 -0400 | [diff] [blame] | 75 | * Returns the Settings used by DSL operations in the current thread. |
| 76 | */ |
| 77 | static SkSL::ProgramSettings& Settings(); |
| 78 | |
| 79 | /** |
Ethan Nicholas | 1ff7609 | 2021-01-28 10:02:43 -0500 | [diff] [blame] | 80 | * Returns the collection to which DSL program elements in this thread should be appended. |
| 81 | */ |
| 82 | static std::vector<std::unique_ptr<SkSL::ProgramElement>>& ProgramElements() { |
| 83 | return Instance().fProgramElements; |
| 84 | } |
| 85 | |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 86 | static std::vector<const ProgramElement*>& SharedElements() { |
| 87 | return Instance().fSharedElements; |
| 88 | } |
| 89 | |
Ethan Nicholas | 1ff7609 | 2021-01-28 10:02:43 -0500 | [diff] [blame] | 90 | /** |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 91 | * Returns the SymbolTable of the current thread's IRGenerator. |
| 92 | */ |
| 93 | static const std::shared_ptr<SkSL::SymbolTable>& SymbolTable(); |
| 94 | |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 95 | /** |
| 96 | * Returns the current memory pool. |
| 97 | */ |
| 98 | static std::unique_ptr<Pool>& MemoryPool() { return Instance().fPool; } |
| 99 | |
| 100 | /** |
| 101 | * Returns the current modifiers pool. |
| 102 | */ |
| 103 | static std::unique_ptr<ModifiersPool>& GetModifiersPool() { return Instance().fModifiersPool; } |
| 104 | |
| 105 | /** |
| 106 | * Returns the current ProgramConfig. |
| 107 | */ |
| 108 | static std::unique_ptr<ProgramConfig>& GetProgramConfig() { return Instance().fConfig; } |
| 109 | |
Ethan Nicholas | 292a09d | 2021-07-14 09:52:16 -0400 | [diff] [blame] | 110 | static bool IsModule() { return Instance().fIsModule; } |
| 111 | |
Ethan Nicholas | fe5d692 | 2021-03-05 14:23:48 -0500 | [diff] [blame] | 112 | static void Reset(); |
| 113 | |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 114 | /** |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 115 | * Returns the final pointer to a pooled Modifiers object that should be used to represent the |
| 116 | * given modifiers. |
| 117 | */ |
John Stiles | f2872e6 | 2021-05-04 11:38:43 -0400 | [diff] [blame] | 118 | static const SkSL::Modifiers* Modifiers(const SkSL::Modifiers& modifiers); |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 119 | |
| 120 | /** |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 121 | * Returns the SkSL variable corresponding to a DSL var. |
Ethan Nicholas | d6b26e5 | 2021-01-27 07:53:46 -0500 | [diff] [blame] | 122 | */ |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 123 | static const SkSL::Variable* Var(DSLVarBase& var); |
Ethan Nicholas | 707d315 | 2021-03-25 17:49:08 -0400 | [diff] [blame] | 124 | |
| 125 | /** |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 126 | * Creates an SkSL variable corresponding to a DSLParameter. |
Ethan Nicholas | 371f6e1 | 2021-05-04 14:30:02 -0400 | [diff] [blame] | 127 | */ |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 128 | static std::unique_ptr<SkSL::Variable> CreateParameterVar(DSLParameter& var); |
| 129 | |
Ethan Nicholas | 371f6e1 | 2021-05-04 14:30:02 -0400 | [diff] [blame] | 130 | |
| 131 | /** |
Ethan Nicholas | 707d315 | 2021-03-25 17:49:08 -0400 | [diff] [blame] | 132 | * Returns the SkSL declaration corresponding to a DSLVar. |
| 133 | */ |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 134 | static std::unique_ptr<SkSL::Statement> Declaration(DSLVarBase& var); |
Ethan Nicholas | d6b26e5 | 2021-01-27 07:53:46 -0500 | [diff] [blame] | 135 | |
| 136 | /** |
Ethan Nicholas | 961d944 | 2021-03-16 16:37:29 -0400 | [diff] [blame] | 137 | * For use in testing only: marks the variable as having been declared, so that it can be |
| 138 | * destroyed without generating errors. |
| 139 | */ |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 140 | static void MarkDeclared(DSLVarBase& var); |
Ethan Nicholas | 961d944 | 2021-03-16 16:37:29 -0400 | [diff] [blame] | 141 | |
| 142 | /** |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 143 | * Returns the (possibly mangled) final name that should be used for an entity with the given |
| 144 | * raw name. |
| 145 | */ |
Ethan Nicholas | d0f4d0d | 2021-06-23 13:51:55 -0400 | [diff] [blame] | 146 | static skstd::string_view Name(skstd::string_view name); |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 147 | |
Ethan Nicholas | c3bb9e3 | 2021-02-02 11:51:03 -0500 | [diff] [blame] | 148 | #if !defined(SKSL_STANDALONE) && SK_SUPPORT_GPU |
| 149 | /** |
| 150 | * Returns the fragment processor for which DSL output is being generated for the current |
| 151 | * thread. |
| 152 | */ |
| 153 | static GrGLSLFragmentProcessor* CurrentProcessor() { |
| 154 | SkASSERTF(!Instance().fStack.empty(), "This feature requires a FragmentProcessor"); |
| 155 | return Instance().fStack.top().fProcessor; |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * Returns the EmitArgs for fragment processor output in the current thread. |
| 160 | */ |
| 161 | static GrGLSLFragmentProcessor::EmitArgs* CurrentEmitArgs() { |
| 162 | SkASSERTF(!Instance().fStack.empty(), "This feature requires a FragmentProcessor"); |
| 163 | return Instance().fStack.top().fEmitArgs; |
| 164 | } |
| 165 | |
Ethan Nicholas | 11a15b1 | 2021-02-11 15:56:27 -0500 | [diff] [blame] | 166 | static bool InFragmentProcessor() { |
| 167 | return !Instance().fStack.empty(); |
| 168 | } |
| 169 | |
Ethan Nicholas | c3bb9e3 | 2021-02-02 11:51:03 -0500 | [diff] [blame] | 170 | /** |
| 171 | * Pushes a new processor / emitArgs pair for the current thread. |
| 172 | */ |
| 173 | static void StartFragmentProcessor(GrGLSLFragmentProcessor* processor, |
| 174 | GrGLSLFragmentProcessor::EmitArgs* emitArgs); |
| 175 | |
| 176 | /** |
| 177 | * Pops the processor / emitArgs pair associated with the current thread. |
| 178 | */ |
| 179 | static void EndFragmentProcessor(); |
Ethan Nicholas | 11a15b1 | 2021-02-11 15:56:27 -0500 | [diff] [blame] | 180 | |
Ethan Nicholas | a2d22b2 | 2021-07-15 10:35:54 -0400 | [diff] [blame] | 181 | static GrGLSLUniformHandler::UniformHandle VarUniformHandle(const DSLGlobalVar& var); |
Ethan Nicholas | ee49efc | 2021-04-09 15:33:53 -0400 | [diff] [blame] | 182 | #else |
| 183 | static bool InFragmentProcessor() { |
| 184 | return false; |
| 185 | } |
Ethan Nicholas | c3bb9e3 | 2021-02-02 11:51:03 -0500 | [diff] [blame] | 186 | #endif // !defined(SKSL_STANDALONE) && SK_SUPPORT_GPU |
| 187 | |
Ethan Nicholas | daed259 | 2021-03-04 14:30:25 -0500 | [diff] [blame] | 188 | static std::unique_ptr<SkSL::Expression> Call(const FunctionDeclaration& function, |
| 189 | ExpressionArray arguments); |
| 190 | |
Ethan Nicholas | 1ff7609 | 2021-01-28 10:02:43 -0500 | [diff] [blame] | 191 | /** |
Ethan Nicholas | 722cb67 | 2021-05-06 10:47:06 -0400 | [diff] [blame] | 192 | * Invokes expr(arguments), where expr is a function or type reference. |
| 193 | */ |
| 194 | static std::unique_ptr<SkSL::Expression> Call(std::unique_ptr<SkSL::Expression> expr, |
| 195 | ExpressionArray arguments); |
| 196 | |
Ethan Nicholas | b4f8b7a | 2021-06-23 10:27:09 -0400 | [diff] [blame] | 197 | static DSLPossibleExpression Coerce(std::unique_ptr<Expression> expr, const SkSL::Type& type); |
Ethan Nicholas | 92969f2 | 2021-01-13 10:38:59 -0500 | [diff] [blame] | 198 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 199 | static DSLPossibleExpression Construct(const SkSL::Type& type, |
Ethan Nicholas | 8455893 | 2021-04-12 16:56:37 -0400 | [diff] [blame] | 200 | SkTArray<DSLExpression> rawArgs); |
Ethan Nicholas | b3d4e74 | 2021-01-08 11:42:25 -0500 | [diff] [blame] | 201 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 202 | static std::unique_ptr<Expression> ConvertBinary(std::unique_ptr<Expression> left, Operator op, |
| 203 | std::unique_ptr<Expression> right); |
Ethan Nicholas | bf79dff | 2021-02-11 15:18:31 -0500 | [diff] [blame] | 204 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 205 | static std::unique_ptr<SkSL::Expression> ConvertField(std::unique_ptr<Expression> base, |
Ethan Nicholas | d0f4d0d | 2021-06-23 13:51:55 -0400 | [diff] [blame] | 206 | skstd::string_view name); |
Ethan Nicholas | 92969f2 | 2021-01-13 10:38:59 -0500 | [diff] [blame] | 207 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 208 | static std::unique_ptr<Expression> ConvertIndex(std::unique_ptr<Expression> base, |
| 209 | std::unique_ptr<Expression> index); |
Ethan Nicholas | 92969f2 | 2021-01-13 10:38:59 -0500 | [diff] [blame] | 210 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 211 | static std::unique_ptr<Expression> ConvertPostfix(std::unique_ptr<Expression> expr, |
| 212 | Operator op); |
Ethan Nicholas | 92969f2 | 2021-01-13 10:38:59 -0500 | [diff] [blame] | 213 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 214 | static std::unique_ptr<Expression> ConvertPrefix(Operator op, std::unique_ptr<Expression> expr); |
Ethan Nicholas | 92969f2 | 2021-01-13 10:38:59 -0500 | [diff] [blame] | 215 | |
Ethan Nicholas | 34c7e11 | 2021-02-25 20:50:32 -0500 | [diff] [blame] | 216 | static DSLPossibleStatement ConvertSwitch(std::unique_ptr<Expression> value, |
| 217 | ExpressionArray caseValues, |
Ethan Nicholas | 8a6537d | 2021-04-30 12:44:00 -0400 | [diff] [blame] | 218 | SkTArray<SkSL::StatementArray> caseStatements, |
| 219 | bool isStatic); |
Ethan Nicholas | cfefec0 | 2021-02-09 15:22:57 -0500 | [diff] [blame] | 220 | |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 221 | /** |
| 222 | * Sets the ErrorHandler associated with the current thread. This object will be notified when |
| 223 | * any DSL errors occur. With a null ErrorHandler (the default), any errors will be dumped to |
| 224 | * stderr and a fatal exception will be generated. |
| 225 | */ |
| 226 | static void SetErrorHandler(ErrorHandler* errorHandler) { |
| 227 | Instance().fErrorHandler = errorHandler; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * Notifies the current ErrorHandler that a DSL error has occurred. With a null ErrorHandler |
| 232 | * (the default), any errors will be dumped to stderr and a fatal exception will be generated. |
| 233 | */ |
Ethan Nicholas | b956304 | 2021-02-25 09:45:49 -0500 | [diff] [blame] | 234 | static void ReportError(const char* msg, PositionInfo* info = nullptr); |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 235 | |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 236 | /** |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 237 | * Returns whether name mangling is enabled. Mangling is important for the DSL because its |
| 238 | * variables normally all go into the same symbol table; for instance if you were to translate |
| 239 | * this legal (albeit silly) GLSL code: |
| 240 | * int x; |
| 241 | * { |
| 242 | * int x; |
| 243 | * } |
| 244 | * |
| 245 | * into DSL, you'd end up with: |
| 246 | * DSLVar x1(kInt_Type, "x"); |
| 247 | * DSLVar x2(kInt_Type, "x"); |
| 248 | * Declare(x1); |
| 249 | * Block(Declare(x2)); |
| 250 | * |
| 251 | * with x1 and x2 ending up in the same symbol table. This is fine as long as their effective |
| 252 | * names are different, so mangling prevents this situation from causing problems. |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 253 | */ |
| 254 | static bool ManglingEnabled() { |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 255 | return Instance().fSettings.fDSLMangling; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Returns whether DSLVars should automatically be marked declared upon creation. This is used |
| 260 | * to simplify testing. |
| 261 | */ |
| 262 | static bool MarkVarsDeclared() { |
| 263 | return Instance().fSettings.fDSLMarkVarsDeclared; |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 264 | } |
| 265 | |
Ethan Nicholas | b4f8b7a | 2021-06-23 10:27:09 -0400 | [diff] [blame] | 266 | /** |
| 267 | * Forwards any pending Compiler errors to the DSL ErrorHandler. |
| 268 | */ |
| 269 | static void ReportErrors(PositionInfo pos = PositionInfo()); |
| 270 | |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 271 | static DSLWriter& Instance(); |
| 272 | |
| 273 | static void SetInstance(std::unique_ptr<DSLWriter> instance); |
| 274 | |
| 275 | private: |
Ethan Nicholas | 624a529 | 2021-04-16 14:54:43 -0400 | [diff] [blame] | 276 | std::unique_ptr<SkSL::ProgramConfig> fConfig; |
John Stiles | 10d39d9 | 2021-05-04 16:13:14 -0400 | [diff] [blame] | 277 | std::unique_ptr<SkSL::ModifiersPool> fModifiersPool; |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 278 | SkSL::Compiler* fCompiler; |
Ethan Nicholas | 961d944 | 2021-03-16 16:37:29 -0400 | [diff] [blame] | 279 | std::unique_ptr<Pool> fPool; |
John Stiles | d120464 | 2021-02-17 16:30:02 -0500 | [diff] [blame] | 280 | SkSL::ProgramConfig* fOldConfig; |
John Stiles | 10d39d9 | 2021-05-04 16:13:14 -0400 | [diff] [blame] | 281 | SkSL::ModifiersPool* fOldModifiersPool; |
Ethan Nicholas | 1ff7609 | 2021-01-28 10:02:43 -0500 | [diff] [blame] | 282 | std::vector<std::unique_ptr<SkSL::ProgramElement>> fProgramElements; |
Ethan Nicholas | 624a529 | 2021-04-16 14:54:43 -0400 | [diff] [blame] | 283 | std::vector<const SkSL::ProgramElement*> fSharedElements; |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 284 | ErrorHandler* fErrorHandler = nullptr; |
Ethan Nicholas | 55a63af | 2021-05-18 10:12:58 -0400 | [diff] [blame] | 285 | ProgramSettings fSettings; |
Ethan Nicholas | bffe80a | 2021-01-11 15:42:44 -0500 | [diff] [blame] | 286 | Mangler fMangler; |
Ethan Nicholas | 292a09d | 2021-07-14 09:52:16 -0400 | [diff] [blame] | 287 | bool fIsModule; |
Ethan Nicholas | 4f3e6a2 | 2021-06-15 09:17:05 -0400 | [diff] [blame] | 288 | bool fEncounteredErrors = false; |
Ethan Nicholas | c3bb9e3 | 2021-02-02 11:51:03 -0500 | [diff] [blame] | 289 | #if !defined(SKSL_STANDALONE) && SK_SUPPORT_GPU |
| 290 | struct StackFrame { |
| 291 | GrGLSLFragmentProcessor* fProcessor; |
| 292 | GrGLSLFragmentProcessor::EmitArgs* fEmitArgs; |
John Stiles | 3befaf2 | 2021-04-23 14:42:22 -0400 | [diff] [blame] | 293 | SkSL::StatementArray fSavedDeclarations; |
Ethan Nicholas | c3bb9e3 | 2021-02-02 11:51:03 -0500 | [diff] [blame] | 294 | }; |
John Stiles | 3befaf2 | 2021-04-23 14:42:22 -0400 | [diff] [blame] | 295 | std::stack<StackFrame, std::list<StackFrame>> fStack; |
Ethan Nicholas | c3bb9e3 | 2021-02-02 11:51:03 -0500 | [diff] [blame] | 296 | #endif // !defined(SKSL_STANDALONE) && SK_SUPPORT_GPU |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 297 | |
| 298 | friend class DSLCore; |
Ethan Nicholas | 961d944 | 2021-03-16 16:37:29 -0400 | [diff] [blame] | 299 | friend class DSLVar; |
Ethan Nicholas | 9504614 | 2021-01-07 10:57:27 -0500 | [diff] [blame] | 300 | }; |
| 301 | |
| 302 | } // namespace dsl |
| 303 | |
| 304 | } // namespace SkSL |
| 305 | |
| 306 | #endif |