[Mesa-dev] [PATCH 033/133] i965/fs_nir: Handle coarse/fine derivatives

Jason Ekstrand jason at jlekstrand.net
Mon Dec 15 22:04:43 PST 2014


---
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 677bd8f..dcbcebf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -614,6 +614,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],
@@ -624,6 +632,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: {
-- 
2.2.0



More information about the mesa-dev mailing list