New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adaptive CRT shader compatibility fixes for really old GPUs #3172
Conversation
73c897a
to
10f32ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in windowed and fullscreen with various resolutions. Thanks!
Check at least a few modified shaders for performance regressions. |
Did check "sharp", "crt-auto" and "none" and got around 140fps which is the highest score you'll get on this machine. |
Tested on my Intel ARC, no problems found. |
Tested CGA, Tandy, EGA, VGA (various), and VESA modes on the Pi4 (Broadcom OpenGL 4.x compatible) and found no problems. |
Not possible to introduce any by commenting unused stuff out. |
Thanks for the testing guys. Can someone approve this then please @kcgen @Burrito78 @FeralChild64 |
Having two many branches result in a black screen (but no compilation errors) on some older GPUs such as the Intel HD 4000 iGPU. So we're commenting out the branches that are not used by the adaptive CRT shaders.
10f32ea
to
e53456f
Compare
Description
Fixes #3114
@Burrito78 kindly gave me remote desktop access to his problematic old MacMini with an Intel HD 4000 iGPU that displays only a black screen when using any of the new adaptive CRT shaders. I was able to pinpoint the problem by the time-tested method of trial and error, also known as "just dicking around" in some circles 馃槑
The problem seems to be that there's just too much branching going on in one of the functions. GLSL is still a fairly high-level language at the end of the day, and the shader compilers try to do their best to optimise per-pixel branching away. This branching code is not a problem at all on more recent GPUs (7-8 years old), but on this ancient 10+ year old iGPU, the shader compiles without errors, but somehow, who knows how and why, it just displays a black screen at runtime... Commenting out some of the branches fixes it, so the solution I adopted is to comment every branch of the function out that is not used by the adaptive shaders. This is an attempt to pre-empt similar problems on other weird old GPUs.
For the record, the problem could not be reproduced on my $200 bottom-of-the-barrel mini laptop I bought in 2015 which also has an Intel iGPU, but a more recent model. So I have reason to believe the issue could only manifest on ancient 10+ year old GPUs...
Disclaimer
Yes, I know that it's absolutely horrible that I have 22 copies of the exact same (!) shader code, just with different settings... 馃ザ But we have no preset support, so this was the only practical way to release my set of shaders this year (and to do this before eXoDOS v6 is out, so our shader work can be included) using our current shader pipeline which is very barebones.
I have plans for how to make this a lot nicer in the future; most likely these 22 copies will be replaced by a single shader, and I'll just send it different settings at runtime when there's a "shader change" (which is really just a "preset change"). But that's for the future... 馃槃
Manual testing
Tested a few fixed shaders on Burrito's box to make sure I understood the problem.
Regression tested all fixed shaders on my M1 MacBook to make sure they still work.
Checklist
Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.
I have: