mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 07:34:23 +00:00
fix: __restrict__ doesn't work on MSVC
This commit is contained in:
@@ -22,10 +22,8 @@
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define ALIGN16 __declspec(align(16))
|
#define ALIGN16 __declspec(align(16))
|
||||||
#define RESTRICT __restrict__
|
|
||||||
#else
|
#else
|
||||||
#define ALIGN16 __attribute__((aligned(16)))
|
#define ALIGN16 __attribute__((aligned(16)))
|
||||||
#define RESTRICT __restrict
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // MCONFIG_H
|
#endif // MCONFIG_H
|
||||||
|
|||||||
@@ -16,25 +16,25 @@ typedef union
|
|||||||
float data[4];
|
float data[4];
|
||||||
} ALIGN16 Vec3f_t;
|
} ALIGN16 Vec3f_t;
|
||||||
|
|
||||||
Vec3f_t vec3f_from_array(const float *RESTRICT val);
|
Vec3f_t vec3f_from_array(const float *restrict val);
|
||||||
Vec3f_t vec3f(float x, float y, float z);
|
Vec3f_t vec3f(float x, float y, float z);
|
||||||
// (f, f, f)
|
// (f, f, f)
|
||||||
Vec3f_t vec3f_scalar(float f);
|
Vec3f_t vec3f_scalar(float f);
|
||||||
// (0, 0, 0)
|
// (0, 0, 0)
|
||||||
Vec3f_t vec3f_zero(void);
|
Vec3f_t vec3f_zero(void);
|
||||||
|
|
||||||
inline static Vec3f_t vec3f_clone(const Vec3f_t *RESTRICT v)
|
inline static Vec3f_t vec3f_clone(const Vec3f_t *restrict v)
|
||||||
{
|
{
|
||||||
return *v;
|
return *v;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec3f_t vec3f_add_r(Vec3f_t *RESTRICT out, Vec3f_t a);
|
Vec3f_t vec3f_add_r(Vec3f_t *restrict out, Vec3f_t a);
|
||||||
Vec3f_t vec3f_add(Vec3f_t a, Vec3f_t b);
|
Vec3f_t vec3f_add(Vec3f_t a, Vec3f_t b);
|
||||||
|
|
||||||
Vec3f_t vec3f_sub_r(Vec3f_t *RESTRICT out, Vec3f_t a);
|
Vec3f_t vec3f_sub_r(Vec3f_t *restrict out, Vec3f_t a);
|
||||||
Vec3f_t vec3f_sub(Vec3f_t a, Vec3f_t b);
|
Vec3f_t vec3f_sub(Vec3f_t a, Vec3f_t b);
|
||||||
|
|
||||||
Vec3f_t vec3f_scale_r(Vec3f_t *RESTRICT out, float scale);
|
Vec3f_t vec3f_scale_r(Vec3f_t *restrict out, float scale);
|
||||||
Vec3f_t vec3f_scale(Vec3f_t a, float scale);
|
Vec3f_t vec3f_scale(Vec3f_t a, float scale);
|
||||||
|
|
||||||
#endif /* vec3_h */
|
#endif /* vec3_h */
|
||||||
|
|||||||
@@ -10,25 +10,25 @@ typedef union
|
|||||||
float data[4];
|
float data[4];
|
||||||
} ALIGN16 Vec4f_t;
|
} ALIGN16 Vec4f_t;
|
||||||
|
|
||||||
Vec4f_t vec4f_from_array(const float *RESTRICT val);
|
Vec4f_t vec4f_from_array(const float *restrict val);
|
||||||
Vec4f_t vec4f(float x, float y, float z, float w);
|
Vec4f_t vec4f(float x, float y, float z, float w);
|
||||||
// (f, f, f, f)
|
// (f, f, f, f)
|
||||||
Vec4f_t vec4f_scalar(float f);
|
Vec4f_t vec4f_scalar(float f);
|
||||||
// (0, 0, 0, 0)
|
// (0, 0, 0, 0)
|
||||||
Vec4f_t vec4f_zero(void);
|
Vec4f_t vec4f_zero(void);
|
||||||
|
|
||||||
inline static Vec4f_t vec4f_clone(const Vec4f_t *RESTRICT v)
|
inline static Vec4f_t vec4f_clone(const Vec4f_t *restrict v)
|
||||||
{
|
{
|
||||||
return *v;
|
return *v;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec4f_t vec4f_add_r(Vec4f_t *RESTRICT out, Vec4f_t a);
|
Vec4f_t vec4f_add_r(Vec4f_t *restrict out, Vec4f_t a);
|
||||||
Vec4f_t vec4f_add(Vec4f_t a, Vec4f_t b);
|
Vec4f_t vec4f_add(Vec4f_t a, Vec4f_t b);
|
||||||
|
|
||||||
Vec4f_t vec4f_sub_r(Vec4f_t *RESTRICT out, Vec4f_t a);
|
Vec4f_t vec4f_sub_r(Vec4f_t *restrict out, Vec4f_t a);
|
||||||
Vec4f_t vec4f_sub(Vec4f_t a, Vec4f_t b);
|
Vec4f_t vec4f_sub(Vec4f_t a, Vec4f_t b);
|
||||||
|
|
||||||
Vec4f_t vec4f_scale_r(Vec4f_t *RESTRICT out, float scale);
|
Vec4f_t vec4f_scale_r(Vec4f_t *restrict out, float scale);
|
||||||
Vec4f_t vec4f_scale(Vec4f_t a, float scale);
|
Vec4f_t vec4f_scale(Vec4f_t a, float scale);
|
||||||
|
|
||||||
float vec4_dot(Vec4f_t a, Vec4f_t b);
|
float vec4_dot(Vec4f_t a, Vec4f_t b);
|
||||||
|
|||||||
Reference in New Issue
Block a user