Just putting this here so it's not forgotten about. The following potential issues are being addressed in DXVK and also exist here:
Vertex positions are assumed to be invariant, but FXC does not generate consistent code (mad vs mul + add even for identical subexpressions), so we need to explicitly emit mul + add to get consistent code gen and avoid issues like SotTR, for which we currently have an app profile.
Precise mad is only emitted for the HLSL mad intrinsic in a precise context, so we should still be able to emit FFma for that.
Even non-precise dpX instructions appear to get treated as a unit on native D3D drivers and are not further transformed even if there would be spec-compliant ways for doing so. We haven't seen many games rely on this besides https://github.com/doitsujin/dxvk/issues/4162.
Just putting this here so it's not forgotten about. The following potential issues are being addressed in DXVK and also exist here:
madvsmul + addeven for identical subexpressions), so we need to explicitly emitmul + addto get consistent code gen and avoid issues like SotTR, for which we currently have an app profile.madis only emitted for the HLSLmadintrinsic in a precise context, so we should still be able to emitFFmafor that.dpXinstructions appear to get treated as a unit on native D3D drivers and are not further transformed even if there would be spec-compliant ways for doing so. We haven't seen many games rely on this besides https://github.com/doitsujin/dxvk/issues/4162.