st/nine: Handle NRM with input of null norm
authorAxel Davy <axel.davy@ens.fr>
Wed, 3 Dec 2014 14:31:44 +0000 (15:31 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 22 Jan 2015 22:16:20 +0000 (22:16 +0000)
commitf5e8e3fb806ef8516a7bd5fabdce4cc24e4c9636
tree80cc81cf43d3bbffed3d513abd170c164719a0a0
parent2487f7357449ee520a59f6d81506d297aca752f2
st/nine: Handle NRM with input of null norm

When the input's xyz are 0.0, the output
should be 0.0. This is due to the fact that
Inf * 0 = 0 for dx9. To handle this case,
cap the result of RSQ to FLT_MAX. We have
FLT_MAX * 0 = 0.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/nine/nine_shader.c