Enumerating display modes takes a long time if monitors are attached analog #290
Comments
Your issue can be solved if both GraphicsOutput.CurrentDisplayMode and GraphicsOutput.SupportedDisplayModes properties will be made lazy-initializable - in other words, they can be initialized once when the getter is called first time. However, I am not sure if this approach is safe enough. We will discuss this internally and will make a decision. |
Oh, good to know that it can take some time on some specific setup, but unless you are not using Game class, they are used internally to find the best resolution in GamePlatform class. Though the whole code for matching the closest resolution could use only a DXGI method already available for that. This is a bit of legacy code inherited from XNA behavior, we will try to see how we can fix that. Thanks |
…dBestDevices no longer retrieve the list of all available modes. For fullscreen, rely on DXGIOutput.FindClosestMatchingMode instead.
I have pushed a first try to fix this issue. I have tested it only on Desktop, but It could be broken on others. Let me know if this is working with your setup. |
thanks for this! i'll have a look and report back about the startupspeed. |
hi, so still a little bit slower, but a lot faster! thanks! |
It is good to hear that the issue is more-or-less fixed. The commit above added lazy-initialization for these functions - so they are called only when needed. Is it ok to close this issue? |
the toolkit is enumerating the display modes of each output. if the monitors are attached via analog (vga) this takes a long time. in our specific case we have 4 analog monitors attached to one graphics card and the startup process is more than a minute because of this.
specifically the time is lost in is this DX11 function:
IDXGIOutput::GetDisplayModeList
i was wondering if the toolkit could be configured in a way to skip this enumeration, since it is not absolutely necessary.
in SharpDX.Toolkit.Graphics.GraphicsOutput.cs : 112
one could just return an empty list of displaymodes like so:
var modes = new ModeDescription[] { };
i was already looking for a way to make this configurable and would provide a pull request, but couldnt find a nice way to do so besides carrying a flag through the whole callstack.
is there another way to make such things configurable?
The text was updated successfully, but these errors were encountered: