From 5205501e2f41e5c012ab130d1864949e0a5496ca Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 4 Sep 2024 12:52:57 +0200 Subject: [PATCH] mesa/prog_to_nir: use derivative builder Reviewed-by: Alyssa Rosenzweig Reviewed-by: Rob Clark Part-of: --- src/mesa/program/prog_to_nir.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 1834033e698..513ac6846ac 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -476,8 +476,8 @@ static const nir_op op_trans[MAX_OPCODE] = { [OPCODE_ARL] = 0, [OPCODE_CMP] = 0, [OPCODE_COS] = 0, - [OPCODE_DDX] = nir_op_fddx, - [OPCODE_DDY] = nir_op_fddy, + [OPCODE_DDX] = 0, + [OPCODE_DDY] = 0, [OPCODE_DP2] = 0, [OPCODE_DP3] = 0, [OPCODE_DP4] = 0, @@ -536,6 +536,14 @@ ptn_emit_instruction(struct ptn_compile *c, struct prog_instruction *prog_inst) return; switch (op) { + case OPCODE_DDX: + dst = nir_ddx(b, src[0]); + break; + + case OPCODE_DDY: + dst = nir_ddy(b, src[0]); + break; + case OPCODE_RSQ: dst = nir_frsq(b, nir_fabs(b, ptn_channel(b, src[0], X))); break;