aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLIRGenerator.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-03-26 14:24:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-26 19:03:44 +0000
commit8f7e28f3ae262450c5b04deded9fa23041757868 (patch)
treeca5007c4dce793ee1841a5a2d27d1a865a5f85ff /src/sksl/SkSLIRGenerator.h
parent19d311b1e3f48d0f04585ce199c377956af52be4 (diff)
added frexp support to SkSL
This includes an optimizer fix for the situation: int i; float f = frexp(foo, i); If we don't read the variable i, it is considered dead and eliminated - which then causes an error when we try to write the expression frexmp(foo, i). Bug: skia: Change-Id: Iac385e38e215455346fab62e1f4ec46fa65b3c21 Reviewed-on: https://skia-review.googlesource.com/116521 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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sksl/SkSLIRGenerator.h b/src/sksl/SkSLIRGenerator.h
index 327fe6fc7a..e8ff1d21c8 100644
--- a/src/sksl/SkSLIRGenerator.h
+++ b/src/sksl/SkSLIRGenerator.h
@@ -50,6 +50,7 @@
#include "ir/SkSLType.h"
#include "ir/SkSLTypeReference.h"
#include "ir/SkSLVarDeclarations.h"
+#include "ir/SkSLVariableReference.h"
namespace SkSL {
@@ -162,7 +163,7 @@ private:
void fixRectSampling(std::vector<std::unique_ptr<Expression>>& arguments);
void checkValid(const Expression& expr);
- void markWrittenTo(const Expression& expr, bool readWrite);
+ void setRefKind(const Expression& expr, VariableReference::RefKind kind);
void getConstantInt(const Expression& value, int64_t* out);
Program::Kind fKind;