From 79191044dfb8820cd17c28be4d5bf34684801ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 18 Feb 2024 13:50:42 +0100 Subject: [PATCH] GL: implement EXT_buffer_storage. For some reason I didn't see that there's an ES variant of ARB_buffer_storage since 2015 when implementing it in 75d238f50bd377caf56d1f7a9170b8921d9a7ee5. --- doc/changelog.dox | 3 +- doc/opengl-support.dox | 1 + src/Magnum/GL/Buffer.cpp | 13 +++- src/Magnum/GL/Buffer.h | 68 ++++++++++++++----- src/Magnum/GL/Context.cpp | 3 + src/Magnum/GL/Extensions.h | 23 ++++--- src/Magnum/GL/Implementation/BufferState.cpp | 2 +- src/Magnum/GL/Implementation/BufferState.h | 2 +- src/Magnum/GL/Test/BufferGLTest.cpp | 22 +++++- .../OpenGL/GLES3/extensions.txt | 1 + src/MagnumExternal/OpenGL/GLES3/flextGL.h | 20 ++++++ .../OpenGL/GLES3/flextGLPlatform.cpp | 3 + .../OpenGL/GLES3/flextGLPlatformIOS.cpp | 6 ++ .../GLES3/flextGLPlatformWindowsDesktop.cpp | 3 + .../OpenGL/GLES3/flextGLWindowsDesktop.h | 20 ++++++ 15 files changed, 153 insertions(+), 37 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index be5e8ebdc..1233209b0 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -186,7 +186,8 @@ See also: - Recognizing the @gl_extension{NV,geometry_shader_passthrough} extension - Added a @ref GL::AbstractTexture::target() getter to simplify interaction with raw GL code -- Exposed @gl_extension{ARB,buffer_storage} as +- Exposed the @gl_extension{ARB,buffer_storage} desktop and + @gl_extension{EXT,buffer_storage} ES extensions as @ref GL::Buffer::setStorage() together with additions to @ref GL::Buffer::MapFlag - It's now possible to modify index offset via @ref GL::Mesh::setIndexOffset() diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 98ca66377..82cbb8e7c 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -481,6 +481,7 @@ Extension | Status @gl_extension{EXT,texture_norm16} | done @gl_extension{EXT,texture_sRGB_R8} | done @gl_extension{EXT,texture_sRGB_RG8} | done +@gl_extension{EXT,buffer_storage} | done @gl_extension{EXT,blend_func_extended} | done @gl_extension{EXT,polygon_offset_clamp} | | @gl_extension{EXT,clip_cull_distance} | done diff --git a/src/Magnum/GL/Buffer.cpp b/src/Magnum/GL/Buffer.cpp index b426315a9..63c124220 100644 --- a/src/Magnum/GL/Buffer.cpp +++ b/src/Magnum/GL/Buffer.cpp @@ -345,7 +345,7 @@ Buffer& Buffer::bind(const Target target, const UnsignedInt index) { } #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Buffer& Buffer::setStorage(const Containers::ArrayView data, const StorageFlags flags) { Context::current().state().buffer.storageImplementation(*this, data, flags); return *this; @@ -488,11 +488,18 @@ void Buffer::copyImplementationDSA(Buffer& read, Buffer& write, const GLintptr r #endif #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void Buffer::storageImplementationDefault(Buffer& self, Containers::ArrayView data, StorageFlags flags) { - glBufferStorage(GLenum(self.bindSomewhereInternal(self._targetHint)), data.size(), data.data(), GLbitfield(flags)); + #ifndef MAGNUM_TARGET_GLES + glBufferStorage + #else + glBufferStorageEXT + #endif + (GLenum(self.bindSomewhereInternal(self._targetHint)), data.size(), data.data(), GLbitfield(flags)); } +#endif +#ifndef MAGNUM_TARGET_GLES void Buffer::storageImplementationDSA(Buffer& self, Containers::ArrayView data, const StorageFlags flags) { glNamedBufferStorage(self._id, data.size(), data.data(), GLbitfield(flags)); } diff --git a/src/Magnum/GL/Buffer.h b/src/Magnum/GL/Buffer.h index 4f85d91f4..18152b569 100644 --- a/src/Magnum/GL/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -530,25 +530,35 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { Unsynchronized = GL_MAP_UNSYNCHRONIZED_BIT_EXT, #endif - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /** * Allow reading from or writing to the buffer while it is mapped. * @m_since_latest - * @requires_gl44 Extension @gl_extension{ARB,buffer_storage} - * @requires_gl Buffer storage is not available in OpenGL ES and - * WebGL, use @ref setData() instead. + * @requires_es_extension OpenGL ES 3.1 and extension + * @gl_extension{EXT,buffer_storage} + * @requires_gles Buffer storage is not available in WebGL, use + * @ref setData() instead. */ + #ifndef MAGNUM_TARGET_GLES Persistent = GL_MAP_PERSISTENT_BIT, + #else + Persistent = GL_MAP_PERSISTENT_BIT_EXT, + #endif /** * Shared access to buffer that's both mapped and used will be * coherent. * @m_since_latest - * @requires_gl44 Extension @gl_extension{ARB,buffer_storage} - * @requires_gl Buffer storage is not available in OpenGL ES and - * WebGL, use @ref setData() instead. + * @requires_es_extension OpenGL ES 3.1 and extension + * @gl_extension{EXT,buffer_storage} + * @requires_gles Buffer storage is not available in WebGL, use + * @ref setData() instead. */ + #ifndef MAGNUM_TARGET_GLES Coherent = GL_MAP_COHERENT_BIT + #else + Coherent = GL_MAP_COHERENT_BIT_EXT + #endif #endif }; @@ -564,7 +574,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { typedef Containers::EnumSet MapFlags; #endif - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /** * @brief Buffer storage flag * @m_since_latest @@ -572,8 +582,10 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * @see @ref StorageFlags, @ref setStorage() * @m_enum_values_as_keywords * @requires_gl44 Extension @gl_extension{ARB,buffer_storage} - * @requires_gl Buffer storage is not available in OpenGL ES and WebGL, - * use @ref setData() instead. + * @requires_es_extension OpenGL ES 3.1 and extension + * @gl_extension{EXT,buffer_storage} + * @requires_gles Buffer storage is not available in WebGL, use + * @ref setData() instead. */ enum class StorageFlag: GLbitfield { /** Allow the buffer to be mapped with @ref MapFlag::Read. */ @@ -583,20 +595,36 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { MapWrite = GL_MAP_WRITE_BIT, /** Allow the buffer to be mapped with @ref MapFlag::Persistent. */ + #ifndef MAGNUM_TARGET_GLES MapPersistent = GL_MAP_PERSISTENT_BIT, + #else + MapPersistent = GL_MAP_PERSISTENT_BIT_EXT, + #endif /** Allow the buffer to be mapped with @ref MapFlag::Coherent. */ + #ifndef MAGNUM_TARGET_GLES MapCoherent = GL_MAP_COHERENT_BIT, + #else + MapCoherent = GL_MAP_COHERENT_BIT_EXT, + #endif /** * Allow the buffer to be updated with @ref setSubData(). Note that * the buffer can still be updated through @ref copy() even without * this flag present. */ + #ifndef MAGNUM_TARGET_GLES DynamicStorage = GL_DYNAMIC_STORAGE_BIT, + #else + DynamicStorage = GL_DYNAMIC_STORAGE_BIT_EXT, + #endif /** Prefer to allocate the memory in client memory space. */ + #ifndef MAGNUM_TARGET_GLES ClientStorage = GL_CLIENT_STORAGE_BIT + #else + ClientStorage = GL_CLIENT_STORAGE_BIT_EXT + #endif }; /** @@ -605,8 +633,10 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * * @see @ref setStorage() * @requires_gl44 Extension @gl_extension{ARB,buffer_storage} - * @requires_gl Buffer storage is not available in OpenGL ES and WebGL, - * use @ref setData() instead. + * @requires_es_extension OpenGL ES 3.1 and extension + * @gl_extension{EXT,buffer_storage} + * @requires_gles Buffer storage is not available in WebGL, use + * @ref setData() instead. */ typedef Containers::EnumSet StorageFlags; #endif @@ -1073,7 +1103,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { Buffer& bind(Target target, UnsignedInt index); #endif - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /** * @brief Set storage * @param data Data @@ -1087,8 +1117,10 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * @fn_gl2_keyword{NamedBufferStorage,BufferStorage}, eventually * @fn_gl{BindBuffer} and @fn_gl_keyword{BufferStorage} * @requires_gl44 Extension @gl_extension{ARB,buffer_storage} - * @requires_gl Buffer storage is not available in OpenGL ES and WebGL, - * use @ref setData() instead. + * @requires_es_extension OpenGL ES 3.1 and extension + * @gl_extension{EXT,buffer_storage} + * @requires_gles Buffer storage is not available in WebGL, use + * @ref setData() instead. */ Buffer& setStorage(Containers::ArrayView data, StorageFlags flags); @@ -1380,8 +1412,10 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { void MAGNUM_GL_LOCAL createIfNotAlready(); - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) static void MAGNUM_GL_LOCAL storageImplementationDefault(Buffer& self, Containers::ArrayView data, StorageFlags flags); + #endif + #ifndef MAGNUM_TARGET_GLES static void MAGNUM_GL_LOCAL storageImplementationDSA(Buffer& self, Containers::ArrayView data, StorageFlags flags); #endif @@ -1474,7 +1508,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { CORRADE_ENUMSET_OPERATORS(Buffer::MapFlags) #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) CORRADE_ENUMSET_OPERATORS(Buffer::StorageFlags) #endif diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index dbc3c880e..fc1454224 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -380,6 +380,9 @@ constexpr Extension ExtensionList[]{ Extensions::ARM::shader_framebuffer_fetch{}, Extensions::ARM::shader_framebuffer_fetch_depth_stencil{}, Extensions::EXT::blend_func_extended{}, + #ifndef MAGNUM_TARGET_GLES2 + Extensions::EXT::buffer_storage{}, + #endif Extensions::EXT::clip_control{}, #ifndef MAGNUM_TARGET_GLES2 Extensions::EXT::clip_cull_distance{}, diff --git a/src/Magnum/GL/Extensions.h b/src/Magnum/GL/Extensions.h index 7012b91c9..410e067fc 100644 --- a/src/Magnum/GL/Extensions.h +++ b/src/Magnum/GL/Extensions.h @@ -513,20 +513,21 @@ namespace ANDROID { _extension( 75,EXT,texture_norm16, GLES310, None) // #207 _extension( 76,EXT,texture_sRGB_R8, GLES300, None) // #221 _extension( 77,EXT,texture_sRGB_RG8, GLES300, None) // #223 + _extension( 78,EXT,buffer_storage, GLES310, None) // #239 #endif - _extension( 78,EXT,blend_func_extended, GLES200, None) // #247 - _extension( 79,EXT,polygon_offset_clamp, GLES200, None) // #252 + _extension( 79,EXT,blend_func_extended, GLES200, None) // #247 + _extension( 80,EXT,polygon_offset_clamp, GLES200, None) // #252 #ifndef MAGNUM_TARGET_GLES2 - _extension( 80,EXT,clip_cull_distance, GLES300, None) // #257 - _extension( 81,EXT,texture_compression_rgtc, GLES300, None) // #286 - _extension( 82,EXT,texture_compression_bptc, GLES300, None) // #287 - #endif - _extension( 83,EXT,texture_compression_s3tc_srgb, GLES200, None) // #289 - _extension( 84,EXT,clip_control, GLES200, None) // #290 - _extension( 85,EXT,texture_mirror_clamp_to_edge, GLES200, None) // #291 - _extension( 86,EXT,depth_clamp, GLES200, None) // #309 + _extension( 81,EXT,clip_cull_distance, GLES300, None) // #257 + _extension( 82,EXT,texture_compression_rgtc, GLES300, None) // #286 + _extension( 83,EXT,texture_compression_bptc, GLES300, None) // #287 + #endif + _extension( 84,EXT,texture_compression_s3tc_srgb, GLES200, None) // #289 + _extension( 85,EXT,clip_control, GLES200, None) // #290 + _extension( 86,EXT,texture_mirror_clamp_to_edge, GLES200, None) // #291 + _extension( 87,EXT,depth_clamp, GLES200, None) // #309 } namespace IMG { - _extension( 87,IMG,texture_compression_pvrtc, GLES200, None) // #54 + _extension( 88,IMG,texture_compression_pvrtc, GLES200, None) // #54 } namespace KHR { _extension( 89,KHR,texture_compression_astc_ldr,GLES200, GLES320) // #117 _extension( 90,KHR,texture_compression_astc_hdr,GLES200, None) // #117 diff --git a/src/Magnum/GL/Implementation/BufferState.cpp b/src/Magnum/GL/Implementation/BufferState.cpp index ad14d66fa..851655a3f 100644 --- a/src/Magnum/GL/Implementation/BufferState.cpp +++ b/src/Magnum/GL/Implementation/BufferState.cpp @@ -121,7 +121,7 @@ BufferState::BufferState(Context& context, Containers::StaticArrayView, Buffer::StorageFlags); #endif void(*getParameterImplementation)(Buffer&, GLenum, GLint*); diff --git a/src/Magnum/GL/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp index 303231695..1ff024c41 100644 --- a/src/Magnum/GL/Test/BufferGLTest.cpp +++ b/src/Magnum/GL/Test/BufferGLTest.cpp @@ -62,7 +62,7 @@ struct BufferGLTest: OpenGLTester { #endif #endif - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void storage(); void storagePreinitialized(); #endif @@ -129,7 +129,7 @@ BufferGLTest::BufferGLTest() { #endif addTests({ - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &BufferGLTest::storage, &BufferGLTest::storagePreinitialized, #endif @@ -407,10 +407,15 @@ void BufferGLTest::bindBaseRangeCreatesObject() { #endif #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void BufferGLTest::storage() { + #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::ARB::buffer_storage::string() << "is not supported."); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::buffer_storage::string() << "is not supported."); + #endif Buffer buffer; @@ -420,14 +425,22 @@ void BufferGLTest::storage() { .setSubData(0, data); MAGNUM_VERIFY_NO_GL_ERROR(); + /** @todo How to verify the contents in ES? */ + #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(Containers::arrayCast(buffer.data()), Containers::arrayView(data), TestSuite::Compare::Container); + #endif } void BufferGLTest::storagePreinitialized() { + #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::ARB::buffer_storage::string() << "is not supported."); + #else + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::buffer_storage::string() << "is not supported."); + #endif Buffer buffer; @@ -436,9 +449,12 @@ void BufferGLTest::storagePreinitialized() { buffer.setStorage(data, Buffer::StorageFlag::MapRead|Buffer::StorageFlag::ClientStorage); MAGNUM_VERIFY_NO_GL_ERROR(); + /** @todo How to verify the contents in ES? */ + #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(Containers::arrayCast(buffer.data()), Containers::arrayView(data), TestSuite::Compare::Container); + #endif } #endif diff --git a/src/MagnumExternal/OpenGL/GLES3/extensions.txt b/src/MagnumExternal/OpenGL/GLES3/extensions.txt index f2ee69381..d57d4e722 100644 --- a/src/MagnumExternal/OpenGL/GLES3/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES3/extensions.txt @@ -64,6 +64,7 @@ extension EXT_draw_elements_base_vertex optional extension EXT_texture_norm16 optional extension EXT_texture_sRGB_R8 optional extension EXT_texture_sRGB_RG8 optional +extension EXT_buffer_storage optional extension EXT_blend_func_extended optional extension EXT_polygon_offset_clamp optional extension EXT_clip_cull_distance optional diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index f7e36668f..5f0eacc4e 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -1590,6 +1590,18 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_SRG8_EXT 0x8FBE +/* GL_EXT_buffer_storage */ + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + /* GL_EXT_blend_func_extended */ #define GL_SRC1_COLOR_EXT 0x88F9 @@ -2152,6 +2164,10 @@ struct FlextGL { GLint(APIENTRY *GetFragDataIndexEXT)(GLuint, const GLchar *); GLint(APIENTRY *GetProgramResourceLocationIndexEXT)(GLuint, GLenum, const GLchar *); + /* GL_EXT_buffer_storage */ + + void(APIENTRY *BufferStorageEXT)(GLenum, GLsizeiptr, const void *, GLbitfield); + /* GL_EXT_clip_control */ void(APIENTRY *ClipControlEXT)(GLenum, GLenum); @@ -2522,6 +2538,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glGetFragDataIndexEXT flextGL.GetFragDataIndexEXT #define glGetProgramResourceLocationIndexEXT flextGL.GetProgramResourceLocationIndexEXT +/* GL_EXT_buffer_storage */ + +#define glBufferStorageEXT flextGL.BufferStorageEXT + /* GL_EXT_clip_control */ #define glClipControlEXT flextGL.ClipControlEXT diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp index c557cb9f3..827d72a9a 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp @@ -173,6 +173,9 @@ void flextGLInit(Magnum::GL::Context&) { flextGL.GetFragDataIndexEXT = reinterpret_cast(loader.load("glGetFragDataIndexEXT")); flextGL.GetProgramResourceLocationIndexEXT = reinterpret_cast(loader.load("glGetProgramResourceLocationIndexEXT")); + /* GL_EXT_buffer_storage */ + flextGL.BufferStorageEXT = reinterpret_cast(loader.load("glBufferStorageEXT")); + /* GL_EXT_clip_control */ flextGL.ClipControlEXT = reinterpret_cast(loader.load("glClipControlEXT")); diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp index 40b2fd91e..c93214fff 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp @@ -39,6 +39,7 @@ #undef glBindFragDataLocationIndexedEXT #undef glGetFragDataIndexEXT #undef glGetProgramResourceLocationIndexEXT +#undef glBufferStorageEXT #undef glClipControlEXT #undef glCopyImageSubDataEXT #undef glGetObjectLabelEXT @@ -209,6 +210,11 @@ void flextGLInit(Magnum::GL::Context&) { flextGL.GetProgramResourceLocationIndexEXT = reinterpret_cast(glGetProgramResourceLocationIndexEXT); #endif + /* GL_EXT_buffer_storage */ + #if GL_EXT_buffer_storage + flextGL.BufferStorageEXT = reinterpret_cast(glBufferStorageEXT); + #endif + /* GL_EXT_clip_control */ #if GL_EXT_clip_control flextGL.ClipControlEXT = reinterpret_cast(glClipControlEXT); diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp index 7adb9fc0f..96e08ba17 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp @@ -375,6 +375,9 @@ void flextGLInit(Magnum::GL::Context&) { flextGL.GetFragDataIndexEXT = reinterpret_cast(loader.load("glGetFragDataIndexEXT")); flextGL.GetProgramResourceLocationIndexEXT = reinterpret_cast(loader.load("glGetProgramResourceLocationIndexEXT")); + /* GL_EXT_buffer_storage */ + flextGL.BufferStorageEXT = reinterpret_cast(loader.load("glBufferStorageEXT")); + /* GL_EXT_clip_control */ flextGL.ClipControlEXT = reinterpret_cast(loader.load("glClipControlEXT")); diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h index 17bbc5b08..d4395a61e 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h @@ -1583,6 +1583,18 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_SRG8_EXT 0x8FBE +/* GL_EXT_buffer_storage */ + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + /* GL_EXT_blend_func_extended */ #define GL_SRC1_COLOR_EXT 0x88F9 @@ -2156,6 +2168,10 @@ struct FlextGL { GLint(APIENTRY *GetFragDataIndexEXT)(GLuint, const GLchar *); GLint(APIENTRY *GetProgramResourceLocationIndexEXT)(GLuint, GLenum, const GLchar *); + /* GL_EXT_buffer_storage */ + + void(APIENTRY *BufferStorageEXT)(GLenum, GLsizeiptr, const void *, GLbitfield); + /* GL_EXT_clip_control */ void(APIENTRY *ClipControlEXT)(GLenum, GLenum); @@ -2730,6 +2746,10 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glGetFragDataIndexEXT flextGL.GetFragDataIndexEXT #define glGetProgramResourceLocationIndexEXT flextGL.GetProgramResourceLocationIndexEXT +/* GL_EXT_buffer_storage */ + +#define glBufferStorageEXT flextGL.BufferStorageEXT + /* GL_EXT_clip_control */ #define glClipControlEXT flextGL.ClipControlEXT