gallivm: Fix lerping of (un)signed normalized numbers.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 6 Dec 2012 09:30:53 +0000 (09:30 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 6 Dec 2012 15:58:40 +0000 (15:58 +0000)
commit5e99cd915921d7b863a66badf09941f11120c6ab
tree3abc213e7e7b9eb03563eedeb9088fd2a7ea96dd
parent33ffca713a5e593beda34d6bcbee8fb1af472cf7
gallivm: Fix lerping of (un)signed normalized numbers.

Several issues actually:

- Fix a regression in unsigned normalized in the rescaling
  [0, 255] to [0, 256]

- Ensure we use signed shifts where appropriate (instead of
  unsigned shifts)

- Refactor the code slightly -- move all the logic inside
  lp_build_lerp_simple().

This change, plus an adjustment in the tolerance of signed normalized
results in piglit fbo-blending-formats fixes bug 57903

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_arit.c