[Mesa-dev] [PATCH 3/9] glsl: Convert mix() to use a new ir_triop_lrp opcode.

Aras Pranckevicius aras at unity3d.com
Wed Feb 20 02:39:05 PST 2013


> Why did glsl implement this really as x * (1 - a) + y * a?
> The usual way for lerp would be (y - x) * a + x, i.e. two ops for most
> gpus (sub+mad, or sub+mul+add). But I'm wondering if that sacrifices
> precision


Yes.
http://fgiesen.wordpress.com/2012/08/15/linear-interpolation-past-present-and-future/



-- 
Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130220/de13fcd7/attachment.html>


More information about the mesa-dev mailing list