Fix XFB scaling in D3D

Redoes PR #1208 but rebased on top of master.