aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2016-11-01 11:57:42 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-01 17:46:51 +0000
commit4578a8e4a20260b64e0765010d41f5ee6e2c4080 (patch)
treed13270e130b2c8548e68355d3424844495aa9b77 /src
parenta9e9bfc6e40894c0447c044a380c74061cb9e15e (diff)
fixed skslc's handling of ivec(vec)
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4222 Change-Id: I9b32067af51f3a04efa702cf2eb1ac1ed480df6a Reviewed-on: https://skia-review.googlesource.com/4222 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/sksl/SkSLIRGenerator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp
index 0c9ee20328..ec64fa9348 100644
--- a/src/sksl/SkSLIRGenerator.cpp
+++ b/src/sksl/SkSLIRGenerator.cpp
@@ -1033,13 +1033,13 @@ std::unique_ptr<Expression> IRGenerator::convertConstructor(
ASSERT(kind == Type::kVector_Kind || kind == Type::kMatrix_Kind);
int actual = 0;
for (size_t i = 0; i < args.size(); i++) {
- if (args[i]->fType.kind() == Type::kVector_Kind ||
+ if (args[i]->fType.kind() == Type::kVector_Kind ||
args[i]->fType.kind() == Type::kMatrix_Kind) {
- int columns = args[i]->fType.columns();
- int rows = args[i]->fType.rows();
- args[i] = this->coerce(std::move(args[i]),
- type.componentType().toCompound(fContext, columns, rows));
- if (!args[i]) {
+ if (type.componentType().isNumber() !=
+ args[i]->fType.componentType().isNumber()) {
+ fErrors.error(position, "'" + args[i]->fType.description() + "' is not a valid "
+ "parameter to '" + type.description() +
+ "' constructor");
return nullptr;
}
actual += args[i]->fType.rows() * args[i]->fType.columns();