Video card issue

Hello everyone,
a few days ago I updated the video card driver, after which I noticed that all the games I coded with MonoGame have a very jerky and irregular movement when they are in fullscreen mode (with HardwareModeSwitch = false). If I go into window mode, the games are perfectly smooth again. I tried to change as many settings as possible of the video card but the problem in fullscreen mode remains. To make sure the issue was related to updating the video card, I went back to a previous restore point and the games returned smoothly as before. Then I reinstalled the new version of the driver and the problem came back. Could it be an incompatibility issue between MonoGame and the latest versions of video card drivers? Or could there be a problem in the driver itself that will perhaps be fixed in the future? Do you have any suggestions about this?
I use Windows 10, Intel i7-7700 CPU, Radeon RX 560 video card, Visual Studio Enterprise 2015, Monogame v.3.7.1.189. All the games are MonoGame Windows Projects.

I tried to create a MonoGame Cross Platform Desktop Project (GL) and the result is the same: smooth in windowed mode and very jerky and erratic in fullscreen mode.

I have to correct myself: after restarting Visual Studio, the OpenGL project is smooth even in fullscreen mode.

It seems that the problem can be solved with the following lines of code when in fullscreen mode:

graphics.HardwareModeSwitch = true;
graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width;
graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;

It’s strange, however, that the problem was never revealed using the previous versions of the video card driver. Now I’ll have to rebuild and repost all my games. Patience…

Why aren’t you setting an IsFullscreen flag.

Obviously I set it up. Before updating the video card driver the code was as follows:

graphics.IsFullScreen = true;
graphics.HardwareModeSwitch = false;

It worked perfectly. But after updating the driver, as I said, my games were very jerky.
So I changed the code as follows:

graphics.IsFullScreen = true;
graphics.HardwareModeSwitch = true;

So the games were smooth again. In this way, however, I had another problem: I use a 4K monitor and a screen scaling of 200% (DPI). When exiting a game with Graphics.HardwareModeSwitch set to true, previously opened windows are moved and shrunk and some icons in the system tray become blurry. I have noticed this behavior with games made by others or even old console emulators that use fullscreen mode.
Changing the code as follows:

graphics.IsFullScreen = true;
graphics.HardwareModeSwitch = true;
graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width;
graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;

I don’t have the problem of resized windows and blurry icons.
The only flaw is that if, during development, I start the game from Visual Studio and an exception occurs, I find myself with a gray screen covering everything else making it impossible for me to use the PC. In that case I just have to restart.

I want to mention that the lines

graphics.IsFullScreen = true;
graphics.HardwareModeSwitch = false;

produce jerky games for Windows projects only while they work perfectly for OpenGL projects.

Another thing I don’t like about using Graphics.HardwareModeSwitch set to true is that when I alt+tab, the game’s thumbnail window doesn’t display the game but just a gray window.

I also want to specify that the lines

graphics.IsFullScreen = true;
graphics.HardwareModeSwitch = false;

produce smooth games even with Windows projects on PC with video card other than Radeon RX 560.

3.8 had some big changes, maybe you’ll have better luck there with the Windows app templates.

It may just be an issue with your older version, so you’re unlikely to get support from the developers unless you see it in the latest version and maybe open an issue on github if it’s still present.

Installed VS 2019, MG 3.8 and created a simple Windows project (DirectX). In full screen mode and with HardwareModeSwitch = false the game is still jerky.
At this point I will stick with MG 3.7 and convert my projects from Windows to OpenGL.
Waiting for someone else to run into the same problem as me and that it will be solved.

That seems like a completely different problem.
I repeat that my games have always been smooth until I updated the video card driver.
I repeat that the games are still smooth on other PCs with different video cards.
I repeat that in windowed mode (no fullscreen) the games are still smooth.
I repeat that the same code on OpenGL projects produces smooth games.
I also noticed that if, after launching a game, I switch to another window and then go back to the game screen, it feels smooth for a few moments but then starts to jerk again.
I think there is some incompatibility between MonoGame and the updated video card driver.

I repeat open an issue on GitHub. None of us can snap our fingers and fix your GPU driver/DirectX rendering problems.

I have also experienced irregularities between OpenGL and DirectX, if you want it fixed you can bring it to the developers’ attention. I’m sure they would appreciate you documenting it.

Setting HardwareModeSwitch = false is known to cause performance issues in some cases, which is what you are doing.

2 Likes

As I said, I found the solution myself. I’m converting all my projects from Windows to OpenGL so I’m sure I’m okay (at least until the next video card update :smile:).
I don’t know if I’ll open an issue on GitHub. The problem seems difficult to solve since it only happens with one video card model and only with a particular driver update. It cannot be ruled out that the problem lies in the driver software itself. So, again, the solution is called OpenGL.