Commit f86ecd46 by Alexis Hetu Committed by Alexis Hétu

transpose implementation

transpose is now implemented for dynamic variables. All NxN transpose dEQP tests pass. There's still an issue with some NxM matrices, but it seems to be unrelated to this code. Change-Id: Ie422706d0085c85fa6fc9a95dc21bb441dcddfe8 Reviewed-on: https://swiftshader-review.googlesource.com/3284Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 00106d49
......@@ -652,6 +652,24 @@ namespace glsl
case EOpFwidth: if(visit == PostVisit) emit(sw::Shader::OPCODE_FWIDTH, result, arg); break;
case EOpAny: if(visit == PostVisit) emit(sw::Shader::OPCODE_ANY, result, arg); break;
case EOpAll: if(visit == PostVisit) emit(sw::Shader::OPCODE_ALL, result, arg); break;
case EOpTranspose:
if(visit == PostVisit)
{
int numCols = arg->getNominalSize();
int numRows = arg->getSecondarySize();
for(int i = 0; i < numCols; ++i)
{
for(int j = 0; j < numRows; ++j)
{
Instruction *mov = emit(sw::Shader::OPCODE_MOV, result, arg);
mov->src[0].index += i;
mov->src[0].swizzle = 0x55 * j;
mov->dst.index += j;
mov->dst.mask = 1 << i;
}
}
}
break;
default: UNREACHABLE();
}
......
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