New upstream version 0.15.4+dfsg1
This commit is contained in:
parent
55d5047af0
commit
67704ac59c
359 changed files with 8423 additions and 1050 deletions
|
|
@ -231,7 +231,7 @@ void matrix4_scale_i(struct matrix4 *dst, const struct vec3 *v,
|
|||
|
||||
bool matrix4_inv(struct matrix4 *dst, const struct matrix4 *m)
|
||||
{
|
||||
struct vec4 *dstv = (struct vec4 *)dst;
|
||||
struct vec4 *dstv;
|
||||
float det;
|
||||
float m3x3[9];
|
||||
int i, j, sign;
|
||||
|
|
@ -261,25 +261,38 @@ bool matrix4_inv(struct matrix4 *dst, const struct matrix4 *m)
|
|||
|
||||
void matrix4_transpose(struct matrix4 *dst, const struct matrix4 *m)
|
||||
{
|
||||
struct matrix4 temp;
|
||||
if (dst == m) {
|
||||
struct matrix4 temp = *m;
|
||||
matrix4_transpose(dst, &temp);
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO: Add SSE */
|
||||
temp.x.x = m->x.x;
|
||||
temp.x.y = m->y.x;
|
||||
temp.x.z = m->z.x;
|
||||
temp.x.w = m->t.x;
|
||||
temp.y.x = m->x.y;
|
||||
temp.y.y = m->y.y;
|
||||
temp.y.z = m->z.y;
|
||||
temp.y.w = m->t.y;
|
||||
temp.z.x = m->x.z;
|
||||
temp.z.y = m->y.z;
|
||||
temp.z.z = m->z.z;
|
||||
temp.z.w = m->t.z;
|
||||
temp.t.x = m->x.w;
|
||||
temp.t.y = m->y.w;
|
||||
temp.t.z = m->z.w;
|
||||
temp.t.w = m->t.w;
|
||||
#ifdef NO_INTRINSICS
|
||||
dst->x.x = m->x.x;
|
||||
dst->x.y = m->y.x;
|
||||
dst->x.z = m->z.x;
|
||||
dst->x.w = m->t.x;
|
||||
dst->y.x = m->x.y;
|
||||
dst->y.y = m->y.y;
|
||||
dst->y.z = m->z.y;
|
||||
dst->y.w = m->t.y;
|
||||
dst->z.x = m->x.z;
|
||||
dst->z.y = m->y.z;
|
||||
dst->z.z = m->z.z;
|
||||
dst->z.w = m->t.z;
|
||||
dst->t.x = m->x.w;
|
||||
dst->t.y = m->y.w;
|
||||
dst->t.z = m->z.w;
|
||||
dst->t.w = m->t.w;
|
||||
#else
|
||||
__m128 a0 = _mm_unpacklo_ps(m->x.m, m->z.m);
|
||||
__m128 a1 = _mm_unpacklo_ps(m->y.m, m->t.m);
|
||||
__m128 a2 = _mm_unpackhi_ps(m->x.m, m->z.m);
|
||||
__m128 a3 = _mm_unpackhi_ps(m->y.m, m->t.m);
|
||||
|
||||
matrix4_copy(dst, &temp);
|
||||
dst->x.m = _mm_unpacklo_ps(a0, a1);
|
||||
dst->y.m = _mm_unpackhi_ps(a0, a1);
|
||||
dst->z.m = _mm_unpacklo_ps(a2, a3);
|
||||
dst->t.m = _mm_unpackhi_ps(a2, a3);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue