r600: fix abs for op3 sources
authorRoland Scheidegger <sroland@vmware.com>
Tue, 13 Mar 2018 02:40:42 +0000 (03:40 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 14 Mar 2018 03:54:45 +0000 (04:54 +0100)
commit274f8bf05ef526d65f01614313dda65bc7ec7a87
treea59740c258dfbf71d5b53b559d1c91062965a0d2
parent27a5e5366e89498d98d786cc84fafbdb220c4d94
r600: fix abs for op3 sources

If a src was referencing the same temp as the dst, the per-component
copy code didn't work.
e.g.
  cndge r0.xy, r0.xx, |r2|, r3
got expanded into
  mov  r12.x, |r2|
  cndge r0.x, r0.x, r12, r3
  mov  r12.y, |r2|
  cndge r0.y, r0.x, r12, r3
hence for the second cndge r0.x was mistakenly the previous cndge result.
Fix this by doing all the movs first, so there's no bogus alu.last in between.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=102905
Tested-by: <iive@yahoo.com>
Reviewed-by: Dave Airlie <airlied@gmail.com>
src/gallium/drivers/r600/r600_shader.c