1 /// @ref core 2 /// @file glm/detail/type_vec.hpp 3 4 #pragma once 5 6 #include "precision.hpp" 7 #include "type_int.hpp" 8 9 namespace glm{ 10 namespace detail 11 { 12 template <typename T, std::size_t size, bool aligned> 13 struct storage 14 { 15 typedef struct type { 16 uint8 data[size]; 17 } type; 18 }; 19 20 #define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \ 21 template <typename T> \ 22 struct storage<T, x, true> { \ 23 GLM_ALIGNED_STRUCT(x) type { \ 24 uint8 data[x]; \ 25 }; \ 26 }; 27 28 GLM_ALIGNED_STORAGE_TYPE_STRUCT(1) 29 GLM_ALIGNED_STORAGE_TYPE_STRUCT(2) 30 GLM_ALIGNED_STORAGE_TYPE_STRUCT(4) 31 GLM_ALIGNED_STORAGE_TYPE_STRUCT(8) 32 GLM_ALIGNED_STORAGE_TYPE_STRUCT(16) 33 GLM_ALIGNED_STORAGE_TYPE_STRUCT(32) 34 GLM_ALIGNED_STORAGE_TYPE_STRUCT(64) 35 36 # if GLM_ARCH & GLM_ARCH_SSE2_BIT 37 template <> 38 struct storage<float, 16, true> 39 { 40 typedef glm_vec4 type; 41 }; 42 43 template <> 44 struct storage<int, 16, true> 45 { 46 typedef glm_ivec4 type; 47 }; 48 49 template <> 50 struct storage<unsigned int, 16, true> 51 { 52 typedef glm_uvec4 type; 53 }; 54 /* 55 # else 56 typedef union __declspec(align(16)) glm_128 57 { 58 unsigned __int8 data[16]; 59 } glm_128; 60 61 template <> 62 struct storage<float, 16, true> 63 { 64 typedef glm_128 type; 65 }; 66 67 template <> 68 struct storage<int, 16, true> 69 { 70 typedef glm_128 type; 71 }; 72 73 template <> 74 struct storage<unsigned int, 16, true> 75 { 76 typedef glm_128 type; 77 }; 78 */ 79 # endif 80 81 # if (GLM_ARCH & GLM_ARCH_AVX_BIT) 82 template <> 83 struct storage<double, 32, true> 84 { 85 typedef glm_dvec4 type; 86 }; 87 # endif 88 89 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) 90 template <> 91 struct storage<int64, 32, true> 92 { 93 typedef glm_i64vec4 type; 94 }; 95 96 template <> 97 struct storage<uint64, 32, true> 98 { 99 typedef glm_u64vec4 type; 100 }; 101 # endif 102 }//namespace detail 103 104 template <typename T, precision P> struct tvec1; 105 template <typename T, precision P> struct tvec2; 106 template <typename T, precision P> struct tvec3; 107 template <typename T, precision P> struct tvec4; 108 109 typedef tvec1<float, highp> highp_vec1_t; 110 typedef tvec1<float, mediump> mediump_vec1_t; 111 typedef tvec1<float, lowp> lowp_vec1_t; 112 typedef tvec1<double, highp> highp_dvec1_t; 113 typedef tvec1<double, mediump> mediump_dvec1_t; 114 typedef tvec1<double, lowp> lowp_dvec1_t; 115 typedef tvec1<int, highp> highp_ivec1_t; 116 typedef tvec1<int, mediump> mediump_ivec1_t; 117 typedef tvec1<int, lowp> lowp_ivec1_t; 118 typedef tvec1<uint, highp> highp_uvec1_t; 119 typedef tvec1<uint, mediump> mediump_uvec1_t; 120 typedef tvec1<uint, lowp> lowp_uvec1_t; 121 typedef tvec1<bool, highp> highp_bvec1_t; 122 typedef tvec1<bool, mediump> mediump_bvec1_t; 123 typedef tvec1<bool, lowp> lowp_bvec1_t; 124 125 /// @addtogroup core_precision 126 /// @{ 127 128 /// 2 components vector of high single-precision floating-point numbers. 129 /// There is no guarantee on the actual precision. 130 /// 131 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 132 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 133 typedef tvec2<float, highp> highp_vec2; 134 135 /// 2 components vector of medium single-precision floating-point numbers. 136 /// There is no guarantee on the actual precision. 137 /// 138 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 139 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 140 typedef tvec2<float, mediump> mediump_vec2; 141 142 /// 2 components vector of low single-precision floating-point numbers. 143 /// There is no guarantee on the actual precision. 144 /// 145 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 146 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 147 typedef tvec2<float, lowp> lowp_vec2; 148 149 /// 2 components vector of high double-precision floating-point numbers. 150 /// There is no guarantee on the actual precision. 151 /// 152 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 153 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 154 typedef tvec2<double, highp> highp_dvec2; 155 156 /// 2 components vector of medium double-precision floating-point numbers. 157 /// There is no guarantee on the actual precision. 158 /// 159 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 160 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 161 typedef tvec2<double, mediump> mediump_dvec2; 162 163 /// 2 components vector of low double-precision floating-point numbers. 164 /// There is no guarantee on the actual precision. 165 /// 166 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 167 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 168 typedef tvec2<double, lowp> lowp_dvec2; 169 170 /// 2 components vector of high precision signed integer numbers. 171 /// There is no guarantee on the actual precision. 172 /// 173 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 174 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 175 typedef tvec2<int, highp> highp_ivec2; 176 177 /// 2 components vector of medium precision signed integer numbers. 178 /// There is no guarantee on the actual precision. 179 /// 180 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 181 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 182 typedef tvec2<int, mediump> mediump_ivec2; 183 184 /// 2 components vector of low precision signed integer numbers. 185 /// There is no guarantee on the actual precision. 186 /// 187 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 188 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 189 typedef tvec2<int, lowp> lowp_ivec2; 190 191 /// 2 components vector of high precision unsigned integer numbers. 192 /// There is no guarantee on the actual precision. 193 /// 194 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 195 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 196 typedef tvec2<uint, highp> highp_uvec2; 197 198 /// 2 components vector of medium precision unsigned integer numbers. 199 /// There is no guarantee on the actual precision. 200 /// 201 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 202 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 203 typedef tvec2<uint, mediump> mediump_uvec2; 204 205 /// 2 components vector of low precision unsigned integer numbers. 206 /// There is no guarantee on the actual precision. 207 /// 208 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 209 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 210 typedef tvec2<uint, lowp> lowp_uvec2; 211 212 /// 2 components vector of high precision bool numbers. 213 /// There is no guarantee on the actual precision. 214 /// 215 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 216 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 217 typedef tvec2<bool, highp> highp_bvec2; 218 219 /// 2 components vector of medium precision bool numbers. 220 /// There is no guarantee on the actual precision. 221 /// 222 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 223 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 224 typedef tvec2<bool, mediump> mediump_bvec2; 225 226 /// 2 components vector of low precision bool numbers. 227 /// There is no guarantee on the actual precision. 228 /// 229 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 230 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 231 typedef tvec2<bool, lowp> lowp_bvec2; 232 233 /// @} 234 235 /// @addtogroup core_precision 236 /// @{ 237 238 /// 3 components vector of high single-precision floating-point numbers. 239 /// There is no guarantee on the actual precision. 240 /// 241 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 242 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 243 typedef tvec3<float, highp> highp_vec3; 244 245 /// 3 components vector of medium single-precision floating-point numbers. 246 /// There is no guarantee on the actual precision. 247 /// 248 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 249 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 250 typedef tvec3<float, mediump> mediump_vec3; 251 252 /// 3 components vector of low single-precision floating-point numbers. 253 /// There is no guarantee on the actual precision. 254 /// 255 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 256 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 257 typedef tvec3<float, lowp> lowp_vec3; 258 259 /// 3 components vector of high double-precision floating-point numbers. 260 /// There is no guarantee on the actual precision. 261 /// 262 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 263 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 264 typedef tvec3<double, highp> highp_dvec3; 265 266 /// 3 components vector of medium double-precision floating-point numbers. 267 /// There is no guarantee on the actual precision. 268 /// 269 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 270 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 271 typedef tvec3<double, mediump> mediump_dvec3; 272 273 /// 3 components vector of low double-precision floating-point numbers. 274 /// There is no guarantee on the actual precision. 275 /// 276 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 277 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 278 typedef tvec3<double, lowp> lowp_dvec3; 279 280 /// 3 components vector of high precision signed integer numbers. 281 /// There is no guarantee on the actual precision. 282 /// 283 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 284 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 285 typedef tvec3<int, highp> highp_ivec3; 286 287 /// 3 components vector of medium precision signed integer numbers. 288 /// There is no guarantee on the actual precision. 289 /// 290 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 291 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 292 typedef tvec3<int, mediump> mediump_ivec3; 293 294 /// 3 components vector of low precision signed integer numbers. 295 /// There is no guarantee on the actual precision. 296 /// 297 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 298 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 299 typedef tvec3<int, lowp> lowp_ivec3; 300 301 /// 3 components vector of high precision unsigned integer numbers. 302 /// There is no guarantee on the actual precision. 303 /// 304 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 305 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 306 typedef tvec3<uint, highp> highp_uvec3; 307 308 /// 3 components vector of medium precision unsigned integer numbers. 309 /// There is no guarantee on the actual precision. 310 /// 311 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 312 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 313 typedef tvec3<uint, mediump> mediump_uvec3; 314 315 /// 3 components vector of low precision unsigned integer numbers. 316 /// There is no guarantee on the actual precision. 317 /// 318 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 319 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 320 typedef tvec3<uint, lowp> lowp_uvec3; 321 322 /// 3 components vector of high precision bool numbers. 323 /// 324 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 325 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 326 typedef tvec3<bool, highp> highp_bvec3; 327 328 /// 3 components vector of medium precision bool numbers. 329 /// 330 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 331 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 332 typedef tvec3<bool, mediump> mediump_bvec3; 333 334 /// 3 components vector of low precision bool numbers. 335 /// 336 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 337 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 338 typedef tvec3<bool, lowp> lowp_bvec3; 339 340 /// @} 341 342 /// @addtogroup core_precision 343 /// @{ 344 345 /// 4 components vector of high single-precision floating-point numbers. 346 /// 347 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 348 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 349 typedef tvec4<float, highp> highp_vec4; 350 351 /// 4 components vector of medium single-precision floating-point numbers. 352 /// 353 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 354 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 355 typedef tvec4<float, mediump> mediump_vec4; 356 357 /// 4 components vector of low single-precision floating-point numbers. 358 /// 359 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 360 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 361 typedef tvec4<float, lowp> lowp_vec4; 362 363 /// 4 components vector of high double-precision floating-point numbers. 364 /// 365 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 366 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 367 typedef tvec4<double, highp> highp_dvec4; 368 369 /// 4 components vector of medium double-precision floating-point numbers. 370 /// 371 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 372 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 373 typedef tvec4<double, mediump> mediump_dvec4; 374 375 /// 4 components vector of low double-precision floating-point numbers. 376 /// 377 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 378 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 379 typedef tvec4<double, lowp> lowp_dvec4; 380 381 /// 4 components vector of high precision signed integer numbers. 382 /// 383 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 384 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 385 typedef tvec4<int, highp> highp_ivec4; 386 387 /// 4 components vector of medium precision signed integer numbers. 388 /// 389 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 390 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 391 typedef tvec4<int, mediump> mediump_ivec4; 392 393 /// 4 components vector of low precision signed integer numbers. 394 /// 395 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 396 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 397 typedef tvec4<int, lowp> lowp_ivec4; 398 399 /// 4 components vector of high precision unsigned integer numbers. 400 /// 401 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 402 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 403 typedef tvec4<uint, highp> highp_uvec4; 404 405 /// 4 components vector of medium precision unsigned integer numbers. 406 /// 407 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 408 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 409 typedef tvec4<uint, mediump> mediump_uvec4; 410 411 /// 4 components vector of low precision unsigned integer numbers. 412 /// 413 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 414 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 415 typedef tvec4<uint, lowp> lowp_uvec4; 416 417 /// 4 components vector of high precision bool numbers. 418 /// 419 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 420 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 421 typedef tvec4<bool, highp> highp_bvec4; 422 423 /// 4 components vector of medium precision bool numbers. 424 /// 425 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 426 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 427 typedef tvec4<bool, mediump> mediump_bvec4; 428 429 /// 4 components vector of low precision bool numbers. 430 /// 431 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 432 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 433 typedef tvec4<bool, lowp> lowp_bvec4; 434 435 /// @} 436 437 /// @addtogroup core_types 438 /// @{ 439 440 // -- Default float definition -- 441 442 #if(defined(GLM_PRECISION_LOWP_FLOAT)) 443 typedef lowp_vec2 vec2; 444 typedef lowp_vec3 vec3; 445 typedef lowp_vec4 vec4; 446 #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) 447 typedef mediump_vec2 vec2; 448 typedef mediump_vec3 vec3; 449 typedef mediump_vec4 vec4; 450 #else //defined(GLM_PRECISION_HIGHP_FLOAT) 451 /// 2 components vector of floating-point numbers. 452 /// 453 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 454 typedef highp_vec2 vec2; 455 456 //! 3 components vector of floating-point numbers. 457 /// 458 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 459 typedef highp_vec3 vec3; 460 461 //! 4 components vector of floating-point numbers. 462 /// 463 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 464 typedef highp_vec4 vec4; 465 #endif//GLM_PRECISION 466 467 // -- Default double definition -- 468 469 #if(defined(GLM_PRECISION_LOWP_DOUBLE)) 470 typedef lowp_dvec2 dvec2; 471 typedef lowp_dvec3 dvec3; 472 typedef lowp_dvec4 dvec4; 473 #elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) 474 typedef mediump_dvec2 dvec2; 475 typedef mediump_dvec3 dvec3; 476 typedef mediump_dvec4 dvec4; 477 #else //defined(GLM_PRECISION_HIGHP_DOUBLE) 478 /// 2 components vector of double-precision floating-point numbers. 479 /// 480 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 481 typedef highp_dvec2 dvec2; 482 483 //! 3 components vector of double-precision floating-point numbers. 484 /// 485 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 486 typedef highp_dvec3 dvec3; 487 488 //! 4 components vector of double-precision floating-point numbers. 489 /// 490 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 491 typedef highp_dvec4 dvec4; 492 #endif//GLM_PRECISION 493 494 // -- Signed integer definition -- 495 496 #if(defined(GLM_PRECISION_LOWP_INT)) 497 typedef lowp_ivec2 ivec2; 498 typedef lowp_ivec3 ivec3; 499 typedef lowp_ivec4 ivec4; 500 #elif(defined(GLM_PRECISION_MEDIUMP_INT)) 501 typedef mediump_ivec2 ivec2; 502 typedef mediump_ivec3 ivec3; 503 typedef mediump_ivec4 ivec4; 504 #else //defined(GLM_PRECISION_HIGHP_INT) 505 /// 2 components vector of signed integer numbers. 506 /// 507 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 508 typedef highp_ivec2 ivec2; 509 510 /// 3 components vector of signed integer numbers. 511 /// 512 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 513 typedef highp_ivec3 ivec3; 514 515 /// 4 components vector of signed integer numbers. 516 /// 517 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 518 typedef highp_ivec4 ivec4; 519 #endif//GLM_PRECISION 520 521 // -- Unsigned integer definition -- 522 523 #if(defined(GLM_PRECISION_LOWP_UINT)) 524 typedef lowp_uvec2 uvec2; 525 typedef lowp_uvec3 uvec3; 526 typedef lowp_uvec4 uvec4; 527 #elif(defined(GLM_PRECISION_MEDIUMP_UINT)) 528 typedef mediump_uvec2 uvec2; 529 typedef mediump_uvec3 uvec3; 530 typedef mediump_uvec4 uvec4; 531 #else //defined(GLM_PRECISION_HIGHP_UINT) 532 /// 2 components vector of unsigned integer numbers. 533 /// 534 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 535 typedef highp_uvec2 uvec2; 536 537 /// 3 components vector of unsigned integer numbers. 538 /// 539 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 540 typedef highp_uvec3 uvec3; 541 542 /// 4 components vector of unsigned integer numbers. 543 /// 544 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 545 typedef highp_uvec4 uvec4; 546 #endif//GLM_PRECISION 547 548 // -- Boolean definition -- 549 550 #if(defined(GLM_PRECISION_LOWP_BOOL)) 551 typedef lowp_bvec2 bvec2; 552 typedef lowp_bvec3 bvec3; 553 typedef lowp_bvec4 bvec4; 554 #elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) 555 typedef mediump_bvec2 bvec2; 556 typedef mediump_bvec3 bvec3; 557 typedef mediump_bvec4 bvec4; 558 #else //defined(GLM_PRECISION_HIGHP_BOOL) 559 /// 2 components vector of boolean. 560 /// 561 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 562 typedef highp_bvec2 bvec2; 563 564 /// 3 components vector of boolean. 565 /// 566 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 567 typedef highp_bvec3 bvec3; 568 569 /// 4 components vector of boolean. 570 /// 571 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> 572 typedef highp_bvec4 bvec4; 573 #endif//GLM_PRECISION 574 575 /// @} 576 }//namespace glm 577