dxwrapper icon indicating copy to clipboard operation
dxwrapper copied to clipboard

[d3d9] Windowed Mode stutters every few seconds

Open deanff opened this issue 7 months ago • 6 comments
trafficstars

In windowed mode, there is a ~10 FPS drop (from 144 FPS) every few seconds. Tested with two D3D9 games - Hitman Blood Money and Call of Cthulhu: DCotE. Issue is present in the last five releases of dxwrapper.

deanff avatar Mar 28 '25 14:03 deanff

Does the same issue happen without dxwrapper when running the games in window mode?

Try setting one of these options:

ForceVsyncMode             = 0
SetSwapEffectShim          = 0
DisableMaxWindowedMode     = 0
ForceDirect3D9On12         = 0
GraphicsHybridAdapter      = 0

These change the way d3d9 works with the OS.

elishacloud avatar Mar 28 '25 15:03 elishacloud

My original settings are below: EnableD3d9Wrapper = 1 EnableVSync = 1 EnableWindowMode = 1

Even with Vsync disabled, the stutters are noticeable.

Just to be clear, do you want me to test the following instead? EnableD3d9Wrapper = 1 EnableWindowMode = 1 ForceDirect3D9On12 = 1

This had noticeable stutters - but maybe I'm misinterpreting what you mean by "without dxwrapper".

deanff avatar Mar 28 '25 15:03 deanff

Even with Vsync disabled, the stutters are noticeable.

The game may enable vsyc. Its better to have dxwrapper force it off by enabling ForceVsyncMode and keeping EnableVSync disabled.

Just to be clear, do you want me to test the following instead? EnableD3d9Wrapper = 1 EnableWindowMode = 1 ForceDirect3D9On12 = 1

I wouldn't test them all enabled at the same time. I would try them one-by-one.

but maybe I'm misinterpreting what you mean by "without dxwrapper".

Disabling EnableD3d9Wrapper will effectively disable dxwrapper for this game. Another way is to delete the dxwrapper.dll file and the stub file. That will also disable dxwrapper.

elishacloud avatar Mar 28 '25 15:03 elishacloud

Does the same issue happen without dxwrapper when running the games in window mode?

Neither game has a windowed mode.

The game may enable vsyc. Its better to have dxwrapper force it off by enabling ForceVsyncMode and keeping EnableVSync disabled.

The game runs around 700 FPS with EnableVSync disabled and ForceVsyncMode enabled.

Try setting one of these options

Tried each of them individually (plus EnableD3d9Wrapper and EnableWindowMode), but the stutters were still present.

deanff avatar Mar 28 '25 16:03 deanff

I suspect the issue is related to something else and not dxwrapper. Since the issue only happens in windowed mode, which is a mode where other application can interfere with the game. Whereas in exclusive fullscreen mode Windows gives the game a boost to reduce the effect of other applications on the game.

I recommend you try increasing the priority of the game. It might help. Otherwise try disabling everything on the device (including your AV). Something on your computer is likely doing things every few seconds causing the slowdown.

elishacloud avatar Mar 28 '25 17:03 elishacloud

Hi Elisha. That was it. Well, kinda...

I closed everything, restarted my computer, increased the priority of the process to Realtime - but the stutter was still there. Then I disabled Windows Real-Time Protection and the stutter was gone. Turning it back on and adding the game process to Exclusions resulted in a silky smooth 144 FPS. Before, when I set LimitPerFrameFPS to 60 FPS, it would sit around ~58, but with the Exclusion it stayed at 60 FPS. I tested dxwrapper on two other laptops (one Win10, one Win11, both 60 Hz) and did not see any stutter. I figured the problem must just be with my gaming laptop (Win11, 144 Hz, RTX 4060). Worth noting: dgVoodoo's windowed mode did not have any stutter on my gaming laptop.

New development: I set the game to use Integrated Graphics and the stutter was gone. I went back to one of the other laptops and set it to use NVIDIA 940MX instead of Intel and noticed choppy performance. Uninstalled NVIDIA App + PhysX + Frame Viewer + Driver and restarted, but the performance issues remained. Added an Exclusion for the game process... AND STILL the performance issues were present. Deleted the Exclusion and tried dgVoodoo, and the game ran smooth.

dxwrapper and dgVoodoo appear to be polar opposites here... dgVoodoo runs choppy with Intel, and smooth with NVIDIA. dxwrapper runs choppy with NVIDIA, and smooth with Intel. The first one makes more sense to me - though it's worth mentioning the game runs smoothly on Intel 620 with no wrapper.

In the end, I set my gaming laptop's Display Mode in NVIDIA Control Panel to AUTO instead of NVIDIA GPU Only. Lost some features in the Panel, but now there's no stuttering with dxwrapper no matter which GPU I run the game with.

Anyway, I don't know what to make of all this. I had previously considered the smooth alt-tabbing in dxwrapper to be an advantage over dgVoodoo's black screen for ~1 sec. But perhaps dgVoodoo's windowed mode has certain compatibility advantages. What are your thoughts on all this?

deanff avatar Mar 29 '25 19:03 deanff

Can you try with the latest build. This issue should be fixed: dxwrapper.zip

elishacloud avatar Oct 04 '25 02:10 elishacloud

Hi Elisha, No stutters to report. :) Though it looks like the brightness menu in windowed mode is non-functional again. https://github.com/elishacloud/dxwrapper/issues/297

deanff avatar Oct 13 '25 09:10 deanff

Though it looks like the brightness menu in windowed mode is non-functional again.

Yes, I fixed this issue in #441.

elishacloud avatar Oct 13 '25 19:10 elishacloud

Cool. Thanks for that.

deanff avatar Oct 13 '25 20:10 deanff