Commit 60859e3e by Nicolas Capens

Fix scalar times matrix.

Change-Id: I9b46031f57b0cf49428e295b06702099ffef7f01 Reviewed-on: https://swiftshader-review.googlesource.com/5030Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent fcad1bfd
...@@ -727,10 +727,21 @@ namespace glsl ...@@ -727,10 +727,21 @@ namespace glsl
case EOpMatrixTimesScalar: case EOpMatrixTimesScalar:
if(visit == PostVisit) if(visit == PostVisit)
{ {
for(int i = 0; i < leftType.getNominalSize(); i++) if(left->isMatrix())
{ {
emit(sw::Shader::OPCODE_MUL, result, i, left, i, right); for(int i = 0; i < leftType.getNominalSize(); i++)
{
emit(sw::Shader::OPCODE_MUL, result, i, left, i, right, 0);
}
} }
else if(right->isMatrix())
{
for(int i = 0; i < rightType.getNominalSize(); i++)
{
emit(sw::Shader::OPCODE_MUL, result, i, left, 0, right, i);
}
}
else UNREACHABLE(0);
} }
break; break;
case EOpVectorTimesMatrix: case EOpVectorTimesMatrix:
......
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