feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
12
engine/thirdparty/meshoptimizer/quantization.cpp
vendored
12
engine/thirdparty/meshoptimizer/quantization.cpp
vendored
|
|
@ -3,9 +3,15 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
union FloatBits
|
||||
{
|
||||
float f;
|
||||
unsigned int ui;
|
||||
};
|
||||
|
||||
unsigned short meshopt_quantizeHalf(float v)
|
||||
{
|
||||
union { float f; unsigned int ui; } u = {v};
|
||||
FloatBits u = {v};
|
||||
unsigned int ui = u.ui;
|
||||
|
||||
int s = (ui >> 16) & 0x8000;
|
||||
|
|
@ -30,7 +36,7 @@ float meshopt_quantizeFloat(float v, int N)
|
|||
{
|
||||
assert(N >= 0 && N <= 23);
|
||||
|
||||
union { float f; unsigned int ui; } u = {v};
|
||||
FloatBits u = {v};
|
||||
unsigned int ui = u.ui;
|
||||
|
||||
const int mask = (1 << (23 - N)) - 1;
|
||||
|
|
@ -64,7 +70,7 @@ float meshopt_dequantizeHalf(unsigned short h)
|
|||
// 112 is an exponent bias fixup; since we already applied it once, applying it twice converts 31 to 255
|
||||
r += (em >= (31 << 10)) ? (112 << 23) : 0;
|
||||
|
||||
union { float f; unsigned int ui; } u;
|
||||
FloatBits u;
|
||||
u.ui = s | r;
|
||||
return u.f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue