libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.23k stars 1.83k forks source link

Fullscreen mode woes in windows 10 #7430

Open andres-asm opened 6 years ago

andres-asm commented 6 years ago

First and foremost consider this:

Description

All drivers exhibit weird fullscreen mode on my PC (haven't tried on a clear windows installation)

GL:

Vulkan:

D3D10-11-12

D3D9

Expected behavior

On windowed fullscreen, alt-tab should be immediate, other apps should be able to draw on top, windows volume overlay should work

On exclusive fullscreen, other stuff can't draw on top so what all apps I've seen are just forcefully minimized on alt-tab.

Actual behavior

[What is actually happening]

andres-asm commented 6 years ago

Did another test with all drivers with a streaming program that does NOT support exclusive fullscreen apps. When a exclusive fullscreen app is detected you get a message indicating it's not supported.

Results: Not a single driver triggered the alert, all of them kept recording.

Tried games: SFIV (D3D9), Doom in GL and Vulkan, all of them triggered the alert as intended

Awakened0 commented 6 years ago

Tested some of this stuff with the latest Win64 nightly on Win10 with 398.82 Nvidia drivers:

Vulkan and GL Windowed and exclusive fullscreen both block the volume overlay and there is a two second or so delay on switching to windowed mode or alt-tabbing. Usually the first alt-tab or windowed mode switch after launching RetroArch has no delay. Sometimes the delay happens when exiting RA as well, usually if I've alt-tabbed or switched from windowed to fullscreen at least once. Gsync activates in both windowed and exclusive modes, even though I have windowed mode Gsync unchecked in the Nvidia CP.

D3D9 Volume overlay shows up in both windowed and exclusive fullscreen. Gsync only activates in exclusive. There is no delay in alt-tabbing or switching to windowed mode in windowed fullscreen. Exclusive fullscreen has some delay in either.

D3D10 and D3D11 Volume overlay shows up in both windowed and exclusive fullscreen. Gsync doesn't activate in either exclusive or windowed fullscreen modes. No delay in alt-tabbing or switching to windowed mode in windowed or exclusive fullscreen.

D3D12 Gsync activates in exclusive and windowed fullscreen. Interestingly, when the volume overlay is active, the refresh rate shoots up to max (from 60 to 120 in XMB with menu throttling on). Other behaviors are the same as D3D10 and 11.

andres-asm commented 6 years ago

Thanks, yeah seem pretty much in-line with my findings.

Ryunam commented 6 years ago

What I’ve observed personally is that (at least with the GL driver), unless “Disable Desktop optimizations” is checked from within the Properties of the RA executable, Exclusive Fullscreen doesn’t seem to be activated properly, resulting in hitching and stuttering when you have two monitors with differing refresh rates.

Can you try checking that option as well and seeing if it makes a difference on your system? When I disable optimizations, Exclusive Fullscreen blocks any external overlay from being displayed (volume included) and I get perfect smoothness even with the aforementioned dual monitor setup.

andres-asm commented 5 years ago

@Ryunam it still is not detected as exclusive on GL by the application I'm using to stream it. Anyway I don't have hitching or anything, but the alt-tab issue is really annoying.

brianblakely commented 5 years ago

Is this behavior not pervasive to all Vulkan/GL-based games on Windows?

andres-asm commented 5 years ago

Which part of all of it?

brianblakely commented 5 years ago

@fr500 All of the "Expected Behavior" in the OP.

andres-asm commented 5 years ago

Definitely not

brianblakely commented 5 years ago

@fr500 I tried a few examples of Vulkan renderers, running in borderless fullscreen. None of them compose as-expected with Windows UI elements, such as the volume bar.

Which exceptions do we know exist?

andres-asm commented 5 years ago
Expected behavior

On windowed fullscreen, alt-tab should be immediate, other apps should be able to draw on top, windows volume overlay should work

On exclusive fullscreen, other stuff can't draw on top so what all apps I've seen are just forcefully minimized on alt-tab.

Alt-tab used to be immediate in all drivers. Now it isn't. The volume overlay is not really important it was just some extra info I thought might be relevant.

klepp0906 commented 5 years ago

Ha, glad i found this. Ive been asking all over and surprised this hasnt turned up more frequently/recently considering how major it is.

I too cannot get exclusive fullscreen to function. Essentially borderless and fullscreen on/off are one in the same. No volume overlay in either "mode" no forced minimize in either mode.

this is with the GL driver but i tried vulkan as well. Happens at the menu with no games running even.

cfg shows as fullscreen enabled and windowed bordlerss disabled, but i dont get fullscreen.

I have windows FSO disabled universally ala the registry but I checked the box in compatability settings anyways. No change.

klepp0906 commented 5 years ago

any way to get this moved up the priority ladder? It would be great if it actually functioned as fullscreen exclusive when the windowed fullscreen toggle was off.

This has several performance ramifications not to mention it limits options for remoteplay/streaming capture methods.

is it something that one would bounty? or something that can/should be fixed internally? I cant even begin to guess how hard or otherwise this would be to address - but its been brought to light a solid year ago at this point so I figured it was due for the equivalent of a bump ;p

klepp0906 commented 5 years ago

another check for the "not actually full screen" box.

tried using retroarch with launchbox. It has an emulator startup delay slider that will display the startup screen for the designated amount of time UNLESS the emulator launches in fullscreen, then theres nothing it can do about it displaying before the predetermined time setting.

This is actually ideal. A good practice is to max out the slider (30 seconds) and then if you have your emulator set to exclusive fullscreen, the startup screen will display until the emulator is loaded then the emulator takes focus. Saves you from dialing it in.

While my retroarch is set as exclusive full screen (always has been) when this setting is set to 30 seconds, it actually takes 30 seconds before it'll even show retroarch, meaning its not running in full screen mode.

klepp0906 commented 5 years ago

also not picked up by NVFBC capture which ironically is a workaround for several issues while streaming, due to NVFBC only capturing full screen applications. Course NVFBC is now deprecated on windows 10 - so eggs dont belong in that basket anymore anyhow I guess.

interesting here https://forums.libretro.com/t/borderless-windows-fullscreen-vs-true-fullscreen/2099 considering its my understanding disabling aero is impossible in win10 and perhaps the reason this issue is a thing? a major thing at that >.<

if you google, its been around for years. id really hate to think i actually have to open a bounty to have this looked into, but at this point - no idea what else to do. Ive been through multiple video cards, dozens of drivers, every setting that exists in RA and the NVCP.

it doesnt happen elsewhere. Anything I tell to go FSE, its FSE. Just RA and its a huge impediment in more ways than just performance.

klepp0906 commented 5 years ago

also worth noting (not sure if relevant or not) - that attempting to hit spacebar on top of the resolution selection results in retroarch basically hanging. It tries to refresh itself as you would expect (i imagine trying to set itself to fullscreen based on desktop resolution or something) but results in a second instance of retroarch opening to a black screen (if you mouse over taskbar tehre are 2 RA's.

looks like one is closing (as the display is faded almost to black, whereas the new one is just black.

wondering if its related to this having multiple entries for 4k, or if thats purely aesthetic and unrelated. (or maybe it shows twice cause i have 2 monitors?) lol.

image

image

at this point its been stuck in borderless windowed for about ever.

also figure ill mention, previous streaming issues were all cirumvented by changing buffer flipping from flip to block transfer via the gl force blit ON setting in the nvidia drivers.

does nothing for this of course, but in case its all intertwined i figure its worth mentioning as i imagine if exclusive fullscreen was functioning as such, i dont think id need to force block transfer.

Rinnegatamante commented 5 years ago

Don't know if related to this issue however there's a bug in wgl context resize code where it always return false even when succeed: https://github.com/libretro/RetroArch/blob/302e2fdc531972a358fffdba0051ec6434622db0/gfx/drivers_context/wgl_ctx.c#L510

Awakened0 commented 5 years ago

I've heard of this mode called DirectFlip that supposedly combines the best elements of Windowed and True full screen modes: https://www.resetera.com/threads/g-sync-thread.5961/page-17#post-22153851

But it sounds like Microsoft needs to fix some kinks left in it's implementation before it'll be available for all apps.

Immersion95 commented 4 years ago

I can confirm the issue with 2 laptops (Open GL, d3d11, Vulkan). One with Nvidia card and the other one with Intel GPU. My desktop works fine with OpenG and AMD card.

brianblakely commented 4 years ago

G-Sync doesn't work with the d3d11 driver. It looks like exclusive fullscreen isn't initializing. Everything works as expected with d3d12, glcore, and vulkan.

inactive123 commented 4 years ago

Exclusive fullscreen is required for G-Sync to work?

On Wed, Aug 12, 2020 at 8:18 PM Brian Blakely notifications@github.com wrote:

G-Sync doesn't work with the d3d11 driver. It looks like exclusive fullscreen isn't initializing. Everything works as expected with d3d12, glcore, and vulkan.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/7430#issuecomment-673033222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGQSQL5TLPPAD4PFJH7WTSALMFNANCNFSM4F3J2B7Q .

brianblakely commented 4 years ago

Exclusive fullscreen is required for G-Sync to work?

Windowed fullscreen is available as a setting in the NVIDIA Control Panel's G-Sync options, but it isn't the default because it tends to be buggy.

Awakened0 commented 3 years ago

I just saw that flip mode was added for the d3d11 driver. Flip mode is the ultimate full screen mode on Windows 10, with all the benefits of exclusive and borderless modes in one. I tested it out and it works about as well as expected. Gsync works, tabbing out is quick and you can even see the Windows volume overlay. d3d12 also works the same way, so I assume that's using flip mode now too.

The only issue I have is that fast forward is limited to my maximum refresh rate. So it will only FF up to 144FPS. I couldn't figure out a way to get around that; tried setting Vsync to Application Controlled and disabling Ultra Low Latency in the Nvidia driver, but that didn't help. I don't have any external frame limiter running either. Vulkan still runs as fast as possible when FFing in exclusive fullscreen.

Lately I've been losing exclusive full screen (and Gsync) when I go to windowed mode and back to full screen with Vulkan. This doesn't happen with d3d11 or 12 with the new flip mode, so I might stick with one of those now despite the FF limit.