[Mesa-dev] [PATCH] mesa/uniform_query: use IROUND for doubles as well as floats

Dave Airlie airlied at gmail.com
Tue Nov 17 13:00:28 PST 2015


From: Dave Airlie <airlied at 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 <airlied at 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



More information about the mesa-dev mailing list