intel/fs: Add an assert to optimize_frontfacing_ternary
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 7 Nov 2018 21:47:18 +0000 (15:47 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 8 Nov 2018 16:09:25 +0000 (10:09 -0600)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_fs_nir.cpp

index 9ffd15a67d70e7e1782c318a70372a7a74cd132b..2b36171136e6695f9fa3d06e409075070aec0d14 100644 (file)
@@ -552,6 +552,9 @@ fs_visitor::optimize_frontfacing_ternary(nir_alu_instr *instr,
    if (fabsf(value1) != 1.0f || fabsf(value2) != 1.0f)
       return false;
 
+   /* nir_opt_algebraic should have gotten rid of bcsel(b, a, a) */
+   assert(value1 == -value2);
+
    fs_reg tmp = vgrf(glsl_type::int_type);
 
    if (devinfo->gen >= 6) {