projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c333082
)
mesa/main: conversion from float in GetUniformi64v requires rounding to nearest
author
Iago Toral Quiroga
<itoral@igalia.com>
Thu, 18 May 2017 09:43:56 +0000
(11:43 +0200)
committer
Iago Toral Quiroga
<itoral@igalia.com>
Thu, 1 Jun 2017 06:44:34 +0000
(08:44 +0200)
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>
src/mesa/main/uniform_query.cpp
patch
|
blob
|
history
diff --git
a/src/mesa/main/uniform_query.cpp
b/src/mesa/main/uniform_query.cpp
index b53f60bc4567e002c325f499764b842c2cc4c877..2fdbc83be24380ef4226561d2d06d32e081d2d66 100644
(file)
--- 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;
}