main: round floating-point value to nearest integer in glGetSamplerParameteriv()
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Thu, 11 Dec 2014 22:34:15 +0000 (23:34 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Jan 2015 11:19:32 +0000 (12:19 +0100)
commit719e3f016ea69ffddd3bf14ec7a340def62ce464
treee45602fc8c099c7f863b01e272faa5d1d9e04762
parentd8d59202af1d409ad2e10c2893612ff6fa05d3a2
main: round floating-point value to nearest integer in glGetSamplerParameteriv()

Previously, a cast was done to convert from float to int but there
were rounding errors.

The spec specificies in Data Conversion chapter that Floating-point values are
rounded to the nearest integer.

This patch fixes the following 2 dEQP tests:

dEQP-GLES3.functional.state_query.sampler.sampler_texture_min_lod_getsamplerparameteri
dEQP-GLES3.functional.state_query.sampler.sampler_texture_max_lod_getsamplerparameteri

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/samplerobj.c