From 173472616be55cbc4083fd5d47a4019c0a9a786f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 20 Feb 2026 19:54:01 +0100 Subject: [PATCH] GL: this array sizing was weird. For some reason it had the full set of elements on ES2 as well, i.e. something that definitely shouldn't be the case. Unfortunately C doesn't warn if the array isn't initialized for all elements, setting the remaining to 0, so this was uncaught until now. Now if I accidentally make the array too small somewhere, it'll blow up inside BufferState.cpp. --- src/Magnum/GL/Implementation/BufferState.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Magnum/GL/Implementation/BufferState.h b/src/Magnum/GL/Implementation/BufferState.h index ad2581191..e43f29a14 100644 --- a/src/Magnum/GL/Implementation/BufferState.h +++ b/src/Magnum/GL/Implementation/BufferState.h @@ -43,12 +43,12 @@ namespace Magnum { namespace GL { namespace Implementation { struct BufferState { enum: std::size_t { - #ifndef MAGNUM_TARGET_WEBGL + #ifdef MAGNUM_TARGET_GLES2 /* ES2 and WebGL 1 */ + TargetCount = 2+1, + #elif defined(MAGNUM_TARGET_WEBGL) /* WebGL 2 */ + TargetCount = 8+1, + #else /* ES3 and desktop */ TargetCount = 13+1 - #elif !defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL) - TargetCount = 8+1 - #else - TargetCount = 2+1 #endif };