-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
sokol: update to match upstream at c0e0563 #21971
Conversation
According to https://en.wikipedia.org/wiki/OpenGL#OpenGL_4.3 OpenGL 4.3 is from August 6, 2012 ... it also says that OpenGL 3.3 (previous version) was released two years prior, on March 11, 2010 |
For me, that update breaks
|
Everything looks fine on macos 14.5, on my m1. |
Everything looks fine on Windows 11 with latest drivers for NVIDIA GeForce RTX 3050 too. |
|
With a small patch, it worked on my old Linux desktop as well:
|
Shader related sokol examples do not work too on Linux, even with the patch above:
|
They do work, after manually running:
(The default that was used is: |
This patch to vshader.v, restores the old behaviour (fixes it for my older Linux desktop):
|
What is weird, is that even just settting Perhaps setting an explicit version != 0, makes it request that version on the C side, instead of trying to autodetect the maximum possible; i.e. with that, it tries to request OpenGL 4.0, which works on my machine, unlike 4.3 . |
Yep, changing // NOTE: can't patch the default for gl_major_version and gl_minor_version
// independently, because a desired version 4.0 would be patched to 4.2
// (or expressed differently: zero is a valid value for gl_minor_version
// and can't be used to indicate 'default')
if (0 == res.gl_major_version) {
#if defined(_SAPP_APPLE)
res.gl_major_version = 4;
res.gl_minor_version = 1;
#else
res.gl_major_version = 4;
res.gl_minor_version = 3;
#endif
} to using (the vshader.v patch is still needed) |
…rt OpenGL 4.3 (use 4.1 instead, just like on macos)
Thanks for the help 🙇🏼♂️ I think the const default_slangs = $if macos { ... } $else { ... } is not needed at all then? |
Are they only going to need to be identical for older versions of linux? Ubuntu 20.04 is fairly old... they're stopping standard support for it next year. |
I think that the OpenGL level of support, depends on the hardware/drivers, more than on the OS itself. Setting |
hm, good spot; the 2 branches are identical and can be merged, as they were before indeed. |
I think, that keeping the same default, and minimizing the breakage is better for the already existing sokol and gg apps. |
We could probably add an opt in mechanism, based on |
@larpon thank you very much for the update 🙇🏻♂️ . I know how time consuming, it could be to update a thirdparty dependency like Sokol , and how hard it is to test it well, given all the combinations. |
Thanks a lot @larpon 🙇♂️ |
This is also my understanding - it has a lot to do with the hardware, vendor and available drivers. |
"Back in the day" you could sometimes be lucky that some brave soul had time to maintain a ppa on launchpad that provided newer drivers + libGL versions. But alas, as time goes by, these ppa's often go offline and/or become unavailable/unmaintained etc. I'm not sure what camp I'm in when it comes to supporting old linux distros. A part of me think it is a major shame that support for older distros is not better/easier and a part of me can see the benefits of moving forward in some cases. I think I'm mostly in the "keep-things-running-for-as-long-as-possible -camp", though. So in this case @spytheman 's changes makes sense to me. I was on Ubuntu 20.04 as well not long ago (some of the first examples I contributes to V was written on 20.04 🥲 ) |
(Sorry for the user confusion |
This PR updates all our sokol headers to upstream commit c0e0563 (latest as per today). All previous patches should have been carried over except for the patch in
sokol_audio.h
which has been merged upstream (thanks to @kimshrier ❤️) - support for the new shader versions has also been updated invshader
.It is worth noting that, with this update, the minimum required version of OpenGL is now 4.3 on Linux and 4.1 on macOS (previous version was 3.3). The bump in requirements is, as I understand it, because of the ongoing work towards compute shader support. So with this update, there's introduced support for storage buffers in shaders which is the main cause of the bumped OpenGL version requirements. Support for storage buffers on Android is not done according to floooh (the author of sokol).
I do not have a full overview of how much this version change will impact our graphics support in general.
I have tested the sokol, sokol shader and
gg
examples - which all work on my distro. I am unsure if older distros will break 🤷