crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
927 stars 83 forks source link

Setup SWVP toggle for mixed mode devices #188

Closed WinterSnowfall closed 4 weeks ago

WinterSnowfall commented 1 month ago

Not entirely sure why this wasn't being done in the first place, as devices created with D3DCREATE_MIXED_VERTEXPROCESSING expect this to work properly and there are some games that require dynamically switching between the two.

In the case of either D3DCREATE_SOFTWARE_VERTEXPROCESSING or D3DCREATE_HARDWARE_VERTEXPROCESSING devices, the call to SetSoftwareVertexProcessing() will simply fail, but we can safely ignore that. In fact D3D8 will never return anything other than D3D_OK for any SetRenderState() calls.

WinterSnowfall commented 4 weeks ago

I've refactored this to be a bit more elegant and not spam D3D9 with calls we know would fail anyway. The end effect is identical.