mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-15 00:11:06 +00:00
Unpack vector expression in Matrix-Vector multiplies.
This commit is contained in:
parent
0f10601f27
commit
ef1fa71bba
@ -15,9 +15,9 @@ struct SSBO
|
||||
|
||||
kernel void main0(device SSBO& _11 [[buffer(0)]])
|
||||
{
|
||||
_11.v0 = _11.v1 * (float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2])) * float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2])));
|
||||
_11.v0 = (_11.v1 * float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2]))) * float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2]));
|
||||
_11.v0 = float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2])) * (float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2])) * _11.v1);
|
||||
_11.v0 = (float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2])) * float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2]))) * _11.v1;
|
||||
_11.v0 = float3(_11.v1) * (float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2])) * float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2])));
|
||||
_11.v0 = (float3(_11.v1) * float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2]))) * float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2]));
|
||||
_11.v0 = float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2])) * (float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2])) * float3(_11.v1));
|
||||
_11.v0 = (float3x3(float3(_11.m1[0]), float3(_11.m1[1]), float3(_11.m1[2])) * float3x3(float3(_11.m0[0]), float3(_11.m0[1]), float3(_11.m0[2]))) * float3(_11.v1);
|
||||
}
|
||||
|
||||
|
@ -8330,9 +8330,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
|
||||
string expr;
|
||||
|
||||
if (opcode == OpMatrixTimesVector)
|
||||
expr = join(to_enclosed_expression(ops[3]), " * ", enclose_expression(to_unpacked_row_major_matrix_expression(ops[2])));
|
||||
expr = join(to_enclosed_unpacked_expression(ops[3]), " * ", enclose_expression(to_unpacked_row_major_matrix_expression(ops[2])));
|
||||
else
|
||||
expr = join(enclose_expression(to_unpacked_row_major_matrix_expression(ops[3])), " * ", to_enclosed_expression(ops[2]));
|
||||
expr = join(enclose_expression(to_unpacked_row_major_matrix_expression(ops[3])), " * ", to_enclosed_unpacked_expression(ops[2]));
|
||||
|
||||
bool forward = should_forward(ops[2]) && should_forward(ops[3]);
|
||||
emit_op(ops[0], ops[1], expr, forward);
|
||||
|
Loading…
Reference in New Issue
Block a user