New upstream version 24.0.1+dfsg1

This commit is contained in:
Sebastian Ramacher 2019-09-22 23:19:10 +02:00
parent b14f9eae6d
commit 5a730d6ec3
842 changed files with 42245 additions and 33385 deletions

View file

@ -58,54 +58,50 @@ static inline void vec3_copy(struct vec3 *dst, const struct vec3 *v)
EXPORT void vec3_from_vec4(struct vec3 *dst, const struct vec4 *v);
static inline void vec3_add(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
dst->m = _mm_add_ps(v1->m, v2->m);
dst->w = 0.0f;
}
static inline void vec3_sub(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
dst->m = _mm_sub_ps(v1->m, v2->m);
dst->w = 0.0f;
}
static inline void vec3_mul(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
dst->m = _mm_mul_ps(v1->m, v2->m);
}
static inline void vec3_div(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
dst->m = _mm_div_ps(v1->m, v2->m);
dst->w = 0.0f;
}
static inline void vec3_addf(struct vec3 *dst, const struct vec3 *v,
float f)
static inline void vec3_addf(struct vec3 *dst, const struct vec3 *v, float f)
{
dst->m = _mm_add_ps(v->m, _mm_set1_ps(f));
dst->w = 0.0f;
}
static inline void vec3_subf(struct vec3 *dst, const struct vec3 *v,
float f)
static inline void vec3_subf(struct vec3 *dst, const struct vec3 *v, float f)
{
dst->m = _mm_sub_ps(v->m, _mm_set1_ps(f));
dst->w = 0.0f;
}
static inline void vec3_mulf(struct vec3 *dst, const struct vec3 *v,
float f)
static inline void vec3_mulf(struct vec3 *dst, const struct vec3 *v, float f)
{
dst->m = _mm_mul_ps(v->m, _mm_set1_ps(f));
}
static inline void vec3_divf(struct vec3 *dst, const struct vec3 *v,
float f)
static inline void vec3_divf(struct vec3 *dst, const struct vec3 *v, float f)
{
dst->m = _mm_div_ps(v->m, _mm_set1_ps(f));
dst->w = 0.0f;
@ -121,7 +117,7 @@ static inline float vec3_dot(const struct vec3 *v1, const struct vec3 *v2)
}
static inline void vec3_cross(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
__m128 s1v1 = _mm_shuffle_ps(v1->m, v1->m, _MM_SHUFFLE(3, 0, 2, 1));
__m128 s1v2 = _mm_shuffle_ps(v2->m, v2->m, _MM_SHUFFLE(3, 1, 0, 2));
@ -157,13 +153,13 @@ static inline float vec3_dist(const struct vec3 *v1, const struct vec3 *v2)
static inline void vec3_norm(struct vec3 *dst, const struct vec3 *v)
{
float dot_val = vec3_dot(v, v);
dst->m = (dot_val > 0.0f) ?
_mm_mul_ps(v->m, _mm_set1_ps(1.0f/sqrtf(dot_val))) :
_mm_setzero_ps();
dst->m = (dot_val > 0.0f)
? _mm_mul_ps(v->m, _mm_set1_ps(1.0f / sqrtf(dot_val)))
: _mm_setzero_ps();
}
static inline bool vec3_close(const struct vec3 *v1, const struct vec3 *v2,
float epsilon)
float epsilon)
{
struct vec3 test;
vec3_sub(&test, v1, v2);
@ -171,28 +167,26 @@ static inline bool vec3_close(const struct vec3 *v1, const struct vec3 *v2,
}
static inline void vec3_min(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
dst->m = _mm_min_ps(v1->m, v2->m);
dst->w = 0.0f;
}
static inline void vec3_minf(struct vec3 *dst, const struct vec3 *v,
float f)
static inline void vec3_minf(struct vec3 *dst, const struct vec3 *v, float f)
{
dst->m = _mm_min_ps(v->m, _mm_set1_ps(f));
dst->w = 0.0f;
}
static inline void vec3_max(struct vec3 *dst, const struct vec3 *v1,
const struct vec3 *v2)
const struct vec3 *v2)
{
dst->m = _mm_max_ps(v1->m, v2->m);
dst->w = 0.0f;
}
static inline void vec3_maxf(struct vec3 *dst, const struct vec3 *v,
float f)
static inline void vec3_maxf(struct vec3 *dst, const struct vec3 *v, float f)
{
dst->m = _mm_max_ps(v->m, _mm_set1_ps(f));
dst->w = 0.0f;
@ -225,17 +219,17 @@ static inline void vec3_ceil(struct vec3 *dst, const struct vec3 *v)
EXPORT float vec3_plane_dist(const struct vec3 *v, const struct plane *p);
EXPORT void vec3_transform(struct vec3 *dst, const struct vec3 *v,
const struct matrix4 *m);
const struct matrix4 *m);
EXPORT void vec3_rotate(struct vec3 *dst, const struct vec3 *v,
const struct matrix3 *m);
const struct matrix3 *m);
EXPORT void vec3_transform3x4(struct vec3 *dst, const struct vec3 *v,
const struct matrix3 *m);
const struct matrix3 *m);
EXPORT void vec3_mirror(struct vec3 *dst, const struct vec3 *v,
const struct plane *p);
const struct plane *p);
EXPORT void vec3_mirrorv(struct vec3 *dst, const struct vec3 *v,
const struct vec3 *vec);
const struct vec3 *vec);
EXPORT void vec3_rand(struct vec3 *dst, int positive_only);