vkd3d-shader/msl: Implement VSIR_OP_DSX_FINE and VSIR_OP_DSY_FINE.

This commit is contained in:
Henri Verbeet
2025-05-28 15:18:33 +02:00
parent b9ce945e61
commit 543ee120fc
Notes: Henri Verbeet 2025-06-25 17:09:09 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1600
2 changed files with 3 additions and 1 deletions

View File

@@ -1320,6 +1320,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
break; break;
case VSIR_OP_DSX: case VSIR_OP_DSX:
case VSIR_OP_DSX_COARSE: case VSIR_OP_DSX_COARSE:
case VSIR_OP_DSX_FINE:
/* dfdx() and dfdy() are specified to return "a high precision /* dfdx() and dfdy() are specified to return "a high precision
* partial derivative", which would seem to correspond to * partial derivative", which would seem to correspond to
* DSX_FINE/DSY_FINE. As of MSL 3.2, coarse/fast variants don't * DSX_FINE/DSY_FINE. As of MSL 3.2, coarse/fast variants don't
@@ -1328,6 +1329,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
break; break;
case VSIR_OP_DSY: case VSIR_OP_DSY:
case VSIR_OP_DSY_COARSE: case VSIR_OP_DSY_COARSE:
case VSIR_OP_DSY_FINE:
msl_intrinsic(gen, ins, "dfdy"); msl_intrinsic(gen, ins, "dfdy");
break; break;
case VSIR_OP_ELSE: case VSIR_OP_ELSE:

View File

@@ -74,7 +74,7 @@ float4 main(float4 pos : sv_position) : sv_target
} }
[test] [test]
todo(glsl | msl) draw quad todo(glsl) draw quad
probe (10, 10) rgba (-0.524999976, -0.164999843, 0.104999900, 0.0) 16 probe (10, 10) rgba (-0.524999976, -0.164999843, 0.104999900, 0.0) 16
probe (11, 10) rgba (-0.689999819, -0.164999843, 0.114999890, 0.0) 32 probe (11, 10) rgba (-0.689999819, -0.164999843, 0.114999890, 0.0) 32
probe (10, 11) rgba (-0.420000076, -0.154999852, 0.104999900, 0.0) 32 probe (10, 11) rgba (-0.420000076, -0.154999852, 0.104999900, 0.0) 32