i965/fs: Fix saturate on MAD and LRP with the NIR backend.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 3 Feb 2015 08:50:23 +0000 (00:50 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 4 Feb 2015 08:34:57 +0000 (00:34 -0800)
Fixes misrendering in "Witcher 2" with INTEL_USE_NIR=1, and probably
many other programs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index c3c268ca1b326f682207bfe49ffdf83e772b23a5..da81b61a98a315269d248fa2361a14fc958d0c2f 100644 (file)
@@ -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: