type_vec.hpp
Go to the documentation of this file.
#pragma once
#include "qualifier.hpp"
#include "type_int.hpp"
#include "compute_vector_relational.hpp"
namespace glm{
namespace detail
{
template<typename T, std::size_t size, bool aligned>
struct storage
{
typedef struct type {
uint8 data[size];
} type;
};
#define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \
template<typename T> \
struct storage<T, x, true> { \
GLM_ALIGNED_STRUCT(x) type { \
uint8 data[x]; \
}; \
};
GLM_ALIGNED_STORAGE_TYPE_STRUCT(1)
GLM_ALIGNED_STORAGE_TYPE_STRUCT(2)
GLM_ALIGNED_STORAGE_TYPE_STRUCT(4)
GLM_ALIGNED_STORAGE_TYPE_STRUCT(8)
GLM_ALIGNED_STORAGE_TYPE_STRUCT(16)
GLM_ALIGNED_STORAGE_TYPE_STRUCT(32)
GLM_ALIGNED_STORAGE_TYPE_STRUCT(64)
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
template<>
struct storage<float, 16, true>
{
typedef glm_vec4 type;
};
template<>
struct storage<int, 16, true>
{
typedef glm_ivec4 type;
};
template<>
struct storage<unsigned int, 16, true>
{
typedef glm_uvec4 type;
};
/*
# else
typedef union __declspec(align(16)) glm_128
{
unsigned __int8 data[16];
} glm_128;
template<>
struct storage<float, 16, true>
{
typedef glm_128 type;
};
template<>
struct storage<int, 16, true>
{
typedef glm_128 type;
};
template<>
struct storage<unsigned int, 16, true>
{
typedef glm_128 type;
};
*/
# endif
# if (GLM_ARCH & GLM_ARCH_AVX_BIT)
template<>
struct storage<double, 32, true>
{
typedef glm_dvec4 type;
};
# endif
# if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
template<>
struct storage<int64, 32, true>
{
typedef glm_i64vec4 type;
};
template<>
struct storage<uint64, 32, true>
{
typedef glm_u64vec4 type;
};
# endif
}//namespace detail
#if GLM_HAS_TEMPLATE_ALIASES
template <typename T, qualifier Q = defaultp> using tvec1 = vec<1, T, Q>;
template <typename T, qualifier Q = defaultp> using tvec2 = vec<2, T, Q>;
template <typename T, qualifier Q = defaultp> using tvec3 = vec<3, T, Q>;
template <typename T, qualifier Q = defaultp> using tvec4 = vec<4, T, Q>;
#endif//GLM_HAS_TEMPLATE_ALIASES
typedef vec<1, float, highp> highp_vec1_t;
typedef vec<1, float, mediump> mediump_vec1_t;
typedef vec<1, float, lowp> lowp_vec1_t;
typedef vec<1, double, highp> highp_dvec1_t;
typedef vec<1, double, mediump> mediump_dvec1_t;
typedef vec<1, double, lowp> lowp_dvec1_t;
typedef vec<1, int, highp> highp_ivec1_t;
typedef vec<1, int, mediump> mediump_ivec1_t;
typedef vec<1, int, lowp> lowp_ivec1_t;
typedef vec<1, uint, highp> highp_uvec1_t;
typedef vec<1, uint, mediump> mediump_uvec1_t;
typedef vec<1, uint, lowp> lowp_uvec1_t;
typedef vec<1, bool, highp> highp_bvec1_t;
typedef vec<1, bool, mediump> mediump_bvec1_t;
typedef vec<1, bool, lowp> lowp_bvec1_t;
typedef vec<2, float, highp> highp_vec2;
typedef vec<2, float, mediump> mediump_vec2;
typedef vec<2, float, lowp> lowp_vec2;
typedef vec<2, double, highp> highp_dvec2;
typedef vec<2, double, mediump> mediump_dvec2;
typedef vec<2, double, lowp> lowp_dvec2;
typedef vec<2, int, highp> highp_ivec2;
typedef vec<2, int, mediump> mediump_ivec2;
typedef vec<2, int, lowp> lowp_ivec2;
typedef vec<2, uint, highp> highp_uvec2;
typedef vec<2, uint, mediump> mediump_uvec2;
typedef vec<2, uint, lowp> lowp_uvec2;
typedef vec<2, bool, highp> highp_bvec2;
typedef vec<2, bool, mediump> mediump_bvec2;
typedef vec<2, bool, lowp> lowp_bvec2;
typedef vec<3, float, highp> highp_vec3;
typedef vec<3, float, mediump> mediump_vec3;
typedef vec<3, float, lowp> lowp_vec3;
typedef vec<3, double, highp> highp_dvec3;
typedef vec<3, double, mediump> mediump_dvec3;
typedef vec<3, double, lowp> lowp_dvec3;
typedef vec<3, int, highp> highp_ivec3;
typedef vec<3, int, mediump> mediump_ivec3;
typedef vec<3, int, lowp> lowp_ivec3;
typedef vec<3, uint, highp> highp_uvec3;
typedef vec<3, uint, mediump> mediump_uvec3;
typedef vec<3, uint, lowp> lowp_uvec3;
typedef vec<3, bool, highp> highp_bvec3;
typedef vec<3, bool, mediump> mediump_bvec3;
typedef vec<3, bool, lowp> lowp_bvec3;
typedef vec<4, float, highp> highp_vec4;
typedef vec<4, float, mediump> mediump_vec4;
typedef vec<4, float, lowp> lowp_vec4;
typedef vec<4, double, highp> highp_dvec4;
typedef vec<4, double, mediump> mediump_dvec4;
typedef vec<4, double, lowp> lowp_dvec4;
typedef vec<4, int, highp> highp_ivec4;
typedef vec<4, int, mediump> mediump_ivec4;
typedef vec<4, int, lowp> lowp_ivec4;
typedef vec<4, uint, highp> highp_uvec4;
typedef vec<4, uint, mediump> mediump_uvec4;
typedef vec<4, uint, lowp> lowp_uvec4;
typedef vec<4, bool, highp> highp_bvec4;
typedef vec<4, bool, mediump> mediump_bvec4;
typedef vec<4, bool, lowp> lowp_bvec4;
// -- Default float definition --
#if(defined(GLM_PRECISION_LOWP_FLOAT))
typedef lowp_vec2 vec2;
typedef lowp_vec3 vec3;
typedef lowp_vec4 vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
typedef mediump_vec2 vec2;
typedef mediump_vec3 vec3;
typedef mediump_vec4 vec4;
#else //defined(GLM_PRECISION_HIGHP_FLOAT)
typedef highp_vec2 vec2;
typedef highp_vec3 vec3;
typedef highp_vec4 vec4;
#endif//GLM_PRECISION
// -- Default double definition --
#if(defined(GLM_PRECISION_LOWP_DOUBLE))
typedef lowp_dvec2 dvec2;
typedef lowp_dvec3 dvec3;
typedef lowp_dvec4 dvec4;
#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
typedef mediump_dvec2 dvec2;
typedef mediump_dvec3 dvec3;
typedef mediump_dvec4 dvec4;
#else //defined(GLM_PRECISION_HIGHP_DOUBLE)
typedef highp_dvec2 dvec2;
typedef highp_dvec3 dvec3;
typedef highp_dvec4 dvec4;
#endif//GLM_PRECISION
// -- Signed integer definition --
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_ivec2 ivec2;
typedef lowp_ivec3 ivec3;
typedef lowp_ivec4 ivec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_ivec2 ivec2;
typedef mediump_ivec3 ivec3;
typedef mediump_ivec4 ivec4;
#else //defined(GLM_PRECISION_HIGHP_INT)
typedef highp_ivec2 ivec2;
typedef highp_ivec3 ivec3;
typedef highp_ivec4 ivec4;
#endif//GLM_PRECISION
// -- Unsigned integer definition --
#if(defined(GLM_PRECISION_LOWP_UINT))
typedef lowp_uvec2 uvec2;
typedef lowp_uvec3 uvec3;
typedef lowp_uvec4 uvec4;
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
typedef mediump_uvec2 uvec2;
typedef mediump_uvec3 uvec3;
typedef mediump_uvec4 uvec4;
#else //defined(GLM_PRECISION_HIGHP_UINT)
typedef highp_uvec2 uvec2;
typedef highp_uvec3 uvec3;
typedef highp_uvec4 uvec4;
#endif//GLM_PRECISION
// -- Boolean definition --
#if(defined(GLM_PRECISION_LOWP_BOOL))
typedef lowp_bvec2 bvec2;
typedef lowp_bvec3 bvec3;
typedef lowp_bvec4 bvec4;
#elif(defined(GLM_PRECISION_MEDIUMP_BOOL))
typedef mediump_bvec2 bvec2;
typedef mediump_bvec3 bvec3;
typedef mediump_bvec4 bvec4;
#else //defined(GLM_PRECISION_HIGHP_BOOL)
typedef highp_bvec2 bvec2;
typedef highp_bvec3 bvec3;
typedef highp_bvec4 bvec4;
#endif//GLM_PRECISION
}//namespace glm
glm::highp_ivec3
vec< 3, int, highp > highp_ivec3
3 components vector of high qualifier signed integer numbers.
Definition: type_vec.hpp:288
glm::ivec4
highp_ivec4 ivec4
4 components vector of signed integer numbers.
Definition: type_vec.hpp:521
glm::lowp_dvec4
vec< 4, double, lowp > lowp_dvec4
4 components vector of low double-qualifier floating-point numbers.
Definition: type_vec.hpp:382
glm::mediump_vec4
vec< 4, float, mediump > mediump_vec4
4 components vector of medium single-qualifier floating-point numbers.
Definition: type_vec.hpp:358
glm::lowp_ivec4
vec< 4, int, lowp > lowp_ivec4
4 components vector of low qualifier signed integer numbers.
Definition: type_vec.hpp:400
glm::ivec3
highp_ivec3 ivec3
3 components vector of signed integer numbers.
Definition: type_vec.hpp:516
glm::bvec4
highp_bvec4 bvec4
4 components vector of boolean.
Definition: type_vec.hpp:575
glm::lowp_bvec4
vec< 4, bool, lowp > lowp_bvec4
4 components vector of low qualifier bool numbers.
Definition: type_vec.hpp:436
glm::mediump_ivec4
vec< 4, int, mediump > mediump_ivec4
4 components vector of medium qualifier signed integer numbers.
Definition: type_vec.hpp:394
glm::highp_uvec2
vec< 2, uint, highp > highp_uvec2
2 components vector of high qualifier unsigned integer numbers.
Definition: type_vec.hpp:199
glm::lowp_uvec3
vec< 3, uint, lowp > lowp_uvec3
3 components vector of low qualifier unsigned integer numbers.
Definition: type_vec.hpp:323
glm::highp_uvec3
vec< 3, uint, highp > highp_uvec3
3 components vector of high qualifier unsigned integer numbers.
Definition: type_vec.hpp:309
glm::lowp_dvec3
vec< 3, double, lowp > lowp_dvec3
3 components vector of low double-qualifier floating-point numbers.
Definition: type_vec.hpp:281
glm::vec2
highp_vec2 vec2
2 components vector of floating-point numbers.
Definition: type_vec.hpp:457
glm::highp_bvec2
vec< 2, bool, highp > highp_bvec2
2 components vector of high qualifier bool numbers.
Definition: type_vec.hpp:220
glm
Definition: common.hpp:20
glm::mediump_bvec3
vec< 3, bool, mediump > mediump_bvec3
3 components vector of medium qualifier bool numbers.
Definition: type_vec.hpp:335
glm::highp_ivec4
vec< 4, int, highp > highp_ivec4
4 components vector of high qualifier signed integer numbers.
Definition: type_vec.hpp:388
glm::highp_vec4
vec< 4, float, highp > highp_vec4
4 components vector of high single-qualifier floating-point numbers.
Definition: type_vec.hpp:352
glm::highp_bvec4
vec< 4, bool, highp > highp_bvec4
4 components vector of high qualifier bool numbers.
Definition: type_vec.hpp:424
glm::lowp_ivec3
vec< 3, int, lowp > lowp_ivec3
3 components vector of low qualifier signed integer numbers.
Definition: type_vec.hpp:302
glm::lowp_uvec2
vec< 2, uint, lowp > lowp_uvec2
2 components vector of low qualifier unsigned integer numbers.
Definition: type_vec.hpp:213
glm::mediump_dvec3
vec< 3, double, mediump > mediump_dvec3
3 components vector of medium double-qualifier floating-point numbers.
Definition: type_vec.hpp:274
glm::lowp_dvec2
vec< 2, double, lowp > lowp_dvec2
2 components vector of low double-qualifier floating-point numbers.
Definition: type_vec.hpp:171
qualifier.hpp
Core features
glm::lowp_ivec2
vec< 2, int, lowp > lowp_ivec2
2 components vector of low qualifier signed integer numbers.
Definition: type_vec.hpp:192
type_int.hpp
Core features
glm::highp_dvec2
vec< 2, double, highp > highp_dvec2
2 components vector of high double-qualifier floating-point numbers.
Definition: type_vec.hpp:157
glm::mediump_bvec4
vec< 4, bool, mediump > mediump_bvec4
4 components vector of medium qualifier bool numbers.
Definition: type_vec.hpp:430
glm::vec4
highp_vec4 vec4
4 components vector of floating-point numbers.
Definition: type_vec.hpp:467
glm::highp_dvec3
vec< 3, double, highp > highp_dvec3
3 components vector of high double-qualifier floating-point numbers.
Definition: type_vec.hpp:267
glm::mediump_bvec2
vec< 2, bool, mediump > mediump_bvec2
2 components vector of medium qualifier bool numbers.
Definition: type_vec.hpp:227
glm::lowp_vec2
vec< 2, float, lowp > lowp_vec2
2 components vector of low single-qualifier floating-point numbers.
Definition: type_vec.hpp:150
glm::lowp_vec3
vec< 3, float, lowp > lowp_vec3
3 components vector of low single-qualifier floating-point numbers.
Definition: type_vec.hpp:260
glm::lowp_bvec2
vec< 2, bool, lowp > lowp_bvec2
2 components vector of low qualifier bool numbers.
Definition: type_vec.hpp:234
glm::dvec3
highp_dvec3 dvec3
3 components vector of double-qualifier floating-point numbers.
Definition: type_vec.hpp:489
glm::highp_dvec4
vec< 4, double, highp > highp_dvec4
4 components vector of high double-qualifier floating-point numbers.
Definition: type_vec.hpp:370
glm::mediump_dvec2
vec< 2, double, mediump > mediump_dvec2
2 components vector of medium double-qualifier floating-point numbers.
Definition: type_vec.hpp:164
glm::mediump_ivec3
vec< 3, int, mediump > mediump_ivec3
3 components vector of medium qualifier signed integer numbers.
Definition: type_vec.hpp:295
glm::highp_vec3
vec< 3, float, highp > highp_vec3
3 components vector of high single-qualifier floating-point numbers.
Definition: type_vec.hpp:246
glm::highp_uvec4
vec< 4, uint, highp > highp_uvec4
4 components vector of high qualifier unsigned integer numbers.
Definition: type_vec.hpp:406
glm::uvec3
highp_uvec3 uvec3
3 components vector of unsigned integer numbers.
Definition: type_vec.hpp:543
glm::mediump_vec2
vec< 2, float, mediump > mediump_vec2
2 components vector of medium single-qualifier floating-point numbers.
Definition: type_vec.hpp:143
glm::vec3
highp_vec3 vec3
3 components vector of floating-point numbers.
Definition: type_vec.hpp:462
glm::dvec2
highp_dvec2 dvec2
2 components vector of double-qualifier floating-point numbers.
Definition: type_vec.hpp:484
glm::lowp_vec4
vec< 4, float, lowp > lowp_vec4
4 components vector of low single-qualifier floating-point numbers.
Definition: type_vec.hpp:364
glm::bvec2
highp_bvec2 bvec2
2 components vector of boolean.
Definition: type_vec.hpp:565
glm::mediump_vec3
vec< 3, float, mediump > mediump_vec3
3 components vector of medium single-qualifier floating-point numbers.
Definition: type_vec.hpp:253
glm::mediump_ivec2
vec< 2, int, mediump > mediump_ivec2
2 components vector of medium qualifier signed integer numbers.
Definition: type_vec.hpp:185
glm::uvec4
highp_uvec4 uvec4
4 components vector of unsigned integer numbers.
Definition: type_vec.hpp:548
glm::mediump_dvec4
vec< 4, double, mediump > mediump_dvec4
4 components vector of medium double-qualifier floating-point numbers.
Definition: type_vec.hpp:376
glm::uvec2
highp_uvec2 uvec2
2 components vector of unsigned integer numbers.
Definition: type_vec.hpp:538
glm::mediump_uvec3
vec< 3, uint, mediump > mediump_uvec3
3 components vector of medium qualifier unsigned integer numbers.
Definition: type_vec.hpp:316
glm::highp_bvec3
vec< 3, bool, highp > highp_bvec3
3 components vector of high qualifier bool numbers.
Definition: type_vec.hpp:329
glm::dvec4
highp_dvec4 dvec4
4 components vector of double-qualifier floating-point numbers.
Definition: type_vec.hpp:494
glm::lowp_uvec4
vec< 4, uint, lowp > lowp_uvec4
4 components vector of low qualifier unsigned integer numbers.
Definition: type_vec.hpp:418
glm::lowp_bvec3
vec< 3, bool, lowp > lowp_bvec3
3 components vector of low qualifier bool numbers.
Definition: type_vec.hpp:341
glm::highp_vec2
vec< 2, float, highp > highp_vec2
2 components vector of high single-qualifier floating-point numbers.
Definition: type_vec.hpp:136
glm::mediump_uvec4
vec< 4, uint, mediump > mediump_uvec4
4 components vector of medium qualifier unsigned integer numbers.
Definition: type_vec.hpp:412
glm::bvec3
highp_bvec3 bvec3
3 components vector of boolean.
Definition: type_vec.hpp:570
glm::highp_ivec2
vec< 2, int, highp > highp_ivec2
2 components vector of high qualifier signed integer numbers.
Definition: type_vec.hpp:178
glm::mediump_uvec2
vec< 2, uint, mediump > mediump_uvec2
2 components vector of medium qualifier unsigned integer numbers.
Definition: type_vec.hpp:206
glm::ivec2
highp_ivec2 ivec2
2 components vector of signed integer numbers.
Definition: type_vec.hpp:511