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) ...@@ -199,26 +199,19 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
} }
} else { // for matrix constructors } else { // for matrix constructors
int count = 0; int count = 0;
if (node->getType().getObjectSize() == 1) { int element = index;
// Synthesize a diagonal matrix from the provided scalar. for(size_t i = index; i < totalSize; i++) {
int matrixCols = node->getType().getNominalSize(); if (i >= instanceSize)
for (int c = 0; c < matrixCols; ++c) { return;
for (int r = 0; r < matrixRows; ++r) { if (element - i == 0 || (i - element) % (matrixRows + 1) == 0 )
if (r == c) leftUnionArray[i].cast(basicType, rightUnionArray[0]);
leftUnionArray[index].cast(basicType, rightUnionArray[0]); else
else leftUnionArray[i].setFConst(0.0f);
leftUnionArray[index].setFConst(0.0);
(index)++; (index)++;
}
} if (node->getType().getObjectSize() > 1)
} 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]);
count++; 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