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>
This commit is contained in:
@@ -94,16 +94,16 @@ This instruction replicates its result.
|
||||
|
||||
.. opcode:: RSQ - Reciprocal Square Root
|
||||
|
||||
This instruction replicates its result.
|
||||
This instruction replicates its result. The results are undefined for src <= 0.
|
||||
|
||||
.. math::
|
||||
|
||||
dst = \frac{1}{\sqrt{|src.x|}}
|
||||
dst = \frac{1}{\sqrt{src.x}}
|
||||
|
||||
|
||||
.. opcode:: SQRT - Square Root
|
||||
|
||||
This instruction replicates its result.
|
||||
This instruction replicates its result. The results are undefined for src < 0.
|
||||
|
||||
.. math::
|
||||
|
||||
|
Reference in New Issue
Block a user