intel/fs: Don't assert on b2f with a saturate modifier
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 1 Mar 2019 22:39:14 +0000 (14:39 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 2 Mar 2019 21:58:50 +0000 (13:58 -0800)
This ran afoul of Iris's use of nir_lower_clamp_color_outputs which
applies fsat() before writes to vertex shader color outpus.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: 7725d609387 ("intel/fs: Emit better code for b2f(inot(a)) and b2i(inot(a))")
src/intel/compiler/brw_fs_nir.cpp

index fb373e1757e223a2bc92f9ebe01c4159fbb7926e..a4fd29ff9ec445980cc8981d58dec1a654b80983 100644 (file)
@@ -800,8 +800,10 @@ fs_visitor::try_emit_b2fi_of_inot(const fs_builder &bld,
 
    prepare_alu_destination_and_sources(bld, inot_instr, &op, false);
 
+   /* Ignore the saturate modifier, if there is one.  The result of the
+    * arithmetic can only be 0 or 1, so the clamping will do nothing anyway.
+    */
    bld.ADD(result, op, brw_imm_d(1));
-   assert(!instr->dest.saturate);
 
    return true;
 }