Fullscreen sometimes throws DXGI_ERROR_NOT_CURRENTLY_AVAILABLE

Started by
21 comments, last by captain_crunch 7 years, 8 months ago

The OS chooses a default adapter, but the application always has the final choice. D3D11CreateDevice takes an adapter as the first parameter. I see you're using C#, and I'm not sure how the wrappers expose that, but it should still be there. The default render adapter selection is (typically) based on which monitor is marked as the primary monitor (where the system tray is located).

The monitor is an optional parameter to SetFullscreenState, if you enumerate it yourself. If you don't, we go for the monitor where the window is currently located. If that's not attached to the GPU that you're using for rendering, you can't go fullscreen**. The monitor where the window launches is kind of random.

It depends on the laptop, whether the external outputs are connected to the integrated or discrete GPU. Both scenarios are fully supported.

** The one exception is in the Optimus/PowerXPress case, where we enable fullscreen with discrete GPU rendering and an integrated output.

Im writing in C# and I have a function that enums the adaptor and all the modes. This allows for you to select the adaptor and the screen attributes (say refresh) that are valid. I post it later today.

Indie game developer - Game WIP

Strafe (Working Title) - Currently in need of another developer and modeler/graphic artist (professional & amateur's artists welcome)

Insane Software Facebook

Advertisement

The user with 3 monitors tells me he only has one GPU.

Another user gets the error with 1 monitor and 1 GPU.


using DXGI = SharpDX.DXGI;

        /*----------------------------------------------------------------------
        *
        * 
        * 
        *
        *----------------------------------------------------------------------*/

         DXGI.Output getAdaptors()
        {
            SharpDX.DXGI.Factory1 dxgiFactory = new SharpDX.DXGI.Factory1();
            DXGI.Output lastoutput = null;
            foreach (var dxgiAdapter in dxgiFactory.Adapters)
            {
                foreach (var output in dxgiAdapter.Outputs)
                {
                    foreach (var format in Enum.GetValues(typeof(SharpDX.DXGI.Format)))
                    {
                        var displayModes = output.GetDisplayModeList(
                            (SharpDX.DXGI.Format)format,
                            SharpDX.DXGI.DisplayModeEnumerationFlags.Interlaced
                            | SharpDX.DXGI.DisplayModeEnumerationFlags.Scaling
                        );

                        foreach (var displayMode in displayModes)
                        {
                            if (displayMode.Scaling == SharpDX.DXGI.DisplayModeScaling.Unspecified)
                            {
                                int displayWidth = displayMode.Width;
                                int displayHeight = displayMode.Height;
                                DXGI.Rational displayRefresh = displayMode.RefreshRate;

                                lastoutput = output;
                            }
                        }
                    }
                }
            }
            return lastoutput;
        }

As promised, this should go through and enum the adapter/outputs/displaymodes.

Indie game developer - Game WIP

Strafe (Working Title) - Currently in need of another developer and modeler/graphic artist (professional & amateur's artists welcome)

Insane Software Facebook

OK. But when the error can occur on a 1 monitor, 1 GPU setup, it's not so useful.

Are these users maybe launching the app from some 3rd party launcher (eg. Launchy, Wox, Keypirhina)? They could be holding on to the focus after they launch the app, until they consider the launch operation complete. Repeating the SetFullScreen process a little later (maybe 500ms) might fix it, if so.

They are launching from the Steam client program. Some of them even have other games running.

Okay, I guess that qualifies as a 3rd party launcher. Do Steam offer any tech support, because this might be a common issue with their software. This combination does seem to be quite common, if what I see on Google is any indication.

I'll try that.

One of the users tells me he can get the crash if he launches the game and then immediately clicks somewhere else. This would make sense if it is enough to take focus from the game right before it tries to set fullscreen mode.

Some users get the error without any clicking. Also, the logged information shows that the window is in focus when it happens.

It is frustrating that no solutions exist for this error.

This topic is closed to new replies.

Advertisement