From: Kenneth Graunke Date: Tue, 12 Mar 2019 02:00:21 +0000 (-0700) Subject: intel/fs: Fix opt_peephole_csel to not throw away saturates. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3570d15b6d88bdcd353b31ffe5460d04a88b7b6f;p=mesa.git intel/fs: Fix opt_peephole_csel to not throw away saturates. We were not copying the saturate bit from the original instruction to the new replacement instruction. This caused major misrendering in DiRT Rally on iris, where comparisons leading to discards failed due to the missing saturate, causing lots of extra garbage pixels to be drawn in text rendering, trees, and so on. This did not show up on i965 because st/nir performs a more aggressive version of nir_opt_peephole_select, yielding more b32csel operations. Fixes: 52c7df1643e i965/fs: Merge CMP and SEL into CSEL on Gen8+ Reviewed-by: Lionel Landwerlin Reviewed-by: Ian Romanick --- diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index bbab80d6018..fb6c23e5f9c 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -3133,6 +3133,7 @@ fs_visitor::opt_peephole_csel() if (csel_inst != NULL) { progress = true; + csel_inst->saturate = inst->saturate; inst->remove(block); }