Mesa (master): i965/fs: Fix saturate on MAD and LRP with the NIR backend.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Feb 4 08:39:00 UTC 2015


Module: Mesa
Branch: master
Commit: ccbe15f3325d7a6d04d0ea18227a08f53decec16
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ccbe15f3325d7a6d04d0ea18227a08f53decec16

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Feb  3 00:50:23 2015 -0800

i965/fs: Fix saturate on MAD and LRP with the NIR backend.

Fixes misrendering in "Witcher 2" with INTEL_USE_NIR=1, and probably
many other programs.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_fs_nir.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index c3c268c..da81b61 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -1049,12 +1049,14 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr)
       break;
 
    case nir_op_ffma:
-      emit(MAD(result, op[2], op[1], op[0]));
+      inst = emit(MAD(result, op[2], op[1], op[0]));
+      inst->saturate = instr->dest.saturate;
       break;
 
    case nir_op_flrp:
       /* TODO emulate for gen < 6 */
-      emit(LRP(result, op[2], op[1], op[0]));
+      inst = emit(LRP(result, op[2], op[1], op[0]));
+      inst->saturate = instr->dest.saturate;
       break;
 
    case nir_op_bcsel:




More information about the mesa-commit mailing list