mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 07:34:23 +00:00
feat(mat4): add transpose function (not yet SIMD)
This commit is contained in:
@@ -227,7 +227,22 @@ Mat4f_t mat4_mul(const Mat4f_t* m1, const Mat4f_t* m2)
|
|||||||
return mout;
|
return mout;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat4f_t* mat4_tpo_r(Mat4f_t *__restrict m)
|
Mat4f_t* mat4_tpo_r(Mat4f_t *__restrict out)
|
||||||
{
|
{
|
||||||
return m;
|
Mat4f_t clone = mat4f_clone(out);
|
||||||
|
|
||||||
|
for(int i = 0; i < MAT_DIM; i++) {
|
||||||
|
#if defined (SIMD_X86)
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined (SIMD_ARCH)
|
||||||
|
#else
|
||||||
|
int dim_i = i * MAT_DIM;
|
||||||
|
|
||||||
|
for (int j = 0; j < MAT_DIM; j++) {
|
||||||
|
out->m[dim_i + j] = clone.m[(j * MAT_DIM) + i];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user