Re: [Mesa-dev] [PATCH] gallium: fixup definitions of the rsq and sqrt

2013-07-11 Thread Marek Olšák
The ARB_vertex_program specification defines RSQ as: tmp = fabs(ScalarLoad(op0)); result.x = ApproxRSQRT(tmp); result.y = ApproxRSQRT(tmp); result.z = ApproxRSQRT(tmp); result.w = ApproxRSQRT(tmp); The mesa_to_tgsi code looks good, but it's very suboptimal. Source op

Re: [Mesa-dev] [PATCH] gallium: fixup definitions of the rsq and sqrt

2013-07-11 Thread Roland Scheidegger
Am 11.07.2013 21:44, schrieb Zack Rusin: > 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 instrunctio

Re: [Mesa-dev] [PATCH] gallium: fixup definitions of the rsq and sqrt

2013-07-11 Thread Brian Paul
On 07/11/2013 01:44 PM, Zack Rusin wrote: 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 whi

[Mesa-dev] [PATCH] gallium: fixup definitions of the rsq and sqrt

2013-07-11 Thread Zack Rusin
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. Sig