summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_wpos_ytransform.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-05-18 12:14:02 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-05-20 14:29:04 -0700
commit12ab7fc6ac1ca785afb1126607bb95ea26473e06 (patch)
tree26c52e1641052fda7e8b23a94596afa068da62b6 /src/compiler/nir/nir_lower_wpos_ytransform.c
parentb8b1b1c34cfa7f3c68872b5726eaf554474ea464 (diff)
downloadexternal_mesa3d-12ab7fc6ac1ca785afb1126607bb95ea26473e06.zip
external_mesa3d-12ab7fc6ac1ca785afb1126607bb95ea26473e06.tar.gz
external_mesa3d-12ab7fc6ac1ca785afb1126607bb95ea26473e06.tar.bz2
nir: Don't use ffma in nir_lower_wpos_ytransform().
ffma is an explicitly fused multiply add with higher precision. The optimizer will take care of promoting mul/add to fma when it's beneficial to do so. This fixes failures on Gen4-5 when using this pass, as those platforms don't actually implement fma(). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/compiler/nir/nir_lower_wpos_ytransform.c')
-rw-r--r--src/compiler/nir/nir_lower_wpos_ytransform.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c b/src/compiler/nir/nir_lower_wpos_ytransform.c
index 36e25b9..ccf0fd3 100644
--- a/src/compiler/nir/nir_lower_wpos_ytransform.c
+++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
@@ -123,19 +123,15 @@ emit_wpos_adjustment(lower_wpos_ytransform_state *state,
* inversion/identity, or the other way around if we're drawing to an FBO.
*/
if (invert) {
- /* MAD wpos_temp.y, wpos_input, wpostrans.xxxx, wpostrans.yyyy
- */
- wpos_temp_y = nir_ffma(b,
- nir_channel(b, wpos_temp, 1),
- nir_channel(b, wpostrans, 0),
- nir_channel(b, wpostrans, 1));
+ /* wpos_temp.y = wpos_input * wpostrans.xxxx + wpostrans.yyyy */
+ wpos_temp_y = nir_fadd(b, nir_fmul(b, nir_channel(b, wpos_temp, 1),
+ nir_channel(b, wpostrans, 0)),
+ nir_channel(b, wpostrans, 1));
} else {
- /* MAD wpos_temp.y, wpos_input, wpostrans.zzzz, wpostrans.wwww
- */
- wpos_temp_y = nir_ffma(b,
- nir_channel(b, wpos_temp, 1),
- nir_channel(b, wpostrans, 2),
- nir_channel(b, wpostrans, 3));
+ /* wpos_temp.y = wpos_input * wpostrans.zzzz + wpostrans.wwww */
+ wpos_temp_y = nir_fadd(b, nir_fmul(b, nir_channel(b, wpos_temp, 1),
+ nir_channel(b, wpostrans, 2)),
+ nir_channel(b, wpostrans, 3));
}
wpos_temp = nir_vec4(b,