Re: [Mesa-dev] [PATCH 10/11] glsl: Improve precision of mod(x,y)

2015-01-20 Thread Iago Toral
On Mon, 2015-01-19 at 19:10 -0800, Ian Romanick wrote: > On 01/19/2015 03:32 AM, Eduardo Lima Mitev wrote: > > From: Iago Toral Quiroga > > > > Currently, Mesa uses the lowering pass MOD_TO_FRACT to implement > > mod(x,y) as y * fract(x/y). This implementation has a down side though: > > it intro

Re: [Mesa-dev] [PATCH 10/11] glsl: Improve precision of mod(x,y)

2015-01-19 Thread Ian Romanick
On 01/19/2015 03:32 AM, Eduardo Lima Mitev wrote: > From: Iago Toral Quiroga > > Currently, Mesa uses the lowering pass MOD_TO_FRACT to implement > mod(x,y) as y * fract(x/y). This implementation has a down side though: > it introduces precision errors due to the fract() operation. Even worse, >

Re: [Mesa-dev] [PATCH 10/11] glsl: Improve precision of mod(x,y)

2015-01-19 Thread Roland Scheidegger
Aside from a typo in a comment, this looks good to me (though I'm not all that familiar with glsl code). Roand Am 19.01.2015 um 12:32 schrieb Eduardo Lima Mitev: > From: Iago Toral Quiroga > > Currently, Mesa uses the lowering pass MOD_TO_FRACT to implement > mod(x,y) as y * fract(x/y). This im

[Mesa-dev] [PATCH 10/11] glsl: Improve precision of mod(x,y)

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga Currently, Mesa uses the lowering pass MOD_TO_FRACT to implement mod(x,y) as y * fract(x/y). This implementation has a down side though: it introduces precision errors due to the fract() operation. Even worse, since the result of fract() is multiplied by y, the larger y g