util: treat denorm'ed floats like zero
authorZack Rusin <zackr@vmware.com>
Tue, 9 Jul 2013 03:45:55 +0000 (23:45 -0400)
committerZack Rusin <zackr@vmware.com>
Wed, 10 Jul 2013 03:30:55 +0000 (23:30 -0400)
commit63386b2f66a6d450889cd5368bc599beb7f1efbf
treea82f6a2acbbfc7d639687033060a44a0621e12a3
parent80bc14370a4db876ababc13404a93526c2b14de7
util: treat denorm'ed floats like zero

The D3D10 spec is very explicit about treatment of denorm floats and
the behavior is exactly the same for them as it would be for -0 or
+0. This makes our shading code match that behavior, since OpenGL
doesn't care and on a few cpu's it's faster (worst case the same).
Float16 conversions will likely break but we'll fix them in a follow
up commit.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/draw/draw_pt.c
src/gallium/auxiliary/gallivm/lp_bld_arit.c
src/gallium/auxiliary/util/u_math.c
src/gallium/auxiliary/util/u_math.h
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_test_main.c