mesa/prog_to_nir: use derivative builder

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31014>
This commit is contained in:
Georg Lehmann 2024-09-04 12:52:57 +02:00 committed by Marge Bot
parent 41cce70584
commit 5205501e2f

View file

@ -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;