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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user