<div dir="ltr"><div><div><br></div>I don't remember the specifics, but I recall some of the old conformance tests being sensitive to float->int conversion in a few areas.  Matt, if you have access to the conform tests and can run the old swrast driver with your change, that'd be interesting.<br><br></div>-Brian<br><br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 31, 2015 at 7:52 PM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have some doubts of this. Given that IROUND was just plain incorrect,<br>
I think we should just use _mesa_lroundevenf() and see what happens.<br>
lroundf() is quite the shocker, my libm's implementation is totalling 40<br>
instructions (!) for it (not counting the last return, vs 1 for lrintf).<br>
Now it's probably not THAT bad (not all these 40 instructions will be<br>
executed), it still looks expensive (and gcc won't attempt to use a<br>
built-in for that mess, quite understandable).<br>
I don't see GL mentioning requiring such explicit rounding in general<br>
(though for instance the EXT_texture_shared_exponent does this<br>
implicitly, albeit I'm wondering if that was by choice or accident...).<br>
Different tie breaker (which we'd get with lrintf) sounds like a win<br>
over just bogus rounding (which we got before) any day to me.<br>
<span class="HOEnZb"><font color="#888888"><br>
Roland<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
Am 01.08.2015 um 01:26 schrieb Matt Turner:<br>
> lroundf is the most common replacement. I replaced uses of IROUND()<br>
> where there was a comment saying "rounded to nearest integer" with<br>
> _mesa_lroundevenf.<br>
><br>
> IROUND64 is replaced with llroundf.<br>
> ---<br>
>  src/mesa/main/drawpix.c         | 21 +++++++++++----------<br>
>  src/mesa/main/eval.c            | 14 +++++++-------<br>
>  src/mesa/main/get.c             | 28 ++++++++++++++--------------<br>
>  src/mesa/main/imports.h         | 18 ------------------<br>
>  src/mesa/main/light.c           |  8 ++++----<br>
>  src/mesa/main/pixel.c           |  2 +-<br>
>  src/mesa/main/pixelstore.c      |  3 ++-<br>
>  src/mesa/main/samplerobj.c      |  8 ++++----<br>
>  src/mesa/main/texparam.c        |  8 ++++----<br>
>  src/mesa/main/uniform_query.cpp |  2 +-<br>
>  src/mesa/swrast/s_blit.c        |  2 +-<br>
>  src/mesa/swrast/s_context.h     |  2 +-<br>
>  12 files changed, 50 insertions(+), 66 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c<br>
> index 720a082..025cf7e 100644<br>
> --- a/src/mesa/main/drawpix.c<br>
> +++ b/src/mesa/main/drawpix.c<br>
> @@ -22,6 +22,7 @@<br>
>   * OTHER DEALINGS IN THE SOFTWARE.<br>
>   */<br>
><br>
> +#include "c99_math.h"<br>
>  #include "glheader.h"<br>
>  #include "imports.h"<br>
>  #include "bufferobj.h"<br>
> @@ -51,14 +52,14 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,<br>
>     FLUSH_VERTICES(ctx, 0);<br>
><br>
>     if (MESA_VERBOSE & VERBOSE_API)<br>
> -      _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n",<br>
> +      _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %ld, %ld\n",<br>
>                    width, height,<br>
>                    _mesa_enum_to_string(format),<br>
>                    _mesa_enum_to_string(type),<br>
>                    pixels,<br>
>                    _mesa_enum_to_string(ctx->DrawBuffer->ColorDrawBuffer[0]),<br>
> -                  IROUND(ctx->Current.RasterPos[0]),<br>
> -                  IROUND(ctx->Current.RasterPos[1]));<br>
> +                  lroundf(ctx->Current.RasterPos[0]),<br>
> +                  lroundf(ctx->Current.RasterPos[1]));<br>
><br>
><br>
>     if (width < 0 || height < 0) {<br>
> @@ -140,8 +141,8 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,<br>
>     if (ctx->RenderMode == GL_RENDER) {<br>
>        if (width > 0 && height > 0) {<br>
>           /* Round, to satisfy conformance tests (matches SGI's OpenGL) */<br>
> -         GLint x = IROUND(ctx->Current.RasterPos[0]);<br>
> -         GLint y = IROUND(ctx->Current.RasterPos[1]);<br>
> +         GLint x = lroundf(ctx->Current.RasterPos[0]);<br>
> +         GLint y = lroundf(ctx->Current.RasterPos[1]);<br>
><br>
>           if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) {<br>
>              /* unpack from PBO */<br>
> @@ -196,13 +197,13 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,<br>
><br>
>     if (MESA_VERBOSE & VERBOSE_API)<br>
>        _mesa_debug(ctx,<br>
> -                  "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n",<br>
> +                  "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %ld, %ld\n",<br>
>                    srcx, srcy, width, height,<br>
>                    _mesa_enum_to_string(type),<br>
>                    _mesa_enum_to_string(ctx->ReadBuffer->ColorReadBuffer),<br>
>                    _mesa_enum_to_string(ctx->DrawBuffer->ColorDrawBuffer[0]),<br>
> -                  IROUND(ctx->Current.RasterPos[0]),<br>
> -                  IROUND(ctx->Current.RasterPos[1]));<br>
> +                  lroundf(ctx->Current.RasterPos[0]),<br>
> +                  lroundf(ctx->Current.RasterPos[1]));<br>
><br>
>     if (width < 0 || height < 0) {<br>
>        _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)");<br>
> @@ -264,8 +265,8 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,<br>
>     if (ctx->RenderMode == GL_RENDER) {<br>
>        /* Round to satisfy conformance tests (matches SGI's OpenGL) */<br>
>        if (width > 0 && height > 0) {<br>
> -         GLint destx = IROUND(ctx->Current.RasterPos[0]);<br>
> -         GLint desty = IROUND(ctx->Current.RasterPos[1]);<br>
> +         GLint destx = lroundf(ctx->Current.RasterPos[0]);<br>
> +         GLint desty = lroundf(ctx->Current.RasterPos[1]);<br>
>           ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,<br>
>                                   type );<br>
>        }<br>
> diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c<br>
> index 86c8f75..b21a90d 100644<br>
> --- a/src/mesa/main/eval.c<br>
> +++ b/src/mesa/main/eval.c<br>
> @@ -704,7 +704,7 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )<br>
>              if (bufSize < numBytes)<br>
>                 goto overflow;<br>
>           for (i=0;i<n;i++) {<br>
> -            v[i] = IROUND(data[i]);<br>
> +            v[i] = lroundf(data[i]);<br>
>           }<br>
>        }<br>
>           break;<br>
> @@ -728,17 +728,17 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v )<br>
>              numBytes = 2 * sizeof *v;<br>
>              if (bufSize < numBytes)<br>
>                 goto overflow;<br>
> -            v[0] = IROUND(map1d->u1);<br>
> -            v[1] = IROUND(map1d->u2);<br>
> +            v[0] = lroundf(map1d->u1);<br>
> +            v[1] = lroundf(map1d->u2);<br>
>           }<br>
>           else {<br>
>              numBytes = 4 * sizeof *v;<br>
>              if (bufSize < numBytes)<br>
>                 goto overflow;<br>
> -            v[0] = IROUND(map2d->u1);<br>
> -            v[1] = IROUND(map2d->u2);<br>
> -            v[2] = IROUND(map2d->v1);<br>
> -            v[3] = IROUND(map2d->v2);<br>
> +            v[0] = lroundf(map2d->u1);<br>
> +            v[1] = lroundf(map2d->u2);<br>
> +            v[2] = lroundf(map2d->v1);<br>
> +            v[3] = lroundf(map2d->v2);<br>
>           }<br>
>           break;<br>
>        default:<br>
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c<br>
> index 307a5ff..5e6cd9b 100644<br>
> --- a/src/mesa/main/get.c<br>
> +++ b/src/mesa/main/get.c<br>
> @@ -1527,13 +1527,13 @@ _mesa_GetIntegerv(GLenum pname, GLint *params)<br>
>        break;<br>
><br>
>     case TYPE_FLOAT_4:<br>
> -      params[3] = IROUND(((GLfloat *) p)[3]);<br>
> +      params[3] = lroundf(((GLfloat *) p)[3]);<br>
>     case TYPE_FLOAT_3:<br>
> -      params[2] = IROUND(((GLfloat *) p)[2]);<br>
> +      params[2] = lroundf(((GLfloat *) p)[2]);<br>
>     case TYPE_FLOAT_2:<br>
> -      params[1] = IROUND(((GLfloat *) p)[1]);<br>
> +      params[1] = lroundf(((GLfloat *) p)[1]);<br>
>     case TYPE_FLOAT:<br>
> -      params[0] = IROUND(((GLfloat *) p)[0]);<br>
> +      params[0] = lroundf(((GLfloat *) p)[0]);<br>
>        break;<br>
><br>
>     case TYPE_FLOATN_4:<br>
> @@ -1621,13 +1621,13 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params)<br>
>        break;<br>
><br>
>     case TYPE_FLOAT_4:<br>
> -      params[3] = IROUND64(((GLfloat *) p)[3]);<br>
> +      params[3] = llroundf(((GLfloat *) p)[3]);<br>
>     case TYPE_FLOAT_3:<br>
> -      params[2] = IROUND64(((GLfloat *) p)[2]);<br>
> +      params[2] = llroundf(((GLfloat *) p)[2]);<br>
>     case TYPE_FLOAT_2:<br>
> -      params[1] = IROUND64(((GLfloat *) p)[1]);<br>
> +      params[1] = llroundf(((GLfloat *) p)[1]);<br>
>     case TYPE_FLOAT:<br>
> -      params[0] = IROUND64(((GLfloat *) p)[0]);<br>
> +      params[0] = llroundf(((GLfloat *) p)[0]);<br>
>        break;<br>
><br>
>     case TYPE_FLOATN_4:<br>
> @@ -2110,22 +2110,22 @@ _mesa_GetIntegeri_v( GLenum pname, GLuint index, GLint *params )<br>
>     switch (type) {<br>
>     case TYPE_FLOAT_4:<br>
>     case TYPE_FLOATN_4:<br>
> -      params[3] = IROUND(v.value_float_4[3]);<br>
> +      params[3] = lroundf(v.value_float_4[3]);<br>
>     case TYPE_FLOAT_3:<br>
>     case TYPE_FLOATN_3:<br>
> -      params[2] = IROUND(v.value_float_4[2]);<br>
> +      params[2] = lroundf(v.value_float_4[2]);<br>
>     case TYPE_FLOAT_2:<br>
>     case TYPE_FLOATN_2:<br>
> -      params[1] = IROUND(v.value_float_4[1]);<br>
> +      params[1] = lroundf(v.value_float_4[1]);<br>
>     case TYPE_FLOAT:<br>
>     case TYPE_FLOATN:<br>
> -      params[0] = IROUND(v.value_float_4[0]);<br>
> +      params[0] = lroundf(v.value_float_4[0]);<br>
>        break;<br>
><br>
>     case TYPE_DOUBLEN_2:<br>
> -      params[1] = IROUND(v.value_double_2[1]);<br>
> +      params[1] = lround(v.value_double_2[1]);<br>
>     case TYPE_DOUBLEN:<br>
> -      params[0] = IROUND(v.value_double_2[0]);<br>
> +      params[0] = lround(v.value_double_2[0]);<br>
>        break;<br>
><br>
>     case TYPE_INT:<br>
> diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h<br>
> index d61279a..1d4b9c1 100644<br>
> --- a/src/mesa/main/imports.h<br>
> +++ b/src/mesa/main/imports.h<br>
> @@ -144,24 +144,6 @@ static inline GLfloat LOG2(GLfloat x)<br>
><br>
><br>
>  /**<br>
> - * Convert float to int by rounding to nearest integer, away from zero.<br>
> - */<br>
> -static inline int IROUND(float f)<br>
> -{<br>
> -   return (int) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));<br>
> -}<br>
> -<br>
> -<br>
> -/**<br>
> - * Convert float to int64 by rounding to nearest integer.<br>
> - */<br>
> -static inline GLint64 IROUND64(float f)<br>
> -{<br>
> -   return (GLint64) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));<br>
> -}<br>
> -<br>
> -<br>
> -/**<br>
>   * Convert positive float to int by rounding to nearest integer.<br>
>   */<br>
>  static inline int IROUND_POS(float f)<br>
> diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c<br>
> index 14b4b04..2c2e3af 100644<br>
> --- a/src/mesa/main/light.c<br>
> +++ b/src/mesa/main/light.c<br>
> @@ -850,12 +850,12 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params )<br>
>           params[3] = FLOAT_TO_INT( mat[MAT_ATTRIB_EMISSION(f)][3] );<br>
>        break;<br>
>        case GL_SHININESS:<br>
> -         *params = IROUND( mat[MAT_ATTRIB_SHININESS(f)][0] );<br>
> +         *params = lroundf( mat[MAT_ATTRIB_SHININESS(f)][0] );<br>
>        break;<br>
>        case GL_COLOR_INDEXES:<br>
> -      params[0] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][0] );<br>
> -      params[1] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][1] );<br>
> -      params[2] = IROUND( mat[MAT_ATTRIB_INDEXES(f)][2] );<br>
> +      params[0] = lroundf( mat[MAT_ATTRIB_INDEXES(f)][0] );<br>
> +      params[1] = lroundf( mat[MAT_ATTRIB_INDEXES(f)][1] );<br>
> +      params[2] = lroundf( mat[MAT_ATTRIB_INDEXES(f)][2] );<br>
>        break;<br>
>        default:<br>
>           _mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" );<br>
> diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c<br>
> index 608a545..47c7f50 100644<br>
> --- a/src/mesa/main/pixel.c<br>
> +++ b/src/mesa/main/pixel.c<br>
> @@ -114,7 +114,7 @@ store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize,<br>
>        /* special case */<br>
>        ctx->PixelMaps.StoS.Size = mapsize;<br>
>        for (i = 0; i < mapsize; i++) {<br>
> -         ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]);<br>
> +         ctx->PixelMaps.StoS.Map[i] = roundf(values[i]);<br>
>        }<br>
>        break;<br>
>     case GL_PIXEL_MAP_I_TO_I:<br>
> diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c<br>
> index fc81533..e691c01 100644<br>
> --- a/src/mesa/main/pixelstore.c<br>
> +++ b/src/mesa/main/pixelstore.c<br>
> @@ -28,6 +28,7 @@<br>
>   */<br>
><br>
><br>
> +#include "c99_math.h"<br>
>  #include "glheader.h"<br>
>  #include "bufferobj.h"<br>
>  #include "context.h"<br>
> @@ -223,7 +224,7 @@ invalid_value_error:<br>
>  void GLAPIENTRY<br>
>  _mesa_PixelStoref( GLenum pname, GLfloat param )<br>
>  {<br>
> -   _mesa_PixelStorei( pname, IROUND(param) );<br>
> +   _mesa_PixelStorei( pname, lroundf(param) );<br>
>  }<br>
><br>
><br>
> diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c<br>
> index 32180fb1..9b16e78 100644<br>
> --- a/src/mesa/main/samplerobj.c<br>
> +++ b/src/mesa/main/samplerobj.c<br>
> @@ -1327,19 +1327,19 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)<br>
>        /* GL spec 'Data Conversions' section specifies that floating-point<br>
>         * value in integer Get function is rounded to nearest integer<br>
>         */<br>
> -      *params = IROUND(sampObj->MinLod);<br>
> +      *params = _mesa_lroundevenf(sampObj->MinLod);<br>
>        break;<br>
>     case GL_TEXTURE_MAX_LOD:<br>
>        /* GL spec 'Data Conversions' section specifies that floating-point<br>
>         * value in integer Get function is rounded to nearest integer<br>
>         */<br>
> -      *params = IROUND(sampObj->MaxLod);<br>
> +      *params = _mesa_lroundevenf(sampObj->MaxLod);<br>
>        break;<br>
>     case GL_TEXTURE_LOD_BIAS:<br>
>        /* GL spec 'Data Conversions' section specifies that floating-point<br>
>         * value in integer Get function is rounded to nearest integer<br>
>         */<br>
> -      *params = IROUND(sampObj->LodBias);<br>
> +      *params = _mesa_lroundevenf(sampObj->LodBias);<br>
>        break;<br>
>     case GL_TEXTURE_COMPARE_MODE:<br>
>        if (!ctx->Extensions.ARB_shadow)<br>
> @@ -1355,7 +1355,7 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params)<br>
>        /* GL spec 'Data Conversions' section specifies that floating-point<br>
>         * value in integer Get function is rounded to nearest integer<br>
>         */<br>
> -      *params = IROUND(sampObj->MaxAnisotropy);<br>
> +      *params = _mesa_lroundevenf(sampObj->MaxAnisotropy);<br>
>        break;<br>
>     case GL_TEXTURE_BORDER_COLOR:<br>
>        params[0] = FLOAT_TO_INT(sampObj->BorderColor.f[0]);<br>
> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c<br>
> index 88c2c14..518d031 100644<br>
> --- a/src/mesa/main/texparam.c<br>
> +++ b/src/mesa/main/texparam.c<br>
> @@ -1959,7 +1959,7 @@ get_tex_parameteriv(struct gl_context *ctx,<br>
>           /* GL spec 'Data Conversions' section specifies that floating-point<br>
>            * value in integer Get function is rounded to nearest integer<br>
>            */<br>
> -         *params = IROUND(obj->Sampler.MinLod);<br>
> +         *params = _mesa_lroundevenf(obj->Sampler.MinLod);<br>
>           break;<br>
>        case GL_TEXTURE_MAX_LOD:<br>
>           if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))<br>
> @@ -1967,7 +1967,7 @@ get_tex_parameteriv(struct gl_context *ctx,<br>
>           /* GL spec 'Data Conversions' section specifies that floating-point<br>
>            * value in integer Get function is rounded to nearest integer<br>
>            */<br>
> -         *params = IROUND(obj->Sampler.MaxLod);<br>
> +         *params = _mesa_lroundevenf(obj->Sampler.MaxLod);<br>
>           break;<br>
>        case GL_TEXTURE_BASE_LEVEL:<br>
>           if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))<br>
> @@ -1984,7 +1984,7 @@ get_tex_parameteriv(struct gl_context *ctx,<br>
>           /* GL spec 'Data Conversions' section specifies that floating-point<br>
>            * value in integer Get function is rounded to nearest integer<br>
>            */<br>
> -         *params = IROUND(obj->Sampler.MaxAnisotropy);<br>
> +         *params = _mesa_lroundevenf(obj->Sampler.MaxAnisotropy);<br>
>           break;<br>
>        case GL_GENERATE_MIPMAP_SGIS:<br>
>           if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)<br>
> @@ -2022,7 +2022,7 @@ get_tex_parameteriv(struct gl_context *ctx,<br>
>           /* GL spec 'Data Conversions' section specifies that floating-point<br>
>            * value in integer Get function is rounded to nearest integer<br>
>            */<br>
> -         *params = IROUND(obj->Sampler.LodBias);<br>
> +         *params = _mesa_lroundevenf(obj->Sampler.LodBias);<br>
>           break;<br>
>        case GL_TEXTURE_CROP_RECT_OES:<br>
>           if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture)<br>
> diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp<br>
> index 036530e..60d9d81 100644<br>
> --- a/src/mesa/main/uniform_query.cpp<br>
> +++ b/src/mesa/main/uniform_query.cpp<br>
> @@ -407,7 +407,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,<br>
>                  *      a floating-point value is rounded to the<br>
>                  *      nearest integer..."<br>
>                  */<br>
> -               dst[i].i = IROUND(src[i].f);<br>
> +               dst[i].i = _mesa_lroundevenf(src[i].f);<br>
>                 break;<br>
>              case GLSL_TYPE_BOOL:<br>
>                 dst[i].i = src[i].i ? 1 : 0;<br>
> diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c<br>
> index 3e838a4..b0339f5 100644<br>
> --- a/src/mesa/swrast/s_blit.c<br>
> +++ b/src/mesa/swrast/s_blit.c<br>
> @@ -296,7 +296,7 @@ blit_nearest(struct gl_context *ctx,<br>
><br>
>        for (dstRow = 0; dstRow < dstHeight; dstRow++) {<br>
>           GLfloat srcRowF = (dstRow + 0.5F) / dstHeight * srcHeight - 0.5F;<br>
> -         GLint srcRow = IROUND(srcRowF);<br>
> +         GLint srcRow = lroundf(srcRowF);<br>
>           GLubyte *dstRowStart = dstMap + dstRowStride * dstRow;<br>
><br>
>           assert(srcRow >= 0);<br>
> diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h<br>
> index 7cf0e30..15ece26 100644<br>
> --- a/src/mesa/swrast/s_context.h<br>
> +++ b/src/mesa/swrast/s_context.h<br>
> @@ -434,7 +434,7 @@ _swrast_unmap_renderbuffers(struct gl_context *ctx);<br>
>  #define FIXED_EPSILON   1<br>
>  #define FIXED_SCALE     ((float) FIXED_ONE)<br>
>  #define FIXED_DBL_SCALE ((double) FIXED_ONE)<br>
> -#define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))<br>
> +#define FloatToFixed(X) (lroundf((X) * FIXED_SCALE))<br>
>  #define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE))<br>
>  #define IntToFixed(I)   ((I) << FIXED_SHIFT)<br>
>  #define FixedToInt(X)   ((X) >> FIXED_SHIFT)<br>
><br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div>