mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 19:34:36 +00:00
Fixed build
This commit is contained in:
parent
5aa2dfd465
commit
2908ddfbaa
@ -515,29 +515,29 @@ namespace glm
|
|||||||
///
|
///
|
||||||
/// @see gtc_packing
|
/// @see gtc_packing
|
||||||
/// @see vecType<L, floatType, P> unpackUnorm(vecType<L, intType, P> const & p);
|
/// @see vecType<L, floatType, P> unpackUnorm(vecType<L, intType, P> const & p);
|
||||||
template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename uintType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_DECL vecType<L, uintType, P> packUnorm(vecType<L, floatType, P> const & v);
|
GLM_FUNC_DECL vec<L, uintType, P> packUnorm(vec<L, floatType, P> const & v);
|
||||||
|
|
||||||
/// Convert each unsigned integer components of a vector to normalized floating-point values.
|
/// Convert each unsigned integer components of a vector to normalized floating-point values.
|
||||||
///
|
///
|
||||||
/// @see gtc_packing
|
/// @see gtc_packing
|
||||||
/// @see vecType<L, intType, P> packUnorm(vecType<L, floatType, P> const & v)
|
/// @see vecType<L, intType, P> packUnorm(vecType<L, floatType, P> const & v)
|
||||||
template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename uintType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_DECL vecType<L, floatType, P> unpackUnorm(vecType<L, uintType, P> const & v);
|
GLM_FUNC_DECL vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const & v);
|
||||||
|
|
||||||
/// Convert each component of the normalized floating-point vector into signed integer values.
|
/// Convert each component of the normalized floating-point vector into signed integer values.
|
||||||
///
|
///
|
||||||
/// @see gtc_packing
|
/// @see gtc_packing
|
||||||
/// @see vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & p);
|
/// @see vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & p);
|
||||||
template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename intType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_DECL vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v);
|
GLM_FUNC_DECL vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v);
|
||||||
|
|
||||||
/// Convert each signed integer components of a vector to normalized floating-point values.
|
/// Convert each signed integer components of a vector to normalized floating-point values.
|
||||||
///
|
///
|
||||||
/// @see gtc_packing
|
/// @see gtc_packing
|
||||||
/// @see vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v)
|
/// @see vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v)
|
||||||
template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename intType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_DECL vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & v);
|
GLM_FUNC_DECL vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v);
|
||||||
|
|
||||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||||
///
|
///
|
||||||
|
@ -667,40 +667,40 @@ namespace detail
|
|||||||
return detail::compute_half<L, P, vecType>::unpack(v);
|
return detail::compute_half<L, P, vecType>::unpack(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename uintType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_QUALIFIER vecType<L, uintType, P> packUnorm(vecType<L, floatType, P> const & v)
|
GLM_FUNC_QUALIFIER vec<L, uintType, P> packUnorm(vec<L, floatType, P> const& v)
|
||||||
{
|
{
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||||
|
|
||||||
return vecType<L, uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
|
return vec<L, uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename uintType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_QUALIFIER vecType<L, floatType, P> unpackUnorm(vecType<L, uintType, P> const & v)
|
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const& v)
|
||||||
{
|
{
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||||
|
|
||||||
return vecType<L, float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
|
return vec<L, float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename intType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_QUALIFIER vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v)
|
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v)
|
||||||
{
|
{
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||||
|
|
||||||
return vecType<L, intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
|
return vec<L, intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
|
template<typename intType, length_t L, typename floatType, precision P>
|
||||||
GLM_FUNC_QUALIFIER vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & v)
|
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v)
|
||||||
{
|
{
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||||
|
|
||||||
return clamp(vecType<L, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
|
return clamp(vec<L, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v)
|
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v)
|
||||||
|
118
test/external/gli/core/convert_func.hpp
vendored
118
test/external/gli/core/convert_func.hpp
vendored
@ -162,12 +162,12 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, vecType<D, T, P> > access;
|
typedef accessFunc<textureType, vecType<D, T, P> > access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
return make_vec4<retType, P>(vecType<D, retType, P>(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return make_vec4<retType, P>(vecType<D, retType, P>(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, vecType<D, T, P>(Texel));
|
access::store(Texture, TexelCoord, Layer, Face, Level, vecType<D, T, P>(Texel));
|
||||||
}
|
}
|
||||||
@ -176,12 +176,12 @@ namespace detail
|
|||||||
template <typename textureType, typename retType, int D, typename T, precision P, template <int, typename, precision> class vecType, bool isSamplerFloat>
|
template <typename textureType, typename retType, int D, typename T, precision P, template <int, typename, precision> class vecType, bool isSamplerFloat>
|
||||||
struct convertFunc<textureType, retType, D, T, P, vecType, CONVERT_MODE_DEFAULT, isSamplerFloat>
|
struct convertFunc<textureType, retType, D, T, P, vecType, CONVERT_MODE_DEFAULT, isSamplerFloat>
|
||||||
{
|
{
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
return tvec4<retType, P>(0, 0, 0, 1);
|
return vec<4, retType, P>(0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -190,13 +190,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, vecType<D, T, P> > access;
|
typedef accessFunc<textureType, vecType<D, T, P> > access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_NORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_NORM requires a float sampler");
|
||||||
return make_vec4<retType, P>(compNormalize<retType>(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return make_vec4<retType, P>(compNormalize<retType>(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_NORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_NORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, compScale<T>(vecType<D, retType, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, compScale<T>(vecType<D, retType, P>(Texel)));
|
||||||
@ -208,13 +208,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, vecType<D, T, P> > access;
|
typedef accessFunc<textureType, vecType<D, T, P> > access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_SRGB requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_SRGB requires a float sampler");
|
||||||
return make_vec4<retType, P>(convertSRGBToLinear(compNormalize<retType>(access::load(Texture, TexelCoord, Layer, Face, Level))));
|
return make_vec4<retType, P>(convertSRGBToLinear(compNormalize<retType>(access::load(Texture, TexelCoord, Layer, Face, Level))));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_SRGB requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_SRGB requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, gli::compScale<T>(convertLinearToSRGB(vecType<D, retType, P>(Texel))));
|
access::store(Texture, TexelCoord, Layer, Face, Level, gli::compScale<T>(convertLinearToSRGB(vecType<D, retType, P>(Texel))));
|
||||||
@ -226,13 +226,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB9E5 requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB9E5 requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackF3x9_E1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
return vec<4, retType, P>(unpackF3x9_E1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB9E5 requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB9E5 requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packF3x9_E1x5(tvec3<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packF3x9_E1x5(tvec3<float, P>(Texel)));
|
||||||
@ -244,13 +244,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RG11B10F requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RG11B10F requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackF2x11_1x10(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
return vec<4, retType, P>(unpackF2x11_1x10(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RG11B10F requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RG11B10F requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packF2x11_1x10(tvec3<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packF2x11_1x10(tvec3<float, P>(Texel)));
|
||||||
@ -262,13 +262,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, vecType<D, uint16, P> > access;
|
typedef accessFunc<textureType, vecType<D, uint16, P> > access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_HALF requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_HALF requires a float sampler");
|
||||||
return make_vec4<retType, P>(vecType<D, retType, P>(unpackHalf(access::load(Texture, TexelCoord, Layer, Face, Level))));
|
return make_vec4<retType, P>(vecType<D, retType, P>(unpackHalf(access::load(Texture, TexelCoord, Layer, Face, Level))));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_HALF requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_HALF requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packHalf(vecType<D, float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packHalf(vecType<D, float, P>(Texel)));
|
||||||
@ -280,16 +280,16 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint8> access;
|
typedef accessFunc<textureType, uint8> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_44UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_44UNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(tvec2<retType, P>(unpackUnorm2x4(access::load(Texture, TexelCoord, Layer, Face, Level))), static_cast<retType>(0), static_cast<retType>(1));
|
return vec<4, retType, P>(vec<2, retType, P>(unpackUnorm2x4(access::load(Texture, TexelCoord, Layer, Face, Level))), static_cast<retType>(0), static_cast<retType>(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_44UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_44UNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x4(tvec2<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x4(vec<2, float, P>(Texel)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -298,16 +298,16 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint16> access;
|
typedef accessFunc<textureType, uint16> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_4444UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_4444UNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackUnorm4x4(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return vec<4, retType, P>(unpackUnorm4x4(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_4444UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_4444UNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm4x4(tvec4<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm4x4(vec<4, float, P>(Texel)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -316,16 +316,16 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint16> access;
|
typedef accessFunc<textureType, uint16> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_565UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_565UNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackUnorm1x5_1x6_1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
return vec<4, retType, P>(unpackUnorm1x5_1x6_1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_565UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_565UNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm1x5_1x6_1x5(tvec3<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm1x5_1x6_1x5(vec<3, float, P>(Texel)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -334,16 +334,16 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint16> access;
|
typedef accessFunc<textureType, uint16> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_5551UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_5551UNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackUnorm3x5_1x1(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return vec<4, retType, P>(unpackUnorm3x5_1x1(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_5551UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_5551UNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x5_1x1(tvec4<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x5_1x1(vec<4, float, P>(Texel)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -352,16 +352,16 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint8> access;
|
typedef accessFunc<textureType, uint8> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_332UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_332UNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackUnorm2x3_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
return vec<4, retType, P>(unpackUnorm2x3_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast<retType>(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_332UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_332UNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x3_1x2(tvec3<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x3_1x2(vec<3, float, P>(Texel)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -370,16 +370,16 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2UNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackUnorm3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return vec<4, retType, P>(unpackUnorm3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2UNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2UNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x10_1x2(tvec4<float, P>(Texel)));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x10_1x2(vec<4, float, P>(Texel)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -388,13 +388,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SNORM requires a float sampler");
|
||||||
return tvec4<retType, P>(unpackSnorm3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return vec<4, retType, P>(unpackSnorm3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SNORM requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SNORM requires a float sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packSnorm3x10_1x2(Texel));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packSnorm3x10_1x2(Texel));
|
||||||
@ -406,15 +406,15 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2USCALE requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2USCALE requires a float sampler");
|
||||||
glm::detail::u10u10u10u2 Unpack;
|
glm::detail::u10u10u10u2 Unpack;
|
||||||
Unpack.pack = access::load(Texture, TexelCoord, Layer, Face, Level);
|
Unpack.pack = access::load(Texture, TexelCoord, Layer, Face, Level);
|
||||||
return tvec4<retType, P>(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w);
|
return vec<4, retType, P>(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2USCALE requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2USCALE requires a float sampler");
|
||||||
glm::detail::u10u10u10u2 Unpack;
|
glm::detail::u10u10u10u2 Unpack;
|
||||||
@ -431,15 +431,15 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SSCALE requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SSCALE requires a float sampler");
|
||||||
glm::detail::i10i10i10i2 Unpack;
|
glm::detail::i10i10i10i2 Unpack;
|
||||||
Unpack.pack = access::load(Texture, TexelCoord, Layer, Face, Level);
|
Unpack.pack = access::load(Texture, TexelCoord, Layer, Face, Level);
|
||||||
return tvec4<retType, P>(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w);
|
return vec<4, retType, P>(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SSCALE requires a float sampler");
|
static_assert(std::numeric_limits<retType>::is_iec559, "CONVERT_MODE_RGB10A2SSCALE requires a float sampler");
|
||||||
glm::detail::i10i10i10i2 Unpack;
|
glm::detail::i10i10i10i2 Unpack;
|
||||||
@ -456,13 +456,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2UINT requires an integer sampler");
|
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2UINT requires an integer sampler");
|
||||||
return tvec4<retType, P>(unpackU3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return vec<4, retType, P>(unpackU3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2UINT requires an integer sampler");
|
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2UINT requires an integer sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packU3x10_1x2(Texel));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packU3x10_1x2(Texel));
|
||||||
@ -474,13 +474,13 @@ namespace detail
|
|||||||
{
|
{
|
||||||
typedef accessFunc<textureType, uint32> access;
|
typedef accessFunc<textureType, uint32> access;
|
||||||
|
|
||||||
static tvec4<retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, retType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2SINT requires an integer sampler");
|
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2SINT requires an integer sampler");
|
||||||
return tvec4<retType, P>(unpackI3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
return vec<4, retType, P>(unpackI3x10_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<retType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, retType, P> const & Texel)
|
||||||
{
|
{
|
||||||
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2SINT requires an integer sampler");
|
static_assert(std::numeric_limits<retType>::is_integer, "CONVERT_MODE_RGB10A2SINT requires an integer sampler");
|
||||||
access::store(Texture, TexelCoord, Layer, Face, Level, packI3x10_1x2(Texel));
|
access::store(Texture, TexelCoord, Layer, Face, Level, packI3x10_1x2(Texel));
|
||||||
@ -491,17 +491,17 @@ namespace detail
|
|||||||
struct convert
|
struct convert
|
||||||
{
|
{
|
||||||
typedef glm::tvec4<samplerValType, P>(*fetchFunc)(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level);
|
typedef glm::tvec4<samplerValType, P>(*fetchFunc)(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level);
|
||||||
typedef void(*writeFunc)(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, glm::tvec4<samplerValType, P> const & Texel);
|
typedef void(*writeFunc)(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, samplerValType, P> const & Texel);
|
||||||
|
|
||||||
template <int D, typename T, template <int, typename, precision> class vecType, convertMode mode>
|
template <int D, typename T, template <int, typename, precision> class vecType, convertMode mode>
|
||||||
struct conv
|
struct conv
|
||||||
{
|
{
|
||||||
static tvec4<samplerValType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
static vec<4, samplerValType, P> fetch(textureType const & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level)
|
||||||
{
|
{
|
||||||
return convertFunc<textureType, samplerValType, D, T, P, vecType, mode, std::numeric_limits<samplerValType>::is_iec559>::fetch(Texture, TexelCoord, Layer, Face, Level);
|
return convertFunc<textureType, samplerValType, D, T, P, vecType, mode, std::numeric_limits<samplerValType>::is_iec559>::fetch(Texture, TexelCoord, Layer, Face, Level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, tvec4<samplerValType, P> const & Texel)
|
static void write(textureType & Texture, typename textureType::extent_type const & TexelCoord, typename textureType::size_type Layer, typename textureType::size_type Face, typename textureType::size_type Level, vec<4, samplerValType, P> const & Texel)
|
||||||
{
|
{
|
||||||
convertFunc<textureType, samplerValType, D, T, P, vecType, mode, std::numeric_limits<samplerValType>::is_iec559>::write(Texture, TexelCoord, Layer, Face, Level, Texel);
|
convertFunc<textureType, samplerValType, D, T, P, vecType, mode, std::numeric_limits<samplerValType>::is_iec559>::write(Texture, TexelCoord, Layer, Face, Level, Texel);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user