[Mesa-dev] [PATCH v2 5/6] mesa/main: conversion from float in GetUniformi64v requires rounding to nearest

Matt Turner mattst88 at gmail.com
Sat May 20 21:06:43 UTC 2017


On Thu, May 18, 2017 at 2:43 AM, Iago Toral Quiroga <itoral at igalia.com> wrote:
> As we do for all other cases of float/double conversions to integers.
>
> v2: use round() instead of IROUND() macros
> ---
>  src/mesa/main/uniform_query.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
> index b53f60b..2fdbc83 100644
> --- a/src/mesa/main/uniform_query.cpp
> +++ b/src/mesa/main/uniform_query.cpp
> @@ -576,7 +576,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,
>                    break;
>                 }
>                 case GLSL_TYPE_FLOAT: {
> -                  int64_t tmp = src[sidx].f;
> +                  int64_t tmp = (int64_t) roundf(src[sidx].f);

llroundf()


More information about the mesa-dev mailing list