diff options
author | marha <marha@users.sourceforge.net> | 2015-03-22 14:10:47 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-03-22 14:10:47 +0100 |
commit | 3bc24b271f45f9f33484b8cf53b44f33f7e8a237 (patch) | |
tree | 193651a94adb3804e800747e993d07b92688e4d4 /mesalib/src/glsl/nir/nir_constant_expressions.py | |
parent | c646056120fe14e4c4ccf81bac5d78d61225a8e8 (diff) | |
parent | 82c8df11062f72a7d467e26cedbbd8b322ff7a70 (diff) | |
download | vcxsrv-3bc24b271f45f9f33484b8cf53b44f33f7e8a237.tar.gz vcxsrv-3bc24b271f45f9f33484b8cf53b44f33f7e8a237.tar.bz2 vcxsrv-3bc24b271f45f9f33484b8cf53b44f33f7e8a237.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mapi/glapi/glapi.h
mesalib/src/mapi/glapi/glapi_nop.c
mesalib/src/mesa/main/bufferobj.c
Diffstat (limited to 'mesalib/src/glsl/nir/nir_constant_expressions.py')
-rw-r--r-- | mesalib/src/glsl/nir/nir_constant_expressions.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/mesalib/src/glsl/nir/nir_constant_expressions.py b/mesalib/src/glsl/nir/nir_constant_expressions.py index 22bc4f095..bf82fe533 100644 --- a/mesalib/src/glsl/nir/nir_constant_expressions.py +++ b/mesalib/src/glsl/nir/nir_constant_expressions.py @@ -28,6 +28,7 @@ template = """\ #include <math.h> #include "main/core.h" +#include "util/rounding.h" /* for _mesa_roundeven */ #include "nir_constant_expressions.h" #if defined(_MSC_VER) && (_MSC_VER < 1800) @@ -68,8 +69,8 @@ pack_snorm_1x8(float x) * We must first cast the float to an int, because casting a negative * float to a uint is undefined. */ - return (uint8_t) (int8_t) - _mesa_round_to_even(CLAMP(x, -1.0f, +1.0f) * 127.0f); + return (uint8_t) (int) + _mesa_roundevenf(CLAMP(x, -1.0f, +1.0f) * 127.0f); } /** @@ -90,8 +91,8 @@ pack_snorm_1x16(float x) * We must first cast the float to an int, because casting a negative * float to a uint is undefined. */ - return (uint16_t) (int16_t) - _mesa_round_to_even(CLAMP(x, -1.0f, +1.0f) * 32767.0f); + return (uint16_t) (int) + _mesa_roundevenf(CLAMP(x, -1.0f, +1.0f) * 32767.0f); } /** @@ -145,7 +146,8 @@ pack_unorm_1x8(float x) * * packUnorm4x8: round(clamp(c, 0, +1) * 255.0) */ - return (uint8_t) _mesa_round_to_even(CLAMP(x, 0.0f, 1.0f) * 255.0f); + return (uint8_t) (int) + _mesa_roundevenf(CLAMP(x, 0.0f, 1.0f) * 255.0f); } /** @@ -163,7 +165,8 @@ pack_unorm_1x16(float x) * * packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) */ - return (uint16_t) _mesa_round_to_even(CLAMP(x, 0.0f, 1.0f) * 65535.0f); + return (uint16_t) (int) + _mesa_roundevenf(CLAMP(x, 0.0f, 1.0f) * 65535.0f); } /** |