aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLSPIRVCodeGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-05-17 13:13:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-17 17:41:09 +0000
commitb3d0f7c793471765a1c140833cac8b5ede8e3193 (patch)
tree4f4a7f0395b49fd1f5ba3fe3656d11e89f27c6a4 /src/sksl/SkSLSPIRVCodeGenerator.cpp
parent464f38f9b2fa3f2f0b012f3bee7c3fb28d19851f (diff)
skslc SPIR-V mod support
Change-Id: I2df761ff0d25712dc48d367585d4b639e46d5d97 Reviewed-on: https://skia-review.googlesource.com/17243 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLSPIRVCodeGenerator.cpp')
-rw-r--r--src/sksl/SkSLSPIRVCodeGenerator.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp
index 1cbd1274fc..00ab25cf0a 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -2188,6 +2188,9 @@ SpvId SPIRVCodeGenerator::writeBinaryExpression(const BinaryExpression& b, Outpu
case Token::SLASH:
return this->writeBinaryOperation(resultType, *operandType, lhs, rhs, SpvOpFDiv,
SpvOpSDiv, SpvOpUDiv, SpvOpUndef, out);
+ case Token::PERCENT:
+ return this->writeBinaryOperation(resultType, *operandType, lhs, rhs, SpvOpFMod,
+ SpvOpSMod, SpvOpUMod, SpvOpUndef, out);
case Token::PLUSEQ: {
SpvId result = this->writeBinaryOperation(resultType, *operandType, lhs, rhs, SpvOpFAdd,
SpvOpIAdd, SpvOpIAdd, SpvOpUndef, out);
@@ -2226,6 +2229,13 @@ SpvId SPIRVCodeGenerator::writeBinaryExpression(const BinaryExpression& b, Outpu
lvalue->store(result, out);
return result;
}
+ case Token::PERCENTEQ: {
+ SpvId result = this->writeBinaryOperation(resultType, *operandType, lhs, rhs, SpvOpFMod,
+ SpvOpSMod, SpvOpUMod, SpvOpUndef, out);
+ ASSERT(lvalue);
+ lvalue->store(result, out);
+ return result;
+ }
default:
// FIXME: missing support for some operators (bitwise, &&=, ||=, shift...)
ABORT("unsupported binary expression: %s", b.description().c_str());