vtn: use new derivative builders

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30565>
This commit is contained in:
Alyssa Rosenzweig
2024-07-24 10:52:11 -04:00
committed by Marge Bot
parent 530498cb83
commit 6338c49143

View File

@@ -386,14 +386,6 @@ vtn_nir_alu_op_for_spirv_opcode(struct vtn_builder *b,
case SpvOpPtrCastToGeneric: return nir_op_mov;
case SpvOpGenericCastToPtr: return nir_op_mov;
/* Derivatives: */
case SpvOpDPdx: return nir_op_fddx;
case SpvOpDPdy: return nir_op_fddy;
case SpvOpDPdxFine: return nir_op_fddx_fine;
case SpvOpDPdyFine: return nir_op_fddy_fine;
case SpvOpDPdxCoarse: return nir_op_fddx_coarse;
case SpvOpDPdyCoarse: return nir_op_fddy_coarse;
case SpvOpIsNormal: return nir_op_fisnormal;
case SpvOpIsFinite: return nir_op_fisfinite;
@@ -728,6 +720,25 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
break;
}
case SpvOpDPdx:
dest->def = nir_ddx(&b->nb, src[0]);
break;
case SpvOpDPdxFine:
dest->def = nir_ddx_fine(&b->nb, src[0]);
break;
case SpvOpDPdxCoarse:
dest->def = nir_ddx_coarse(&b->nb, src[0]);
break;
case SpvOpDPdy:
dest->def = nir_ddy(&b->nb, src[0]);
break;
case SpvOpDPdyFine:
dest->def = nir_ddy_fine(&b->nb, src[0]);
break;
case SpvOpDPdyCoarse:
dest->def = nir_ddy_coarse(&b->nb, src[0]);
break;
case SpvOpFwidth:
dest->def = nir_fadd(&b->nb,
nir_fabs(&b->nb, nir_ddx(&b->nb, src[0])),