airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
206 stars 11 forks source link

stage.displayState Fullscreen Interactive is not Exclusive Fullscreen Mode, does not bypass DWM #441

Open TheDiakou opened 4 years ago

TheDiakou commented 4 years ago

Air/Flash/Actionscript has no way of going into true exclusive fullscreen mode. Which means you are not able to disable Desktop Windows Manager or have the application take full control of the screen which bypasses and disables DWM. This has an incredibly big performance and latency penalty especially as time goes on and makes AIR very outdated for games on Windows.

https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/for-best-performance--use-dxgi-flip-model

AIR not being able to use a correct flip model presentation or allow developers of AIR games control this is very problematic for the future of AIR in games on Windows.

TheDiakou commented 4 years ago

@ajwfrost sorry for tagging, but is it wrong of me to assume that this most likely will never be bothered or cared about given that it's on desktop and Harman's focus will be primarily mobile?

In reality, this has caused problems ever since DWM became a forced addition to windows. The other part is that AIR on desktop has also been bugged for years regarding targetFrameRate=60 and 60hz monitors. Most 60hz monitors are natively 59.94 due to old implementations from TV days, thus AIR causes a penalty delay of ~20ms in a game because I assume of it trying to constantly reach 60fps, but never being able to since 60hz monitors are not true 60hz. Setting it to 59.8 alleviates this problem or simply having a monitor that is way past 60fps (120hz, using 61-75hz monitors usually alleviates the problem by a little) Edit: with further inspection, it's actually most likely a result of constantly missing the v-blank timing when monitors at 59.94 and target fps attempting to be at 60, so it's completely pushed onto the next frame constantly.

However that's besides the point. If helping implement options for correct flip models / allowing apps to go into true fullscreen mode, thus bypassing DWM is not a possibility for you guys or on the roadmap, it would be very appreciated if you could let us know. Using AIR while this problem exists is very much a no-go on desktop in 2020.

hardcoremore commented 4 years ago

@TheDiakou @ajwfrost Could this be the reason for this bug on Windows as well (where it does not exists on Mac Os X at all):

https://github.com/Gamua/Adobe-Runtime-Support/issues/307

because my game is also running in full screen but on Mac that issue is not present.

Adolio commented 4 years ago

@TheDiakou @ajwfrost Maybe my difficulties to get a proper fullscreen resolution on Windows could be solved by implementing an Exclusive Fullscreen Mode.

Here is the forum thread about this topic: https://forum.starling-framework.org/d/22652-windows-10s-dpi-scaling-and-adobe-air

ajwfrost commented 4 years ago

Hi - interesting thread, we can take a look at this .. @TheDiakou the mobile platforms do tend to get more focus but that's mostly because they have more problems reported.. we do want to support the desktop users though, so input like this is really useful. Part of our problem is that we don't necessarily know about these sorts of problems before we're told!

I think there are two issues here that we need to look at: 1) going into an exclusive full screen mode and using the DirectFlip approach to improve performance 2) work out an approach to cope with different scaling modes for high-DPI displays

The first of these is fairly clear, but for the second, I'm not fully clear on what people are wanting; there's a danger in us changing the behaviour of any of the existing APIs or Capabilities properties as that might impact any workarounds that people have had, but if this is just an API to get the 'real' resolutions, device scale factors, and perhaps to disable the Windows scaling-awareness for the AIR app, then it might be possible?

thanks

TheDiakou commented 4 years ago

Thank you for taking a serious look at it @ajwfrost there will most likely be some odd behaviors for some games when engaging in a full screen exclusive mode, it is hard to say, in general most AIR games run with a presentation mode called COPY WITH GPU GDI, which is very outdated these days. Another aspect is handling sync methods for devs regarding v-sync off/on behaviors, as a default, DWM handles all these things to a "decent" enough level, but without the options for both the users and developers, not having ways to design applications around DWM going to sleep/being bypassed is very limiting.

I never expected a reply in all honesty when making the post, but it delights me to know that there is support/updates available for desktop. This specific issue is very problematic to not have options for moving forward (as clearly stated by microsoft) mainly because of their Full screen Optimization integrations into newer versions of windows(Which turns exclusive full screen into a borderless version called Independent Flip, within 99% margin of performance gained from Full screen Exclusive) and DWM severely ruining performance of applications that need all the resources available.

Once again, thank you for taking a look at this, I'll be patiently waiting for an update allowing us to implement true exclusive full screen in our games for windows desktop.

Adolio commented 4 years ago

Thank you @ajwfrost for your prompt reply.

I have created this new thread (https://github.com/Gamua/Adobe-Runtime-Support/issues/483) to give you further details about my issue.