vkd3d-shader/msl: Implement VSIR_OP_DSX and VSIR_OP_DSY.

This commit is contained in:
Henri Verbeet
2025-05-28 10:28:52 +02:00
parent cdfaeb209a
commit 06a0453762
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
4 changed files with 10 additions and 4 deletions

View File

@@ -1318,6 +1318,12 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VSIR_OP_DP4: case VSIR_OP_DP4:
msl_dot(gen, ins, VKD3DSP_WRITEMASK_ALL); msl_dot(gen, ins, VKD3DSP_WRITEMASK_ALL);
break; break;
case VSIR_OP_DSX:
msl_intrinsic(gen, ins, "dfdx");
break;
case VSIR_OP_DSY:
msl_intrinsic(gen, ins, "dfdy");
break;
case VSIR_OP_ELSE: case VSIR_OP_ELSE:
msl_else(gen); msl_else(gen);
break; break;

View File

@@ -8,7 +8,7 @@ float4 main(float4 pos : sv_position) : sv_target
} }
[test] [test]
todo(sm<4 | glsl | msl) draw quad todo(sm<4 | glsl) draw quad
probe (0, 0, 640, 480) rgba (1.0, 1.0, 0.0, 0.0) probe (0, 0, 640, 480) rgba (1.0, 1.0, 0.0, 0.0)
@@ -29,7 +29,7 @@ float4 main(float4 pos : sv_position) : sv_target
} }
[test] [test]
todo(sm<4 | glsl | msl) draw quad todo(sm<4 | glsl) draw quad
todo(sm<4) probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0) todo(sm<4) probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0)
todo(sm<4) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0) todo(sm<4) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0)
todo(sm<4) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0) todo(sm<4) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0)

View File

@@ -30,7 +30,7 @@ float4 main(float4 pos : sv_position) : sv_target
} }
[test] [test]
todo(sm<4 | glsl | msl) draw quad todo(sm<4 | glsl) draw quad
probe (0, 0) f32(1, 0, 0, 1) probe (0, 0) f32(1, 0, 0, 1)
probe (1, 0) f32(1, 2, 3, 4) probe (1, 0) f32(1, 2, 3, 4)
probe (0, 1) f32(1, 2, 3, 4) probe (0, 1) f32(1, 2, 3, 4)

View File

@@ -18,7 +18,7 @@ float4 main(float4 pos : sv_position) : sv_target
} }
[test] [test]
todo(sm<4 | glsl | msl) draw quad todo(sm<4 | glsl) draw quad
probe (10, 10) rgba (8.0, 8.0, 8.0, 8.0) probe (10, 10) rgba (8.0, 8.0, 8.0, 8.0)
probe (11, 10) rgba (8.0, 8.0, 8.0, 8.0) probe (11, 10) rgba (8.0, 8.0, 8.0, 8.0)
probe (12, 10) rgba (10.0, 10.0, 10.0, 10.0) probe (12, 10) rgba (10.0, 10.0, 10.0, 10.0)