From 2908ddfbaac4431f80a67ebd1492f5bb0379539e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 1 Jan 2017 01:13:53 +0100 Subject: [PATCH] Fixed build --- glm/gtc/packing.hpp | 16 ++-- glm/gtc/packing.inl | 24 ++--- test/external/gli/core/convert_func.hpp | 118 ++++++++++++------------ 3 files changed, 79 insertions(+), 79 deletions(-) diff --git a/glm/gtc/packing.hpp b/glm/gtc/packing.hpp index 3240c71a..e2263674 100644 --- a/glm/gtc/packing.hpp +++ b/glm/gtc/packing.hpp @@ -515,29 +515,29 @@ namespace glm /// /// @see gtc_packing /// @see vecType unpackUnorm(vecType const & p); - template class vecType> - GLM_FUNC_DECL vecType packUnorm(vecType const & v); + template + GLM_FUNC_DECL vec packUnorm(vec const & v); /// Convert each unsigned integer components of a vector to normalized floating-point values. /// /// @see gtc_packing /// @see vecType packUnorm(vecType const & v) - template class vecType> - GLM_FUNC_DECL vecType unpackUnorm(vecType const & v); + template + GLM_FUNC_DECL vec unpackUnorm(vec const & v); /// Convert each component of the normalized floating-point vector into signed integer values. /// /// @see gtc_packing /// @see vecType unpackSnorm(vecType const & p); - template class vecType> - GLM_FUNC_DECL vecType packSnorm(vecType const & v); + template + GLM_FUNC_DECL vec packSnorm(vec const & v); /// Convert each signed integer components of a vector to normalized floating-point values. /// /// @see gtc_packing /// @see vecType packSnorm(vecType const & v) - template class vecType> - GLM_FUNC_DECL vecType unpackSnorm(vecType const & v); + template + GLM_FUNC_DECL vec unpackSnorm(vec const & v); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index fb3766f9..62341859 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -667,40 +667,40 @@ namespace detail return detail::compute_half::unpack(v); } - template class vecType> - GLM_FUNC_QUALIFIER vecType packUnorm(vecType const & v) + template + GLM_FUNC_QUALIFIER vec packUnorm(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vecType(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); + return vec(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); } - template class vecType> - GLM_FUNC_QUALIFIER vecType unpackUnorm(vecType const & v) + template + GLM_FUNC_QUALIFIER vec unpackUnorm(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vecType(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); + return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); } - template class vecType> - GLM_FUNC_QUALIFIER vecType packSnorm(vecType const & v) + template + GLM_FUNC_QUALIFIER vec packSnorm(vec const & v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vecType(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); + return vec(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); } - template class vecType> - GLM_FUNC_QUALIFIER vecType unpackSnorm(vecType const & v) + template + GLM_FUNC_QUALIFIER vec unpackSnorm(vec const & v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return clamp(vecType(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); + return clamp(vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); } GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v) diff --git a/test/external/gli/core/convert_func.hpp b/test/external/gli/core/convert_func.hpp index 5c8519e0..3a642639 100644 --- a/test/external/gli/core/convert_func.hpp +++ b/test/external/gli/core/convert_func.hpp @@ -162,12 +162,12 @@ namespace detail { typedef accessFunc > access; - static tvec4 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(vecType(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 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(Texel)); } @@ -176,12 +176,12 @@ namespace detail template class vecType, bool isSamplerFloat> struct convertFunc { - static tvec4 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(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 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 > access; - static tvec4 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::is_iec559, "CONVERT_MODE_NORM requires a float sampler"); return make_vec4(compNormalize(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 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::is_iec559, "CONVERT_MODE_NORM requires a float sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, compScale(vecType(Texel))); @@ -208,13 +208,13 @@ namespace detail { typedef accessFunc > access; - static tvec4 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::is_iec559, "CONVERT_MODE_SRGB requires a float sampler"); return make_vec4(convertSRGBToLinear(compNormalize(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 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::is_iec559, "CONVERT_MODE_SRGB requires a float sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, gli::compScale(convertLinearToSRGB(vecType(Texel)))); @@ -226,13 +226,13 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_RGB9E5 requires a float sampler"); - return tvec4(unpackF3x9_E1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(1)); + return vec<4, retType, P>(unpackF3x9_E1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(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 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::is_iec559, "CONVERT_MODE_RGB9E5 requires a float sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, packF3x9_E1x5(tvec3(Texel))); @@ -244,13 +244,13 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_RG11B10F requires a float sampler"); - return tvec4(unpackF2x11_1x10(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(1)); + return vec<4, retType, P>(unpackF2x11_1x10(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(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 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::is_iec559, "CONVERT_MODE_RG11B10F requires a float sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, packF2x11_1x10(tvec3(Texel))); @@ -262,13 +262,13 @@ namespace detail { typedef accessFunc > access; - static tvec4 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::is_iec559, "CONVERT_MODE_HALF requires a float sampler"); return make_vec4(vecType(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 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::is_iec559, "CONVERT_MODE_HALF requires a float sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, packHalf(vecType(Texel))); @@ -280,16 +280,16 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_44UNORM requires a float sampler"); - return tvec4(tvec2(unpackUnorm2x4(access::load(Texture, TexelCoord, Layer, Face, Level))), static_cast(0), static_cast(1)); + return vec<4, retType, P>(vec<2, retType, P>(unpackUnorm2x4(access::load(Texture, TexelCoord, Layer, Face, Level))), static_cast(0), static_cast(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 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::is_iec559, "CONVERT_MODE_44UNORM requires a float sampler"); - access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x4(tvec2(Texel))); + access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x4(vec<2, float, P>(Texel))); } }; @@ -298,16 +298,16 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_4444UNORM requires a float sampler"); - return tvec4(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 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::is_iec559, "CONVERT_MODE_4444UNORM requires a float sampler"); - access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm4x4(tvec4(Texel))); + access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm4x4(vec<4, float, P>(Texel))); } }; @@ -316,16 +316,16 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_565UNORM requires a float sampler"); - return tvec4(unpackUnorm1x5_1x6_1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(1)); + return vec<4, retType, P>(unpackUnorm1x5_1x6_1x5(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(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 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::is_iec559, "CONVERT_MODE_565UNORM requires a float sampler"); - access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm1x5_1x6_1x5(tvec3(Texel))); + access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm1x5_1x6_1x5(vec<3, float, P>(Texel))); } }; @@ -334,16 +334,16 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_5551UNORM requires a float sampler"); - return tvec4(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 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::is_iec559, "CONVERT_MODE_5551UNORM requires a float sampler"); - access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x5_1x1(tvec4(Texel))); + access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x5_1x1(vec<4, float, P>(Texel))); } }; @@ -352,16 +352,16 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_332UNORM requires a float sampler"); - return tvec4(unpackUnorm2x3_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(1)); + return vec<4, retType, P>(unpackUnorm2x3_1x2(access::load(Texture, TexelCoord, Layer, Face, Level)), static_cast(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 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::is_iec559, "CONVERT_MODE_332UNORM requires a float sampler"); - access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x3_1x2(tvec3(Texel))); + access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm2x3_1x2(vec<3, float, P>(Texel))); } }; @@ -370,16 +370,16 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_RGB10A2UNORM requires a float sampler"); - return tvec4(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 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::is_iec559, "CONVERT_MODE_RGB10A2UNORM requires a float sampler"); - access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x10_1x2(tvec4(Texel))); + access::store(Texture, TexelCoord, Layer, Face, Level, packUnorm3x10_1x2(vec<4, float, P>(Texel))); } }; @@ -388,13 +388,13 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_RGB10A2SNORM requires a float sampler"); - return tvec4(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 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::is_iec559, "CONVERT_MODE_RGB10A2SNORM requires a float sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, packSnorm3x10_1x2(Texel)); @@ -406,15 +406,15 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_RGB10A2USCALE requires a float sampler"); glm::detail::u10u10u10u2 Unpack; Unpack.pack = access::load(Texture, TexelCoord, Layer, Face, Level); - return tvec4(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 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::is_iec559, "CONVERT_MODE_RGB10A2USCALE requires a float sampler"); glm::detail::u10u10u10u2 Unpack; @@ -431,15 +431,15 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_iec559, "CONVERT_MODE_RGB10A2SSCALE requires a float sampler"); glm::detail::i10i10i10i2 Unpack; Unpack.pack = access::load(Texture, TexelCoord, Layer, Face, Level); - return tvec4(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 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::is_iec559, "CONVERT_MODE_RGB10A2SSCALE requires a float sampler"); glm::detail::i10i10i10i2 Unpack; @@ -456,13 +456,13 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_integer, "CONVERT_MODE_RGB10A2UINT requires an integer sampler"); - return tvec4(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 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::is_integer, "CONVERT_MODE_RGB10A2UINT requires an integer sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, packU3x10_1x2(Texel)); @@ -474,13 +474,13 @@ namespace detail { typedef accessFunc access; - static tvec4 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::is_integer, "CONVERT_MODE_RGB10A2SINT requires an integer sampler"); - return tvec4(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 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::is_integer, "CONVERT_MODE_RGB10A2SINT requires an integer sampler"); access::store(Texture, TexelCoord, Layer, Face, Level, packI3x10_1x2(Texel)); @@ -491,17 +491,17 @@ namespace detail struct convert { typedef glm::tvec4(*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 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 class vecType, convertMode mode> struct conv { - static tvec4 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::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 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::is_iec559>::write(Texture, TexelCoord, Layer, Face, Level, Texel); }