Added missing documentation, missing 4x16 half packing functions, added initial tests

This commit is contained in:
Christophe Riccio
2013-08-26 08:28:17 +02:00
parent fb13e7bf8a
commit 0abec19bc1
3 changed files with 113 additions and 1 deletions

View File

@@ -342,6 +342,16 @@ namespace glm
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
/// @see ivec4 unpackI3x10_1x2(uint32 const & p)
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const & v);
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
/// @see gtc_packing
/// @see uint32 packU3x10_1x2(uvec4 const & v)
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
/// @see uvec4 unpackI3x10_1x2(uint32 const & p);
GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 const & p);
/// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector
@@ -356,6 +366,16 @@ namespace glm
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
/// @see ivec4 unpackU3x10_1x2(uint32 const & p)
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const & v);
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
/// @see gtc_packing
/// @see uint32 packU3x10_1x2(uvec4 const & v)
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
/// @see uvec4 unpackI3x10_1x2(uint32 const & p);
GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 const & p);
/// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values.

View File

@@ -438,6 +438,20 @@ namespace detail
return detail::toFloat32(Packing.data);
}
GLM_FUNC_DECL uint64 packHalf4x16(float const & v)
{
detail::half4x16 Packing;
Packing.data = detail::toFloat16(v);
return Packing.pack;
}
GLM_FUNC_DECL float unpackHalf4x16(uint64 const & v)
{
detail::half4x16 Packing;
Packing.pack = v;
return detail::toFloat32(Packing.data);
}
GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const & v)
{
detail::i10i10i10i2 Result;