gallivm: fix float->SNORM conversion
authorRoland Scheidegger <sroland@vmware.com>
Sat, 27 Jul 2013 01:53:00 +0000 (03:53 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 27 Jul 2013 14:41:29 +0000 (16:41 +0200)
commit8c3d3622d9ce2fd2a8f46084ab8153d708fa5b09
tree43cdbdb349ae84ad74f0eb335eae62d8fac55043
parentd86fddc87630c5a61d6b170dd6e213a16034bff5
gallivm: fix float->SNORM conversion

Just like the UNORM case we need to use round to nearest, not trunc.
(There's also another problem, we're using the formula for SNORM->float
which will produce a value below -1.0 for the most negative value which
according to both OpenGL and d3d10 would need clamping. However, no actual
failures have been observed due to that hence keep cheating on that.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_conv.c
src/gallium/auxiliary/gallivm/lp_bld_format_soa.c