Mesa (master): glsl: Use INFINITY instead of std::numeric_limits<float>:: infinity().
Matt Turner
mattst88 at kemper.freedesktop.org
Wed Mar 25 22:07:17 UTC 2015
Module: Mesa
Branch: master
Commit: 871f1080d0f7b7444458de40b67de7938c220922
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=871f1080d0f7b7444458de40b67de7938c220922
Author: Matt Turner <mattst88 at gmail.com>
Date: Mon Jan 12 22:35:53 2015 -0800
glsl: Use INFINITY instead of std::numeric_limits<float>::infinity().
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
---
src/glsl/builtin_functions.cpp | 4 ++--
src/glsl/s_expression.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index c607572..524b8d6 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -60,7 +60,7 @@
#include "ir_builder.h"
#include "glsl_parser_extras.h"
#include "program/prog_instruction.h"
-#include <limits>
+#include <math.h>
#define M_PIf ((float) M_PI)
#define M_PI_2f ((float) M_PI_2)
@@ -3215,7 +3215,7 @@ builtin_builder::_isinf(builtin_available_predicate avail, const glsl_type *type
ir_constant_data infinities;
for (int i = 0; i < type->vector_elements; i++) {
- infinities.f[i] = std::numeric_limits<float>::infinity();
+ infinities.f[i] = INFINITY;
}
body.emit(ret(equal(abs(x), imm(type, infinities))));
diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
index 7eaa491..f82e155 100644
--- a/src/glsl/s_expression.cpp
+++ b/src/glsl/s_expression.cpp
@@ -23,8 +23,8 @@
*/
#include <assert.h>
-#include <limits>
#include <stdio.h>
+#include <math.h>
#include "s_expression.h"
s_symbol::s_symbol(const char *str, size_t n)
@@ -70,7 +70,7 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer)
// requires strtof to parse '+INF' as +Infinity, but we still support some
// non-C99-compliant compilers (e.g. MSVC).
if (n == 4 && strncmp(src, "+INF", 4) == 0) {
- expr = new(ctx) s_float(std::numeric_limits<float>::infinity());
+ expr = new(ctx) s_float(INFINITY);
} else {
// Check if the atom is a number.
char *float_end = NULL;
More information about the mesa-commit
mailing list