I've had a relatively harmless problem with the my current graphics card since I've bought it. Recently, I've reached the part in which Casey adds SIMD and multi-threaded rendering to his engine which makes it practically run great at max resolution 1920x1080 60fps.
At this point I've noticed that the problem I've mentioned above started to appear when running the code in fullscreen at 60fps. You can see what the problem is in the following images:
Now I will try to give more details about this issue. I am running the code under Windows 7 - 64 with a Gigabyte 1050 Windforce gpu. This "bug" manifests itself in two variants when I use the windows+d (show desktop) command to switch repeatedly between a window and the desktop. First, when aero is disabled, some horizontal lines are visible on the screen, as if there were holes when the window is being rendered. Second, when aero is enabled, the patterns presented in the sample images above can be seen on the screen.
In the handmade hero code I've managed to better reproduce the problem by changing the function Win32DisplayBufferInWindow to clear the whole buffer with PatBlt, before the StretchDIBits call, once with WHITENESS and once with BLACKNESS, as can be seen from pictures 6 to 16. Initially Casey only uses PatBlt to clear the area around what is actually being rendered (I noticed that even Casey had an annoying screen flicker when he tried to PatBlt the whole buffer).
This is the second gpu of this type that I've tested and both had this issue. It only happens on desktop activity, in games (2D, 3D) I have no problems at all; the temperature stays at a maximum of 63-64 degrees, so I don't think it's a hardware problem. Also, I've tried different drivers but it didn't help.
I've managed to bypass this by doing one of the following:
- limit the fps to 30;
- run everything at a lower resolution;
- force the code to disable the windows desktop composition with the function DwmEnableComposition(DWM_EC_DISABLECOMPOSITION).
Also, when I try to printscreen and paste the image in Gimp, it comes out clean, without the artifacts visible in the photos.
From my point of view it seems like a synchronization problem (from the first 5 images it looks like the traditional image tearing case, more or less) but since I lack any windows programming experience, or how windows communicates with the gpu, I wanted to present this problem here hoping that maybe someone encountered something similar at some point.
Thank you in advance.