From 1356b422847dfa92dcae1e2709879daa27110795 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 18 May 2017 11:43:56 +0200 Subject: [PATCH] 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 --- 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 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; } -- 2.30.2