Work on D3D11 for various state settings. This code sucks. Needs a rewrite.