D3D speedups

This PR picks 4 commits of galop1n's D3D branch which are simple d3d backend changes.
I was going to say "quibbling" but I'm not sure galop1n would know this word :p