mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 13:30:12 +01:00
mesa/main: replace remaining uses of IROUND() in GetUniform*() by round()
These were correct since they were used only in conversions to signed integers, however this makes the implementation a bit more is more consistent and reduces chances of propagating use of these macros to unsigned cases in the future, which would not be correct. Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
1356b42284
commit
3d37cf99c8
1 changed files with 2 additions and 2 deletions
|
|
@ -471,7 +471,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,
|
||||||
* a floating-point value is rounded to the
|
* a floating-point value is rounded to the
|
||||||
* nearest integer..."
|
* nearest integer..."
|
||||||
*/
|
*/
|
||||||
dst[didx].i = IROUND(src[sidx].f);
|
dst[didx].i = (int64_t) roundf(src[sidx].f);
|
||||||
break;
|
break;
|
||||||
case GLSL_TYPE_BOOL:
|
case GLSL_TYPE_BOOL:
|
||||||
dst[didx].i = src[sidx].i ? 1 : 0;
|
dst[didx].i = src[sidx].i ? 1 : 0;
|
||||||
|
|
@ -482,7 +482,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,
|
||||||
case GLSL_TYPE_DOUBLE: {
|
case GLSL_TYPE_DOUBLE: {
|
||||||
double tmp;
|
double tmp;
|
||||||
memcpy(&tmp, &src[sidx].f, sizeof(tmp));
|
memcpy(&tmp, &src[sidx].f, sizeof(tmp));
|
||||||
dst[didx].i = IROUNDD(tmp);
|
dst[didx].i = (int64_t) round(tmp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GLSL_TYPE_UINT64: {
|
case GLSL_TYPE_UINT64: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue