i965/fs_nir: Handle coarse/fine derivatives
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 15 Oct 2014 21:44:00 +0000 (14:44 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:18:59 +0000 (07:18 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index aab74298fae0f2e80ee582358a4140925b44a4f5..5d78272e82a859289c9f2664dc4047ba70faaa77 100644 (file)
@@ -613,6 +613,14 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr)
          emit_percomp(FS_OPCODE_DDX_COARSE, result, op[0],
                       instr->dest.write_mask, instr->dest.saturate);
       break;
+   case nir_op_fddx_fine:
+      emit_percomp(FS_OPCODE_DDX_FINE, result, op[0],
+                   instr->dest.write_mask, instr->dest.saturate);
+      break;
+   case nir_op_fddx_coarse:
+      emit_percomp(FS_OPCODE_DDX_COARSE, result, op[0],
+                   instr->dest.write_mask, instr->dest.saturate);
+      break;
    case nir_op_fddy:
       if (fs_key->high_quality_derivatives)
          emit_percomp(FS_OPCODE_DDY_FINE, result, op[0],
@@ -623,6 +631,16 @@ fs_visitor::nir_emit_alu(nir_alu_instr *instr)
                       fs_reg(fs_key->render_to_fbo),
                       instr->dest.write_mask, instr->dest.saturate);
       break;
+   case nir_op_fddy_fine:
+      emit_percomp(FS_OPCODE_DDY_FINE, result, op[0],
+                   fs_reg(fs_key->render_to_fbo),
+                   instr->dest.write_mask, instr->dest.saturate);
+      break;
+   case nir_op_fddy_coarse:
+      emit_percomp(FS_OPCODE_DDY_COARSE, result, op[0],
+                   fs_reg(fs_key->render_to_fbo),
+                   instr->dest.write_mask, instr->dest.saturate);
+      break;
 
    case nir_op_fadd:
    case nir_op_iadd: {