SPIR-V already handled DSX/DSY, so only D3DBC/TPF needed new case blocks. You'll notice that there's no test for this one - in addition to being a pretty straightforward translation for all possible formats, this feature uses the render target width/height and I wasn't sure if there was a good way to ensure that the test would always make sense. Instead, I did the test manually, and it's what you'd expect: HLSL: ``` uniform float f; float4 main() : sv_target { float4 x = ddx(f); float4 y = ddy(f); return x + y; } ``` D3DBC: ``` ps_3_0 mov r0.x, c0.x dsx r1.x, r0.x dsy r0.x, r0.x mov r1.xyzw, r1.x mov r0.xyzw, r0.x add r0.xyzw, r1.xyzw, r0.xyzw mov oC0.xyzw, r0.xyzw ``` DXBC-TPF: ``` ps_4_0 dcl_constantBuffer cb0[1], immediateIndexed dcl_output o0.xyzw dcl_temps 2 mov r0.x, cb0[0].x dsx r0.y, r0.x dsy r0.x, r0.x mov r1.xyzw, r0.y mov r0.xyzw, r0.x add r0.xyzw, r1.xyzw, r0.xyzw mov o0.xyzw, r0.xyzw ret ``` -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/179