VKD3D_SM4_SWIZZLE_NONE is incorrect; the token contains a mask in this
case.
Which is still no swizzle. :) I.e., I'd argue this is more of a matter of interpretation than necessarily being incorrect.
+ if (mask == VKD3DSP_WRITEMASK_0) + src_param->swizzle = VKD3D_SHADER_SWIZZLE(X, X, X, X); + else if (!mask) + src_param->swizzle = 0; + else if (mask != VKD3DSP_WRITEMASK_ALL) + FIXME("Unhandled mask %#x.\n", mask);
Note that "0" above is effectively "VKD3D_SHADER_SWIZZLE(X, X, X, X)". That applies to the "VKD3D_SM4_DIMENSION_NONE" case as well.
The most significant change in patch 1/2 seems replacing usage of shader_sm4_is_scalar_register() with checking for VKD3D_SM4_DIMENSION_SCALAR. The other change I see is changing some cases (e.g. VKD3D_SM4_DIMENSION_VEC4 + VKD3DSP_WRITEMASK_0) from VKD3D_SHADER_NO_SWIZZLE to VKD3D_SHADER_SWIZZLE(X, X, X, X). That's probably fine, both those might as well be two separate changes.
Patch 2/2 is similar; it introduces usage of "dimension", and then tweaks a couple of cases. Separating those changes would probably make it more obvious what's going on.