core_setup_precision.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #define GLM_FORCE_INLINE
  2. #define GLM_PRECISION_HIGHP_FLOAT
  3. #include <glm/glm.hpp>
  4. #include <glm/ext.hpp>
  5. static int test_mat()
  6. {
  7. int Error = 0;
  8. Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1;
  9. Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1;
  10. Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1;
  11. Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1;
  12. Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1;
  13. Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1;
  14. Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1;
  15. Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1;
  16. Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1;
  17. Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1;
  18. Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1;
  19. Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1;
  20. return Error;
  21. }
  22. static int test_vec()
  23. {
  24. int Error = 0;
  25. Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1;
  26. Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1;
  27. Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1;
  28. return Error;
  29. }
  30. static int test_dvec()
  31. {
  32. int Error = 0;
  33. Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1;
  34. Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1;
  35. Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1;
  36. return Error;
  37. }
  38. int main()
  39. {
  40. int Error = 0;
  41. Error += test_mat();
  42. Error += test_vec();
  43. Error += test_dvec();
  44. return Error;
  45. }