crosire / d3d8to9

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

Fix vertical sync issues #87

Closed elishacloud closed 5 years ago

elishacloud commented 5 years ago

This pull request will fix #85. It might also be a fix for #47, but I don't have a G-Sync monitor so I cannot test is.

The issue is that the default presentation interval is D3DPRESENT_INTERVAL_DEFAULT in both d3d8 and d3d9. However in d3d9 when using this interval it does not do vertical sync. Changing this to D3DPRESENT_INTERVAL_ONE fixes the issue. See what Microsoft says about this here:

Added D3DPRESENT_INTERVAL_IMMEDIATE, which means that the presentation is not synchronized with the vertical sync. As in DirectX 8.x, D3DPRESENT_INTERVAL_DEFAULT is defined as zero and is equivalent to D3DPRESENT_INTERVAL_ONE.

Note: I think this is a bug in Windows 10 since D3DPRESENT_INTERVAL_DEFAULT and D3DPRESENT_INTERVAL_ONE are supposed to be the same even in d3d9. However apparently they are not. Manually changing this fixes the issue.