Reduce minimum required OpenGL version from 3.3.0 to 2.1.0, and other fixes #3

Merged
xavi merged 3 commits from gl-renderer into main 2025-01-08 00:48:26 +01:00
Owner

Overview

3.3.0 was required only because car.frag was arbitrarily requiring GLSL 3.3.0. However, it was already compatible with GLSL 1.1.0, so the minimum required OpenGL version can be safely lowered to 2.1.

On the other hand, this PR suggests some minor fixes related to OpenGL and shaders.

Further reference

## Related PRs - https://forge.a-lec.org/speed-dreams/speed-dreams-data/pulls/3 ## Overview 3.3.0 was required only because [`car.frag`](https://forge.a-lec.org/speed-dreams/speed-dreams-data/src/commit/a9082f8fe78767acccce4668ef272963d40d9527/data/data/shaders/car.frag#L1) was arbitrarily requiring GLSL 3.3.0. However, it was already compatible with GLSL 1.1.0, so the minimum required OpenGL version can be safely lowered to 2.1. On the other hand, this PR suggests some minor fixes related to OpenGL and shaders. ## Further reference - https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.10.pdf - https://en.wikipedia.org/wiki/OpenGL#Version_history
xavi added 3 commits 2025-01-02 01:50:52 +01:00
SDL_GL_CreateContext can fail due to several reasons, such as
GLXBadFBConfig on unsupported OpenGL versions.
3.3.0 was required only because two shaders, namely car.frag and
water.frag, were arbitrarily requiring GLSL 3.3.0. However, those were
already compatible with GLSL 1.1.0, [1] so the minimum required OpenGL
version can be safely lowered to 2.1. [2]

[1]: https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.1.10.pdf
[2]: https://en.wikipedia.org/wiki/OpenGL#Version_history
Even if "none" shaders were selected, the game would still parse
car.frag and execute the shaders, which is not the expected behaviour.
xavi force-pushed gl-renderer from cdc2b88400 to 582efe9ede 2025-01-02 01:57:45 +01:00 Compare
xavi force-pushed gl-renderer from 582efe9ede to 532118848a 2025-01-03 01:46:58 +01:00 Compare
xavi force-pushed gl-renderer from 532118848a to e0b766bc6e 2025-01-03 12:43:36 +01:00 Compare
xavi force-pushed gl-renderer from e0b766bc6e to a32322d3d6 2025-01-04 13:28:27 +01:00 Compare
xavi force-pushed gl-renderer from a32322d3d6 to 8f230211bb 2025-01-07 00:29:01 +01:00 Compare
Author
Owner

Shaders have been successfully tested on the following hardware:

$ glxinfo | grep 'version'
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.6.0 NVIDIA 390.157
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 390.157
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.157
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions,
$ glxinfo | grep 'version'
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0
OpenGL version string: 2.1 Mesa 23.2.1-1ubuntu3.1~22.04.3
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 23.2.1-1ubuntu3.1~22.04.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

Which confirms that shaders do work on hardware with GLSL < 3.3.0.

Shaders have been successfully tested on the following hardware: ``` $ glxinfo | grep 'version' server glx version string: 1.4 client glx version string: 1.4 GLX version: 1.4 OpenGL core profile version string: 4.6.0 NVIDIA 390.157 OpenGL core profile shading language version string: 4.60 NVIDIA OpenGL version string: 4.6.0 NVIDIA 390.157 OpenGL shading language version string: 4.60 NVIDIA OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.157 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 GL_EXT_shader_group_vote, GL_EXT_shader_implicit_conversions, ``` ``` $ glxinfo | grep 'version' server glx version string: 1.4 client glx version string: 1.4 GLX version: 1.4 Max core profile version: 0.0 Max compat profile version: 2.1 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 2.0 OpenGL version string: 2.1 Mesa 23.2.1-1ubuntu3.1~22.04.3 OpenGL shading language version string: 1.20 OpenGL ES profile version string: OpenGL ES 2.0 Mesa 23.2.1-1ubuntu3.1~22.04.3 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16 ``` Which confirms that shaders do work on hardware with `GLSL < 3.3.0`.
xavi merged commit 53a758688e into main 2025-01-08 00:48:26 +01:00
xavi deleted branch gl-renderer 2025-01-08 00:48:39 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: speed-dreams/speed-dreams-code#3
No description provided.