Browse Source

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.
next
Vladimír Vondruš 2 months ago
parent
commit
173472616b
  1. 10
      src/Magnum/GL/Implementation/BufferState.h

10
src/Magnum/GL/Implementation/BufferState.h

@ -43,12 +43,12 @@ namespace Magnum { namespace GL { namespace Implementation {
struct BufferState { struct BufferState {
enum: std::size_t { 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 TargetCount = 13+1
#elif !defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)
TargetCount = 8+1
#else
TargetCount = 2+1
#endif #endif
}; };

Loading…
Cancel
Save