diff options
| author | Andre Weissflog <floooh@gmail.com> | 2025-10-23 19:31:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-23 19:31:17 +0200 |
| commit | 1d8d4e27ee82016daf6acb9aa978e1ae3f934d88 (patch) | |
| tree | 14a26c6c67a4833412ac9f7159352c5a7eee5506 | |
| parent | 78d2c6db1c37f045862c79cd9040c46c405a150f (diff) | |
| parent | f724dce75c9bf3abb86f8e52e5386f335c40010f (diff) | |
Merge pull request #1363 from floooh/sokol-gfx-gl-feature-defines
sokol_gfx.h gl: fix static GL feature detection defines
| -rw-r--r-- | CHANGELOG.md | 7 | ||||
| -rw-r--r-- | sokol_gfx.h | 36 |
2 files changed, 33 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 188cfada..47402fdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ PR: https://github.com/floooh/sokol/pull/1362 +- sokol_gfx.h gl: fix a somewhat esoteric regression in the GL backend + feature detection code when an external GL loader is used which provides + a GL version older than 4.6. This regression was introduced in PR + https://github.com/floooh/sokol/pull/1347. + + Fix PR: https://github.com/floooh/sokol/pull/1363 + ### 21-Oct-2025 - sokol_spine.h: merged PR https://github.com/floooh/sokol/pull/1361 which diff --git a/sokol_gfx.h b/sokol_gfx.h index 5f2fd6f7..8f1af9f7 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -5436,11 +5436,17 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ // broad GL feature availability defines (DON'T merge this into the above ifdef-block!) #if defined(_WIN32) - #define _SOKOL_GL_HAS_COMPUTE (1) - #define _SOKOL_GL_HAS_TEXSTORAGE (1) - #define _SOKOL_GL_HAS_TEXVIEWS (1) - #define _SOKOL_GL_HAS_BASEVERTEX (1) - #define _SOKOL_GL_HAS_BASEINSTANCE (1) + #if defined(GL_VERSION_4_3) || defined(_SOKOL_USE_WIN32_GL_LOADER) + #define _SOKOL_GL_HAS_COMPUTE (1) + #define _SOKOL_GL_HAS_TEXVIEWS (1) + #endif + #if defined(GL_VERSION_4_2) || defined(_SOKOL_USE_WIN32_GL_LOADER) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #define _SOKOL_GL_HAS_BASEINSTANCE (1) + #endif + #if defined(GL_VERSION_3_2) || defined(_SOKOL_USE_WIN32_GL_LOADER) + #define _SOKOL_GL_HAS_BASEVERTEX (1) + #endif #elif defined(__APPLE__) #if defined(TARGET_OS_IPHONE) && !TARGET_OS_IPHONE #define _SOKOL_GL_HAS_BASEVERTEX (1) @@ -5453,12 +5459,22 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #define _SOKOL_GL_HAS_COMPUTE (1) #define _SOKOL_GL_HAS_TEXSTORAGE (1) #elif defined(__linux__) || defined(__unix__) - #define _SOKOL_GL_HAS_COMPUTE (1) - #define _SOKOL_GL_HAS_TEXSTORAGE (1) - #define _SOKOL_GL_HAS_BASEVERTEX (1) #if defined(SOKOL_GLCORE) - #define _SOKOL_GL_HAS_TEXVIEWS (1) - #define _SOKOL_GL_HAS_BASEINSTANCE (1) + #if defined(GL_VERSION_4_3) + #define _SOKOL_GL_HAS_COMPUTE (1) + #define _SOKOL_GL_HAS_TEXVIEWS (1) + #endif + #if defined(GL_VERSION_4_2) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #define _SOKOL_GL_HAS_BASEINSTANCE (1) + #endif + #if defined(GL_VERSION_3_2) + #define _SOKOL_GL_HAS_BASEVERTEX (1) + #endif + #else + #define _SOKOL_GL_HAS_COMPUTE (1) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #define _SOKOL_GL_HAS_BASEVERTEX (1) #endif #endif |