OSDN Git Service

mesa: Fix glGetUniform() type conversions.
authorEric Anholt <eric@anholt.net>
Tue, 23 Aug 2011 20:46:12 +0000 (13:46 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 30 Aug 2011 19:09:40 +0000 (12:09 -0700)
commit9fa41f0742b7486e462e088a66bef8cebdf114f5
tree0721d3d49c399078250cd32e25a7c4c09476a812
parent7708b25e2b5e05f262c19dde5d7f3612a7e7e166
mesa: Fix glGetUniform() type conversions.

We were primarily failing to convert in the NativeIntegers case, which
this fixes.  However, we were also just truncating float uniforms when
converting to integer, which does not appear to be the correct
behavior.  Note, however, that the NVIDIA drivers also truncate
instead of rounding.

GL_DOUBLE return type is dropped because it was never used and
completely broken.  It can be added when there's test code.

Fixes piglit ARB_shader_objects/getuniform

v2: This is a rewrite of my previous glGetUniform patch, which Ken
    pointed out missed storage_type-based conversions to integer,
    which was totally broken still thanks to a typo in the testcase.
v3: Quote the spec justifying the rounding behavior.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/uniforms.c