Revert "Fix error in mat4x2(scalar) construction."

This reverts commit bbe1b996. Reason for revert: breaks conformance test Change-Id: I4f9579c10414b88646b4bda2449ac04e052ca162 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54449Tested-by: 's avatarJohn Stiles <johnstiles@google.com> Reviewed-by: 's avatarJohn Stiles <johnstiles@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
parent 85ea733c
......@@ -199,26 +199,19 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
}
} else { // for matrix constructors
int count = 0;
if (node->getType().getObjectSize() == 1) {
// Synthesize a diagonal matrix from the provided scalar.
int matrixCols = node->getType().getNominalSize();
for (int c = 0; c < matrixCols; ++c) {
for (int r = 0; r < matrixRows; ++r) {
if (r == c)
leftUnionArray[index].cast(basicType, rightUnionArray[0]);
else
leftUnionArray[index].setFConst(0.0);
(index)++;
}
}
} else {
// Construct a matrix from the provided components.
for (size_t i = index; i < totalSize; i++) {
if (i >= instanceSize)
return;
leftUnionArray[i].cast(basicType, rightUnionArray[count]);
int element = index;
for(size_t i = index; i < totalSize; i++) {
if (i >= instanceSize)
return;
if (element - i == 0 || (i - element) % (matrixRows + 1) == 0 )
leftUnionArray[i].cast(basicType, rightUnionArray[0]);
else
leftUnionArray[i].setFConst(0.0f);
(index)++;
if (node->getType().getObjectSize() > 1)
count++;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment