aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLIRGenerator.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@google.com>2017-06-27 22:52:03 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-27 22:52:10 +0000
commit5ce397205528f82084fc650c2ce27d246c01da33 (patch)
tree3e359ae172fed10fce8204163d6d372b0c3f6207 /src/sksl/SkSLIRGenerator.h
parent3fe44544c93759e7791ee0df3e5d172cb0f268b6 (diff)
Revert "Re-land sksl fragment processor support"
This reverts commit c070939fd1a954b7a492bc30f0cf64a664b90181. Reason for revert: This has some knock-on effects in the generation of Android.bp from our GN files. See gn/gn_to_bp.py? We're seeing things like "tmp/tmpsBVycx/gen/" end up in the include search path in Android.bp, which obviously don't exist there... Original change's description: > Re-land sksl fragment processor support > > This reverts commit ed50200682e0de72c3abecaa4d5324ebcd1ed9f9. > > Bug: skia: > Change-Id: I9caa7454b391450620d6989dc472abb3cf7a2cab > Reviewed-on: https://skia-review.googlesource.com/20965 > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> TBR=benjaminwagner@google.com,ethannicholas@google.com Change-Id: I502486b5405923b322429219f4cc396a45a14cea No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/20990 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/sksl/SkSLIRGenerator.h')
-rw-r--r--src/sksl/SkSLIRGenerator.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/sksl/SkSLIRGenerator.h b/src/sksl/SkSLIRGenerator.h
index 3078a9e8df..29513d8d34 100644
--- a/src/sksl/SkSLIRGenerator.h
+++ b/src/sksl/SkSLIRGenerator.h
@@ -27,7 +27,6 @@
#include "ast/SkSLASTModifiersDeclaration.h"
#include "ast/SkSLASTPrefixExpression.h"
#include "ast/SkSLASTReturnStatement.h"
-#include "ast/SkSLASTSection.h"
#include "ast/SkSLASTStatement.h"
#include "ast/SkSLASTSuffixExpression.h"
#include "ast/SkSLASTSwitchStatement.h"
@@ -43,7 +42,6 @@
#include "ir/SkSLModifiers.h"
#include "ir/SkSLModifiersDeclaration.h"
#include "ir/SkSLProgram.h"
-#include "ir/SkSLSection.h"
#include "ir/SkSLSymbolTable.h"
#include "ir/SkSLStatement.h"
#include "ir/SkSLType.h"
@@ -52,6 +50,28 @@
namespace SkSL {
+struct CapValue {
+ CapValue()
+ : fKind(kInt_Kind)
+ , fValue(-1) {
+ ASSERT(false);
+ }
+
+ CapValue(bool b)
+ : fKind(kBool_Kind)
+ , fValue(b) {}
+
+ CapValue(int i)
+ : fKind(kInt_Kind)
+ , fValue(i) {}
+
+ enum {
+ kBool_Kind,
+ kInt_Kind,
+ } fKind;
+ int fValue;
+};
+
/**
* Performs semantic analysis on an abstract syntax tree (AST) and produces the corresponding
* (unoptimized) intermediate representation (IR).
@@ -75,7 +95,6 @@ public:
Token::Kind op,
const Expression& right) const;
Program::Inputs fInputs;
- const Program::Settings* fSettings;
const Context& fContext;
private:
@@ -141,9 +160,7 @@ private:
Modifiers convertModifiers(const Modifiers& m);
std::unique_ptr<Expression> convertPrefixExpression(const ASTPrefixExpression& expression);
std::unique_ptr<Statement> convertReturn(const ASTReturnStatement& r);
- std::unique_ptr<Section> convertSection(const ASTSection& e);
std::unique_ptr<Expression> getCap(Position position, String name);
- std::unique_ptr<Expression> getArg(Position position, String name);
std::unique_ptr<Expression> convertSuffixExpression(const ASTSuffixExpression& expression);
std::unique_ptr<Expression> convertField(std::unique_ptr<Expression> base,
const String& field);
@@ -156,26 +173,16 @@ private:
std::unique_ptr<Block> main,
std::vector<std::unique_ptr<ProgramElement>>* out);
- /**
- * Wraps an expression in code that applies a colorspace transformation to it. This is used
- * to implement texture(sampler, coord, colorSpaceXForm).
- */
- std::unique_ptr<Expression> applyColorSpace(std::unique_ptr<Expression> texture,
- const Variable* xform);
void fixRectSampling(std::vector<std::unique_ptr<Expression>>& arguments);
void checkValid(const Expression& expr);
void markWrittenTo(const Expression& expr, bool readWrite);
const FunctionDeclaration* fCurrentFunction;
- std::unordered_map<String, Program::Settings::Value> fCapsMap;
- std::shared_ptr<SymbolTable> fRootSymbolTable;
+ const Program::Settings* fSettings;
+ std::unordered_map<String, CapValue> fCapsMap;
std::shared_ptr<SymbolTable> fSymbolTable;
- // holds extra temp variable declarations needed for the current function
- std::vector<std::unique_ptr<Statement>> fExtraVars;
int fLoopLevel;
int fSwitchLevel;
- // count of temporary variables we have created
- int fTmpCount;
ErrorReporter& fErrors;
int fInvocations;