diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-08-16 16:41:30 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-16 23:05:15 +0000 |
commit | 88d99c63878c2d3d340120f0321676f72afcb4f0 (patch) | |
tree | 5b957dbf2f78ef7a15aa3810f8922c915508683f /src/sksl/ir/SkSLConstructor.h | |
parent | a26d219a929f4e70f8597dfd57a53348c4bba905 (diff) |
Switched highp float to highfloat and mediump float to half.
The ultimate goal is to end up with "float" and "half", but this
intermediate step uses "highfloat" so that it is clear if I missed a
"float" somewhere. Once this lands, a subsequent CL will switch all
"highfloats" back to "floats".
Bug: skia:
Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca
Reviewed-on: https://skia-review.googlesource.com/31000
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLConstructor.h')
-rw-r--r-- | src/sksl/ir/SkSLConstructor.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sksl/ir/SkSLConstructor.h b/src/sksl/ir/SkSLConstructor.h index beed0f702d..8f963e68eb 100644 --- a/src/sksl/ir/SkSLConstructor.h +++ b/src/sksl/ir/SkSLConstructor.h @@ -33,13 +33,15 @@ struct Constructor : public Expression { std::unique_ptr<Expression> constantPropagate(const IRGenerator& irGenerator, const DefinitionMap& definitions) override { if (fArguments.size() == 1 && fArguments[0]->fKind == Expression::kIntLiteral_Kind) { - if (fType == *irGenerator.fContext.fFloat_Type) { + if (fType == *irGenerator.fContext.fFloat_Type || + fType == *irGenerator.fContext.fHalf_Type) { // promote float(1) to 1.0 int64_t intValue = ((IntLiteral&) *fArguments[0]).fValue; return std::unique_ptr<Expression>(new FloatLiteral(irGenerator.fContext, fPosition, intValue)); - } else if (fType == *irGenerator.fContext.fUInt_Type) { + } else if (fType == *irGenerator.fContext.fUInt_Type || + fType == *irGenerator.fContext.fUShort_Type) { // promote uint(1) to 1u int64_t intValue = ((IntLiteral&) *fArguments[0]).fValue; return std::unique_ptr<Expression>(new IntLiteral(irGenerator.fContext, |