-
-
Notifications
You must be signed in to change notification settings - Fork 896
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change #6173: Update SDL driver to use SDL 2.0 #7086
Conversation
The number to pay attention to on those screenshots: Video output has decreased from 4 ms to 2 ms with the SDL 2 driver. |
Also worth mentioning is that this changes the SDL driver from software rendering to hardware rendering, which has to potential to cause problems since we're now relying on the user's graphics drivers. I've seen this branch segfault when the program starts on an old Mac mini I have, running Linux and the nouveau DRI drivers. This computer can run OpenTTD with SDL 1.2 just fine, and obviously we don't want to introduce this regression. So I'll need to implement a software rendering fallback using either SDL_CreateSoftwareRenderer() or SDL_CreateRenderer() with the SDL_RENDERER_SOFTWARE flag. I'm not sure exactly how to "fall back" to the software renderer, but I'm sure there's some examples around. I'll take a look. |
4496b98
to
0a60edb
Compare
Alright, I've gotten a chance to debug the issue on the Mac mini system I mentioned above. It's working fine with an update I just made to this branch: using a renderer created with the Anyways, we're not losing anything by using software rendering here, as that's how it currently works. Please test this branch, anyone who's able and willing, and let me know of any problems you see! |
Of course CI fails for linux because SDL2-dev is not installed |
Hmm, I can't see the exact libsdl failure - though I'm not used to Azure. I see a bunch of messages like "Unable to find image 'openttd/compile-farm-ci:linux-amd64-gcc-6' locally" here: https://github.com/OpenTTD/OpenTTD/pull/7086/checks?check_run_id=55198664 Anyways, this Dockerfile would need to be updated to include |
It fails on configure, https://github.com/OpenTTD/CompileFarm/blob/master/base-linux/Dockerfile needs an udpate |
If you go to the Azure results, here: https://dev.azure.com/openttd/OpenTTD/_build/results?buildId=607 |
c3493e4
to
07dd81c
Compare
ea749d0
to
cf22438
Compare
@stormcone Good to hear it works with the Nouveau driver, but let me know when you're able to test this with the Nvidia proprietary driver again. |
@nikolas Thank you. :) I tried out your new commit with the disabled hardware acceleration and now the game starts normally. I can use the menu and start a new game. So looks like that commit solves the problem. :) Edit: I mean with the NVIDIA driver. |
Confirmed, now runs |
Simulation rate is still consistently running at 1.02x (for me) but that's the same as SDL1, so I'm not too concerned about it |
d535ec5
to
8306506
Compare
I'm on nikolas/OpenTTD@8306506; linux; sdl 2.0.9
Also, thanks for fixed #7296 |
Wow, it works, thanks |
@nielsmh this is ready for another review, since known issues are now fixed. Just fyi. |
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.
Nearly there, I think :)
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.
👍
6f21eea
to
e69eb4e
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.
Minor, but it triggered my OCD :P
This has been working well for me. Based on the documentation here: https://wiki.libsdl.org/MigrationGuide
Will require testing on different setups.
Here's the FPS window on both old and new SDL, rendering a whole map.
SDL 1.2:
SDL 2.0:
closes #7296