fixed incorrect index in SPIR-V matrix construction
Bug: skia:7908
Change-Id: I990e5f6e84afdc81d340f433d93a9061b9dd67ef
Reviewed-on: https://skia-review.googlesource.com/127397
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp
index 1cbe4c0..0e20b93 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -1252,7 +1252,7 @@
currentColumn.push_back(arguments[i]);
} else {
SpvId componentType = this->getType(c.fArguments[i]->fType.componentType());
- for (int j = 0; j < c.fArguments[j]->fType.columns(); ++j) {
+ for (int j = 0; j < c.fArguments[i]->fType.columns(); ++j) {
SpvId swizzle = this->nextId();
this->writeInstruction(SpvOpCompositeExtract, componentType, swizzle,
arguments[i], j, out);