gallium: fixup definitions of the rsq and sqrt
authorZack Rusin <zackr@vmware.com>
Thu, 11 Jul 2013 16:16:06 +0000 (12:16 -0400)
committerZack Rusin <zackr@vmware.com>
Fri, 12 Jul 2013 00:19:04 +0000 (20:19 -0400)
commit00cd455bd50c6b16b2f72a6d2726de3d3818c7f5
tree2b13c67bd84020a1bad285c3678b497a571ae1a4
parenta171812d27afb1a52c5d81deaa6027f30bc102e8
gallium: fixup definitions of the rsq and sqrt

GLSL spec says that rsq is undefined for src<=0, but the D3D10
spec says it needs to be a NaN, so lets stop taking an absolute
value of the source which completely breaks that behavior. For
the gl program we can simply insert an extra abs instrunction
which produces the desired behavior there.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
src/gallium/auxiliary/tgsi/tgsi_exec.c
src/gallium/docs/source/tgsi.rst
src/mesa/state_tracker/st_mesa_to_tgsi.c