Draft: r300: after writing to temp variable, use write mask as a swizzle for reading
After reading #352 (closed) there was strong suggestion that lrp is implemented in wrong way. Even though I'd spend some time reading some code I wasn't able to track anything wrong, so I started reading debug output from tests which are using lrp.
In spec@glsl-1.20@execution@fs-mix-1.0
34: LRP temp[5].x, temp[7].yyyy, temp[4].xxxx, const[4].xxxx;
becomes:
37: ADD temp[5].x, temp[4].xxxx, -const[4].xxxx;
38: MAD temp[5].x, temp[7].yyyy, temp[5], const[4].xxxx;
As you can see it's possible to have bad swizzle on temp. This MR should cover this issue (though I'm not 100% sure what is happening with trigonometry stuff aka code which looks ok).
Edit: Todo: Rename commits.
Edited by Filip Gawin