diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-06-12 12:05:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-15 18:06:58 +0000 |
commit | d5d323f45777c4766ddf4c74eedff36ee5d9bc56 (patch) | |
tree | b4af72c66c5265314b19113515e79931de627b26 /src/sksl/SkSLIRGenerator.h | |
parent | eee3c09e96d0a925e1ecaec118cc3ac0294e86ea (diff) |
implemented mustImplementGSInvocationsWithLoop workaround in sksl
Bug: skia:
Change-Id: I8434be89537a8baf9e9c5c7a643d28c03108f4ea
Reviewed-on: https://skia-review.googlesource.com/18154
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLIRGenerator.h')
-rw-r--r-- | src/sksl/SkSLIRGenerator.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/sksl/SkSLIRGenerator.h b/src/sksl/SkSLIRGenerator.h index d4a684638c..9bbc2bed32 100644 --- a/src/sksl/SkSLIRGenerator.h +++ b/src/sksl/SkSLIRGenerator.h @@ -81,13 +81,10 @@ public: IRGenerator(const Context* context, std::shared_ptr<SymbolTable> root, ErrorReporter& errorReporter); - std::unique_ptr<VarDeclarations> convertVarDeclarations(const ASTVarDeclarations& decl, - Variable::Storage storage); - std::unique_ptr<FunctionDefinition> convertFunction(const ASTFunction& f); - std::unique_ptr<Statement> convertStatement(const ASTStatement& statement); - std::unique_ptr<Expression> convertExpression(const ASTExpression& expression); - std::unique_ptr<ModifiersDeclaration> convertModifiersDeclaration( - const ASTModifiersDeclaration& m); + void convertProgram(String text, + SymbolTable& types, + Modifiers::Flag* defaultPrecision, + std::vector<std::unique_ptr<ProgramElement>>* result); /** * If both operands are compile-time constants and can be folded, returns an expression @@ -115,6 +112,15 @@ private: void pushSymbolTable(); void popSymbolTable(); + std::unique_ptr<VarDeclarations> convertVarDeclarations(const ASTVarDeclarations& decl, + Variable::Storage storage); + void convertFunction(const ASTFunction& f, + std::vector<std::unique_ptr<ProgramElement>>* out); + std::unique_ptr<Statement> convertStatement(const ASTStatement& statement); + std::unique_ptr<Expression> convertExpression(const ASTExpression& expression); + std::unique_ptr<ModifiersDeclaration> convertModifiersDeclaration( + const ASTModifiersDeclaration& m); + const Type* convertType(const ASTType& type); std::unique_ptr<Expression> call(Position position, const FunctionDeclaration& function, @@ -163,6 +169,10 @@ private: std::unique_ptr<Expression> convertTernaryExpression(const ASTTernaryExpression& expression); std::unique_ptr<Statement> convertVarDeclarationStatement(const ASTVarDeclarationStatement& s); std::unique_ptr<Statement> convertWhile(const ASTWhileStatement& w); + std::unique_ptr<Block> applyInvocationIDWorkaround( + std::unique_ptr<Block> main, + Variable* invocationID, + std::vector<std::unique_ptr<ProgramElement>>* out); void fixRectSampling(std::vector<std::unique_ptr<Expression>>& arguments); void checkValid(const Expression& expr); @@ -175,6 +185,7 @@ private: int fLoopLevel; int fSwitchLevel; ErrorReporter& fErrors; + int fInvocations; friend class AutoSymbolTable; friend class AutoLoopLevel; |