On Tue, Nov 17, 2015 at 4:00 PM, Dave Airlie <[email protected]> wrote: > From: Dave Airlie <[email protected]> > > 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 <[email protected]> > --- > 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);
I think you want a IROUNDD... this one takes a float from what I can see, which will end up giving you incorrect integers > 2^23. I guess that CTS test isn't *that* sensitive :) > break; > default: > assert(!"Should not get here."); > -- > 2.5.0 > > _______________________________________________ > mesa-dev mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
