Completed EXT_*_integer extensions
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#include <glm/ext/scalar_ulp.hpp>
|
||||
|
||||
#define GLM_ENABLE_EXPERIMENTAL
|
||||
#include <glm/gtc/type_precision.hpp>
|
||||
#include <glm/gtx/fast_trigonometry.hpp>
|
||||
#include <glm/gtx/integer.hpp>
|
||||
#include <glm/gtx/common.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
#include <glm/gtc/ulp.hpp>
|
||||
#include <glm/gtc/vec1.hpp>
|
||||
#include <glm/trigonometric.hpp>
|
||||
#include <cmath>
|
||||
@@ -21,11 +22,11 @@ namespace fastCos
|
||||
float result = 0.f;
|
||||
|
||||
const std::clock_t timestamp1 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::fastCos(i);
|
||||
|
||||
const std::clock_t timestamp2 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::cos(i);
|
||||
|
||||
const std::clock_t timestamp3 = std::clock();
|
||||
@@ -55,11 +56,11 @@ namespace fastSin
|
||||
float result = 0.f;
|
||||
|
||||
const std::clock_t timestamp1 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::fastSin(i);
|
||||
|
||||
const std::clock_t timestamp2 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::sin(i);
|
||||
|
||||
const std::clock_t timestamp3 = std::clock();
|
||||
@@ -81,11 +82,11 @@ namespace fastTan
|
||||
float result = 0.f;
|
||||
|
||||
const std::clock_t timestamp1 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::fastTan(i);
|
||||
|
||||
const std::clock_t timestamp2 = std::clock();
|
||||
for (float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for (float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::tan(i);
|
||||
|
||||
const std::clock_t timestamp3 = std::clock();
|
||||
@@ -107,11 +108,11 @@ namespace fastAcos
|
||||
float result = 0.f;
|
||||
|
||||
const std::clock_t timestamp1 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::fastAcos(i);
|
||||
|
||||
const std::clock_t timestamp2 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::acos(i);
|
||||
|
||||
const std::clock_t timestamp3 = std::clock();
|
||||
@@ -133,10 +134,10 @@ namespace fastAsin
|
||||
const float end = glm::pi<float>();
|
||||
float result = 0.f;
|
||||
const std::clock_t timestamp1 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::fastAsin(i);
|
||||
const std::clock_t timestamp2 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::asin(i);
|
||||
const std::clock_t timestamp3 = std::clock();
|
||||
const std::clock_t time_fast = timestamp2 - timestamp1;
|
||||
@@ -156,10 +157,10 @@ namespace fastAtan
|
||||
const float end = glm::pi<float>();
|
||||
float result = 0.f;
|
||||
const std::clock_t timestamp1 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::fastAtan(i);
|
||||
const std::clock_t timestamp2 = std::clock();
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::next_float(i) : i += 0.1f)
|
||||
for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
|
||||
result = glm::atan(i);
|
||||
const std::clock_t timestamp3 = std::clock();
|
||||
const std::clock_t time_fast = timestamp2 - timestamp1;
|
||||
|
||||
Reference in New Issue
Block a user