parent
345acb6f1e
commit
14f2da4ab6
@ -0,0 +1,66 @@
|
|||||||
|
diff -ru glm/glm/gtc/packing.inl glm-aliasfix/glm/gtc/packing.inl
|
||||||
|
--- glm/glm/gtc/packing.inl 2014-02-08 21:28:22.000000000 +0200
|
||||||
|
+++ glm-aliasfix/glm/gtc/packing.inl 2014-06-11 12:29:07.345452993 +0300
|
||||||
|
@@ -35,6 +35,26 @@
|
||||||
|
namespace glm{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
+ GLM_FUNC_QUALIFIER float float_from_bits_of_uint(uint const u)
|
||||||
|
+ {
|
||||||
|
+ union {
|
||||||
|
+ float as_float;
|
||||||
|
+ uint as_uint;
|
||||||
|
+ } result;
|
||||||
|
+ result.as_uint = u;
|
||||||
|
+ return result.as_float;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ GLM_FUNC_QUALIFIER glm::uint uint_from_bits_of_float(float const f)
|
||||||
|
+ {
|
||||||
|
+ union {
|
||||||
|
+ float as_float;
|
||||||
|
+ uint as_uint;
|
||||||
|
+ } result;
|
||||||
|
+ result.as_float = f;
|
||||||
|
+ return result.as_uint;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 const & f)
|
||||||
|
{
|
||||||
|
// 10 bits => EE EEEFFFFF
|
||||||
|
@@ -145,7 +165,7 @@
|
||||||
|
else if(glm::isinf(x))
|
||||||
|
return 0x1f << 6;
|
||||||
|
|
||||||
|
- return float2packed11(reinterpret_cast<uint&>(x));
|
||||||
|
+ return float2packed11(uint_from_bits_of_float(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x)
|
||||||
|
@@ -158,7 +178,7 @@
|
||||||
|
return ~0;//Inf
|
||||||
|
|
||||||
|
uint result = packed11ToFloat(x);
|
||||||
|
- return reinterpret_cast<float&>(result);
|
||||||
|
+ return float_from_bits_of_uint(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x)
|
||||||
|
@@ -170,7 +190,7 @@
|
||||||
|
else if(glm::isinf(x))
|
||||||
|
return 0x1f << 5;
|
||||||
|
|
||||||
|
- return float2packed10(reinterpret_cast<uint&>(x));
|
||||||
|
+ return float2packed10(uint_from_bits_of_float(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x)
|
||||||
|
@@ -183,7 +203,7 @@
|
||||||
|
return ~0;//Inf
|
||||||
|
|
||||||
|
uint result = packed10ToFloat(x);
|
||||||
|
- return reinterpret_cast<float&>(result);
|
||||||
|
+ return float_from_bits_of_uint(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z)
|
@ -0,0 +1,12 @@
|
|||||||
|
diff -ru glm/test/core/core_func_matrix.cpp glm_count/test/core/core_func_matrix.cpp
|
||||||
|
--- glm/test/core/core_func_matrix.cpp 2014-02-08 21:28:22.000000000 +0200
|
||||||
|
+++ glm_count/test/core/core_func_matrix.cpp 2014-06-10 19:50:43.355854306 +0300
|
||||||
|
@@ -186,7 +186,7 @@
|
||||||
|
return Failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
-std::size_t const Count(10000000);
|
||||||
|
+std::size_t const Count(1000000);
|
||||||
|
|
||||||
|
template <typename VEC3, typename MAT4>
|
||||||
|
int test_inverse_perf(std::size_t Instance, char const * Message)
|
Loading…
Reference in new issue