diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-29 15:11:12 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-30 10:01:19 -0700 |
commit | 8f887329c0870bc55983af974546f618bbd80cd2 (patch) | |
tree | 1e81636f5871e08225ae7d6507e3a39054d6ab03 /src/panfrost/midgard/midgard_compile.c | |
parent | 982134d22ec51da1c34eba7d7a3ce33a3501c906 (diff) |
pan/midgard: Implement derivatives
Implement the fdd* and fdd* opcodes in the Midgard compiler.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/midgard_compile.c')
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index aa8fe9a68a5..ae526e89eff 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -714,6 +714,14 @@ reg_mode_for_nir(nir_alu_instr *instr) static void emit_alu(compiler_context *ctx, nir_alu_instr *instr) { + /* Derivatives end up emitted on the texture pipe, not the ALUs. This + * is handled elsewhere */ + + if (instr->op == nir_op_fddx || instr->op == nir_op_fddy) { + midgard_emit_derivatives(ctx, instr); + return; + } + bool is_ssa = instr->dest.dest.is_ssa; unsigned dest = nir_dest_index(ctx, &instr->dest.dest); @@ -2347,6 +2355,7 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga mir_foreach_block(ctx, block) { midgard_lower_invert(ctx, block); + midgard_lower_derivatives(ctx, block); } /* Nested control-flow can result in dead branches at the end of the |