From: Dave Airlie <airl...@redhat.com>

For the case where we convert a double to an int, we should
round the same as we do for floats.

This fixes GL41-CTS.gpu_shader_fp64.state_query

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 src/mesa/main/uniform_query.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 083087d..cbf7062 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -437,7 +437,7 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, 
GLint location,
                  dst[didx].i = src[sidx].i ? 1 : 0;
                  break;
               case GLSL_TYPE_DOUBLE:
-                 dst[didx].i = *(double *)&src[sidx].f;
+                 dst[didx].i = IROUND(*(double *)&src[sidx].f);
                  break;
               default:
                  assert(!"Should not get here.");
-- 
2.5.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to