Page 1 of 1

[0.17.56] Blue Flash on window focus loss with "Use flip presentation model"

Posted: Sun Jul 14, 2019 8:13 pm
by pcmaster160
I'm on Windows 10, I have 3 monitors connected, all are different resolutions but the one I play Factorio on is 4k with DPI scaling. When I have "Use flip presentation model" enabled and select a window other than Factorio there is 1 frame with a "blue flash". The flash does not occur when I am recording with OBS so I am unable to post a screenshot but it does not make the entire frame blue but rather puts a blue hue on everything. It is similar to the "red flash" when your player gets hurt. If I am on the settings menu when I select another window the normally orange checkboxes turn blue.

This occurs when "focusing" a window other than factorio (selecting it) and when "focusing" factorio when another window was selected. It does not happen when "Use flip presentation model" is disabled. It also does not happen when "Use flip presentation model" is enabled and OBS is recording with a source of the 4k monitor (but does occur when the source is another monitor).

Graphics Settings:
Image

Hardware:
GPU: AMD 270x 2gb
CPU: Intel i7-7700

Re: [0.17.56] Blue Flash on window focus loss with "Use flip presentation model"

Posted: Sun Jul 14, 2019 9:20 pm
by posila
Thank you for taking the time to report the issue.
Please post also your log. Press Win + R, type in %APPDATA%\Factorio and click OK. File Explorer should open and you should see file called factorio-current.log.
pcmaster160 wrote: Sun Jul 14, 2019 8:13 pmIf I am on the settings menu when I select another window the normally orange checkboxes turn blue.
Does it look like this?
bgr.png
bgr.png (336.25 KiB) Viewed 2127 times

Re: [0.17.56] Blue Flash on window focus loss with "Use flip presentation model"

Posted: Mon Jul 15, 2019 3:00 am
by pcmaster160
Yes! It looks just like that!

Log is attached.

Re: [0.17.56] Blue Flash on window focus loss with "Use flip presentation model"

Posted: Mon Jul 15, 2019 6:08 am
by posila
Thanks. I have created that image by swapping red and blue color channel. So my hypothesis is that for some reason (probably some kind of under-the-hood optimization) DirectX or the graphics driver decides to render image in BGR color format instead of RGB, and when the game loses focus, this optimization is turned off, but there was already prepared next frame for presentation in the wrong format, so it gets incorrectly presented with red and blue color channels swapped.

Thank you again for reporting the issue, it's good for us to be aware of all weird things that might happen and know how to workaround them (turning off flip presentation model in this case)