From: Brian Paul Date: Mon, 10 May 2010 01:25:52 +0000 (-0600) Subject: mesa: added UNCLAMPED_FLOAT_TO_SHORT macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6274bb865fcb00bdb888f4388f7a6de825f14723;p=mesa.git mesa: added UNCLAMPED_FLOAT_TO_SHORT macro --- diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index a8624574de4..40e17e53d6c 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -127,6 +127,9 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; #define CLAMPED_FLOAT_TO_USHORT(us, f) \ us = ( (GLushort) IROUND( (f) * 65535.0F) ) +#define UNCLAMPED_FLOAT_TO_SHORT(s, f) \ + s = ( (GLshort) IROUND( CLAMP((f), -1.0F, 1.0F) * 32767.0F) ) + /*@}*/