From: Iago Toral Quiroga Date: Thu, 18 May 2017 09:43:56 +0000 (+0200) Subject: mesa/main: conversion from float in GetUniformi64v requires rounding to nearest X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1356b422847dfa92dcae1e2709879daa27110795;p=mesa.git mesa/main: conversion from float in GetUniformi64v requires rounding to nearest As we do for all other cases of float/double conversions to integers. v2: use round() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner --- diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index b53f60bc456..2fdbc83be24 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); memcpy(&dst[didx].u, &tmp, sizeof(tmp)); break; }