aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLGLSLCodeGenerator.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-01-03 17:03:56 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-04 21:31:00 +0000
commit6e6525c930b683e6dcd5551bd7a3b68ecc68e45e (patch)
tree082822d9b9957705b6fc852bce922e3585a17dea /src/sksl/SkSLGLSLCodeGenerator.h
parent511c5d45ddf4dd029673f0855116513a13a5e028 (diff)
sksl now provides support for inverse, transpose, et al. on older versions of OpenGL
Bug: skia: Change-Id: I7dec3e3ae9f111a61c294cba4547c1af2260722f Reviewed-on: https://skia-review.googlesource.com/90525 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLGLSLCodeGenerator.h')
-rw-r--r--src/sksl/SkSLGLSLCodeGenerator.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sksl/SkSLGLSLCodeGenerator.h b/src/sksl/SkSLGLSLCodeGenerator.h
index e9a63ac48f..70ce920900 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.h
+++ b/src/sksl/SkSLGLSLCodeGenerator.h
@@ -136,6 +136,14 @@ protected:
void writeMinAbsHack(Expression& absExpr, Expression& otherExpr);
+ void writeDeterminantHack(const Expression& mat);
+
+ void writeInverseHack(const Expression& mat);
+
+ void writeTransposeHack(const Expression& mat);
+
+ void writeInverseSqrtHack(const Expression& x);
+
virtual void writeFunctionCall(const FunctionCall& c);
void writeConstructor(const Constructor& c, Precedence parentPrecedence);
@@ -187,6 +195,7 @@ protected:
const char* fLineEnding;
const Context& fContext;
StringStream fHeader;
+ StringStream fExtraFunctions;
String fFunctionHeader;
Program::Kind fProgramKind;
int fVarCount = 0;
@@ -196,6 +205,7 @@ protected:
// more than one or two structs per shader, a simple linear search will be faster than anything
// fancier.
std::vector<const Type*> fWrittenStructs;
+ std::set<String> fWrittenIntrinsics;
// true if we have run into usages of dFdx / dFdy
bool fFoundDerivatives = false;
bool fFoundImageDecl = false;