From 9ec7f26fae3f6e7f6461c086db0134bb721f25c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 3 Sep 2023 19:42:42 +0200 Subject: [PATCH] Revert "Re-add glDrawRangeElements() workaround for Emscripten." This reverts commit 6bb0179c65b3813203d2caf12d75e58f650da87f from 2018, which in turn reverted commit f6ba4111e1669b254da8f0dafdbb5d9cb6df364a, which in turn reverted commit 4ce28752626102a2acfcc8a72e057eb2e86b4ad4 from 2015. The related Emscripten PR was merged in 2018, so it's safe to assume everything works as expected nowadays. Which also means I can finally delete my Emscripten fork that contained the original branch that attempted to add glDrawRangeElements() in May 2015, before WebGL 2 was even supported in Emscripten, or Firefox. --- doc/changelog.dox | 2 ++ src/Magnum/GL/Mesh.cpp | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 678387861..11689011a 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -598,6 +598,8 @@ See also: renamed from `EXT_draw_buffers_indexed` and `EXT_clip_cull_distance` in March 2020 and January 2023. The old names are still recognized and present in @ref GL::Extensions for compatibility with older browsers. +- Re-enabled @fn_gl{DrawRangeElements} for WebGL 2, this time hopefully for + the last time (see [mosra/magnum#97](https://github.com/mosra/magnum/issues/97)) @subsubsection changelog-latest-changes-math Math library diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index ef21abaad..0d0ad32f2 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -854,10 +854,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i /* Indexed mesh */ } else { - /** @todo re-enable once https://github.com/kripken/emscripten/pull/7112 - is merged and Emscripten versions with this change are - widespread enough */ - #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) + #ifndef MAGNUM_TARGET_GLES2 /* Indexed mesh with specified range */ if(indexEnd) { glDrawRangeElements(GLenum(_primitive), indexStart, indexEnd, count, GLenum(_indexType), reinterpret_cast(indexByteOffset));