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 <mattst88@gmail.com>
This commit is contained in:
Iago Toral Quiroga 2017-05-18 11:43:56 +02:00
parent c333082483
commit 1356b42284

View file

@ -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;
}