Add missing header and inline functions in CompressorDXT1, fix compile error on macOS.

pull/312/head
Lendy Zhang 4 years ago
parent daff42781d
commit b126406886

@ -5,6 +5,7 @@
#include "nvmath/nvmath.h"
#include <string.h> // memset
#include <limits.h> // INT_MAX
#include <float.h> // FLT_MAX
@ -55,6 +56,26 @@ namespace nv {
float x, y, z;
};*/
inline Vector3::Vector3() {}
inline Vector3::Vector3(float f) : x(f), y(f), z(f) {}
inline Vector3::Vector3(float x, float y, float z) : x(x), y(y), z(z) {}
inline Vector3::Vector3(Vector3::Arg v) : x(v.x), y(v.y), z(v.z) {}
inline const Vector3 & Vector3::operator=(Vector3::Arg v)
{
x = v.x;
y = v.y;
z = v.z;
return *this;
}
inline void Vector3::operator+=(Vector3::Arg v)
{
x += v.x;
y += v.y;
z += v.z;
}
inline Vector3 operator*(Vector3 v, float s) {
return { v.x * s, v.y * s, v.z * s };
}
@ -107,6 +128,13 @@ namespace nv {
this->x = x; this->y = y; this->z = z;
}
inline Vector4::Vector4(Vector3::Arg v, float w) : x(v.x), y(v.y), z(v.z), w(w) {}
inline Vector3 Vector4::xyz() const
{
return Vector3(x, y, z);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////

@ -46,6 +46,11 @@ typedef unsigned int u32;
#define TEST_AMD_CMP 1
namespace nv
{
inline Vector3::Vector3(float f) : x(f), y(f), z(f) {}
inline Vector4::Vector4() {}
}
static float mse_to_psnr(float mse) {
float rms = sqrtf(mse);

Loading…
Cancel
Save