diff options
author | Iago Toral Quiroga <[email protected]> | 2017-05-18 11:43:56 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2017-06-01 08:44:34 +0200 |
commit | 1356b422847dfa92dcae1e2709879daa27110795 (patch) | |
tree | e01e3e99becd37c2b51877cd7f53f268057d840b | |
parent | c33308248357c40896872336258a66190e3c7048 (diff) |
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 <[email protected]>
-rw-r--r-- | src/mesa/main/uniform_query.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |