diff options
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/Makefile.am | 2 | ||||
-rw-r--r-- | src/glsl/builtin_compiler/Makefile.am | 1 | ||||
-rw-r--r-- | src/glsl/ir_constant_expression.cpp | 21 |
3 files changed, 4 insertions, 20 deletions
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am index 058d8aed38d..d0e5cd1d05e 100644 --- a/src/glsl/Makefile.am +++ b/src/glsl/Makefile.am @@ -52,6 +52,7 @@ check_PROGRAMS = \ tests_uniform_initializer_test_SOURCES = \ $(top_srcdir)/src/mesa/main/hash_table.c \ + $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c\ $(top_srcdir)/src/mesa/program/symbol_table.c \ tests/copy_constant_to_storage_tests.cpp \ @@ -100,6 +101,7 @@ endif glsl_test_SOURCES = \ $(top_srcdir)/src/mesa/main/hash_table.c \ + $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c \ $(top_srcdir)/src/mesa/program/symbol_table.c \ $(GLSL_SRCDIR)/standalone_scaffolding.cpp \ diff --git a/src/glsl/builtin_compiler/Makefile.am b/src/glsl/builtin_compiler/Makefile.am index 1a863b228df..976640822d8 100644 --- a/src/glsl/builtin_compiler/Makefile.am +++ b/src/glsl/builtin_compiler/Makefile.am @@ -55,6 +55,7 @@ libglslcore_la_SOURCES = \ builtin_compiler_SOURCES = \ $(top_srcdir)/src/mesa/main/hash_table.c \ + $(top_srcdir)/src/mesa/main/imports.c \ $(top_srcdir)/src/mesa/program/prog_hash_table.c\ $(top_srcdir)/src/mesa/program/symbol_table.c \ $(BUILTIN_COMPILER_CXX_FILES) \ diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 17b54b923a4..76780909a43 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -40,25 +40,6 @@ #include "glsl_types.h" #include "program/hash_table.h" -/* Using C99 rounding functions for roundToEven() implementation is - * difficult, because round(), rint, and nearbyint() are affected by - * fesetenv(), which the application may have done for its own - * purposes. Mesa's IROUND macro is close to what we want, but it - * rounds away from 0 on n + 0.5. - */ -static int -round_to_even(float val) -{ - int rounded = IROUND(val); - - if (val - floor(val) == 0.5) { - if (rounded % 2 != 0) - rounded += val > 0 ? -1 : 1; - } - - return rounded; -} - static float dot(ir_constant *op0, ir_constant *op1) { @@ -279,7 +260,7 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) case ir_unop_round_even: assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); for (unsigned c = 0; c < op[0]->type->components(); c++) { - data.f[c] = round_to_even(op[0]->value.f[c]); + data.f[c] = _mesa_round_to_even(op[0]->value.f[c]); } break; |