mesa: fix bug in GPU codegen for fixed-function two-sided lighting
authorBrian Paul <brianp@vmware.com>
Tue, 31 Mar 2009 22:13:14 +0000 (16:13 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 31 Mar 2009 22:21:51 +0000 (16:21 -0600)
commit919f57078b289a273e0e46ee2214a9f042b11b1f
tree6393f3742a5f97dd2dffda7a11fb9a62029a2bc2
parentef6f1027ff0b6027976a7467b8461ffdd53ce2a8
mesa: fix bug in GPU codegen for fixed-function two-sided lighting

The 'dots' register wasn't getting properly un-negated and un-swizzled
after emitting the code for back-face lighting.  So, if more than one
light source was enabled, the specular exponent for the next light source
was wrong.

During execution we were evaluating pow(x, y) where y was negative instead
of positive.  This led to the outcome being zero or NaN.

This fixes the occasional black triangles seen in isosurf when hacked to
enable two-sided lighting.
src/mesa/main/ffvertex_prog.c