*ENABLING* DWM in Borderless Windowed Fullscreen
#1
I've been encountering a problem I did not understand with PCSX2:
Games run perfectly when in a bordered window, but once I hit alt-enter to fullscreen it I get lots of screen tearing.

This was strange to me, since my understanding at the time was that there should be no difference between a bordered window and a fullscreen borderless window aside from dimensions. PCSX2 does not support exclusive fullscreen. I have vsync turned off in PCSX2 because of the negative performance impact it brings in certain in-game locations. I just want the exact experience I get from a bordered window in a borderless one, and I couldn't think of any reason why that wasn't what was happening.

After much digging I believe I've figured it out. There IS a difference between a bordered window and a fullscreen borderless window. The Desktop Window Manager (aka compositor) in Windows runs whenever you are not in exclusive fullscreen mode as a layer between applications and the display. It sports its own triple-buffered vsync which is the reason I do not get screen tearing when in a bordered window!

But why is borderless windowed fullscreen any different? Well, lots of people seemingly hate DWM and I can understand why. It is forced vsync that can contribute input latency, and especially in gaming contexts users resent having so important a decision made for them. The vast majority of search results for DWM are about how to disable it. Over years of development, Microsoft brought more control to applications for bypassing it and has created more situations where it will get out of the way. I came away from this research with the impression that the differences and tradeoffs between exclusive fullscreen and borderless windowed fullscreen have eroded significantly over time with improvements made to both. The end result is that today borderless windowed fullscreen does not necessitate that DWM be active.

It is unclear to me whether PCSX2 is responsible for bypassing DWM -- which would be highly defensible given how most users seem to want that -- or whether Windows is somehow deciding that. But whatever the situation, the vsync I get from DWM seemingly outperforms the vsync option within PCSX2 by a substantial margin. With DWM I never drop below 60fps and have no screen tearing, while without it I have to pick one or the other. It is certainly possible that I am experiencing some other downside with DWM such as discarded frames or input lag, but any issues I may be trading for are not noticed by me.

I have 2 questions:
1) Does it seem like I've properly diagnosed the source of differences between bordered windowed and borderless windowed fullscreen? Am I missing anything?
2) Is there any option available to me to ensure that borderless windowed fullscreen behaves no differently from bordered windowed? I.e. keep DWM?

Perhaps proving my theory, I actually did manage to accomplish my goal! I installed a program called "Borderless Gaming" that purports to make any application borderless windowed fullscreen. When I did this with PCSX2 I was able to run in fullscreen with no screen tearing or slowdowns! It looks to me like this program implements borderless windowed fullscreen in a way that behaves the same as bordered windows (i.e. with DWM), whereas PCSX2's does not. Unfortunately, the "Borderless Gaming" program is unmaintained and caused lots of problems ultimately forcing me to reinstall PCSX2. Do not install it. Ideally there is some other application out there that can do the same thing. Even more ideally, there's some way within a PCSX2 ini or some such for me to resolve this without external help Smile.


SPECS (which I don't expect matter since they're the same whether I'm fullscreen or not)
Windows 10
Nightly PCSX2 build
AMD Ryzen 5 5600x
AMD Radeon RX 5600 XT (all special features in the AMD software disabled)
60 fps monitor not doing anything funky
Reply

Sponsored links

#2
A potential hint in the right direction:
"Borderless Gaming" set PCSX2 to borderless but then could not restore the border since it is bugged. Even after I removed all traces of Borderless Gaming and redownloaded the PCSX2 exe, it was still opening as borderless windowed fullscreen. I resolved the issue by deleting the row with "MainWindowGeometry" from PCSX2.ini.

This suggests to me that PCSX2 could do borderless windowed fullscreen in a way that preserves DWM if the right value for "MainWindowGeometry" were set.
Reply
#3
I saw another post from a user having issue with vsync in vulkan. I switched to openGl and it appears to have no screen tearing with vsync off and better performance with it on.
Reply




Users browsing this thread: 1 Guest(s)