Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.3KB

  1. /// @ref core
  2. /// @file glm/detail/qualifier.hpp
  3. #pragma once
  4. #include "setup.hpp"
  5. namespace glm
  6. {
  7. /// Qualify GLM types in term of alignment (packed, aligned) and precision in term of ULPs (lowp, mediump, highp)
  8. enum qualifier
  9. {
  10. packed_highp, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs
  11. packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance
  12. packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance
  13. # if GLM_HAS_ALIGNED_TYPE
  14. aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs
  15. aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance
  16. aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance
  17. aligned = aligned_highp, ///< By default aligned qualifier is also high precision
  18. # endif
  19. highp = packed_highp, ///< By default highp qualifier is also packed
  20. mediump = packed_mediump, ///< By default mediump qualifier is also packed
  21. lowp = packed_lowp, ///< By default lowp qualifier is also packed
  22. packed = packed_highp, ///< By default packed qualifier is also high precision
  23. # if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED)
  24. defaultp = aligned_highp
  25. # else
  26. defaultp = highp
  27. # endif
  28. };
  29. typedef qualifier precision;
  30. template<length_t L, typename T, qualifier Q = defaultp> struct vec;
  31. template<length_t C, length_t R, typename T, qualifier Q = defaultp> struct mat;
  32. namespace detail
  33. {
  34. template<glm::qualifier P>
  35. struct is_aligned
  36. {
  37. static const bool value = false;
  38. };
  39. # if GLM_HAS_ALIGNED_TYPE
  40. template<>
  41. struct is_aligned<glm::aligned_lowp>
  42. {
  43. static const bool value = true;
  44. };
  45. template<>
  46. struct is_aligned<glm::aligned_mediump>
  47. {
  48. static const bool value = true;
  49. };
  50. template<>
  51. struct is_aligned<glm::aligned_highp>
  52. {
  53. static const bool value = true;
  54. };
  55. # endif
  56. }//namespace detail
  57. }//namespace glm