From 6feb5a4cabaf40ce29300603ef7930de87495236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 3 Jul 2020 23:04:45 +0200 Subject: [PATCH] GL: fix compilation on macOS + ANGLE. --- doc/changelog.dox | 5 +++++ src/Magnum/GL/Buffer.cpp | 4 ++-- src/Magnum/GL/Buffer.h | 2 +- src/Magnum/GL/Implementation/TextureState.cpp | 2 +- src/Magnum/GL/Implementation/TextureState.h | 2 +- src/Magnum/GL/Implementation/driverSpecific.cpp | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index a12b1502a..4b887468a 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -44,6 +44,11 @@ See also: - Added @ref Math::fmod() (see [mosra/magnum#454](https://github.com/mosra/magnum/pull/454)) +@subsection changelog-latest-buildsystem Build system + +- Fixed compilation of the @ref GL library on macOS with ANGLE --- new code + assumed macOS is always desktop GL (see [mosra/magnum#452](https://github.com/mosra/magnum/issues/452)) + @section changelog-2020-06 2020.06 Released 2020-06-27, tagged as diff --git a/src/Magnum/GL/Buffer.cpp b/src/Magnum/GL/Buffer.cpp index 5fa02c244..5f0e58771 100644 --- a/src/Magnum/GL/Buffer.cpp +++ b/src/Magnum/GL/Buffer.cpp @@ -38,7 +38,7 @@ #endif #include "Magnum/GL/Implementation/MeshState.h" -#if defined(CORRADE_TARGET_APPLE) && !defined(CORRADE_TARGET_IOS) +#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) #include "Magnum/GL/Implementation/TextureState.h" #endif @@ -550,7 +550,7 @@ bool Buffer::unmapImplementationDSA() { #endif #endif -#if defined(CORRADE_TARGET_APPLE) && !defined(CORRADE_TARGET_IOS) +#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) /* See apple-buffer-texture-detach-on-data-modify for the gory details. */ void Buffer::textureWorkaroundAppleBefore() { /* My Mac Mini reports 80 texture units, which means this thing can have a diff --git a/src/Magnum/GL/Buffer.h b/src/Magnum/GL/Buffer.h index 2dddfce73..0c06ea500 100644 --- a/src/Magnum/GL/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -1251,7 +1251,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { void MAGNUM_GL_LOCAL getSubDataImplementationDSA(GLintptr offset, GLsizeiptr size, GLvoid* data); #endif - #if defined(CORRADE_TARGET_APPLE) && !defined(CORRADE_TARGET_IOS) + #if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) void MAGNUM_GL_LOCAL textureWorkaroundAppleBefore(); void MAGNUM_GL_LOCAL textureWorkaroundAppleAfter(); #endif diff --git a/src/Magnum/GL/Implementation/TextureState.cpp b/src/Magnum/GL/Implementation/TextureState.cpp index 71ebe630e..56ce1bb3f 100644 --- a/src/Magnum/GL/Implementation/TextureState.cpp +++ b/src/Magnum/GL/Implementation/TextureState.cpp @@ -490,7 +490,7 @@ TextureState::TextureState(Context& context, std::vector& extension CORRADE_INTERNAL_ASSERT(maxTextureUnits > 0); bindings = Containers::Array>{Containers::ValueInit, std::size_t(maxTextureUnits)}; - #if defined(CORRADE_TARGET_APPLE) && !defined(CORRADE_TARGET_IOS) + #if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) if(!context.isDriverWorkaroundDisabled("apple-buffer-texture-unbind-on-buffer-modify")) { CORRADE_INTERNAL_ASSERT(std::size_t(maxTextureUnits) <= decltype(bufferTextureBound)::Size); /* Assume ARB_multi_bind is not supported, otherwise we'd need to diff --git a/src/Magnum/GL/Implementation/TextureState.h b/src/Magnum/GL/Implementation/TextureState.h index 55c38bb92..88fb064d3 100644 --- a/src/Magnum/GL/Implementation/TextureState.h +++ b/src/Magnum/GL/Implementation/TextureState.h @@ -158,7 +158,7 @@ struct TextureState { #endif Containers::Array> bindings; - #if defined(CORRADE_TARGET_APPLE) && !defined(CORRADE_TARGET_IOS) + #if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) Math::BoolVector<80> bufferTextureBound; #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) diff --git a/src/Magnum/GL/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp index 1426b27cd..d5cda6adf 100644 --- a/src/Magnum/GL/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -40,7 +40,7 @@ namespace { /* Search the code for the following strings to see where they are implemented. */ const char* KnownWorkarounds[]{ /* [workarounds] */ -#if defined(CORRADE_TARGET_APPLE) && !defined(CORRADE_TARGET_IOS) +#if defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_GLES) /* Calling glBufferData(), glMapBuffer(), glMapBufferRange() or glUnmapBuffer() on ANY buffer when ANY buffer is attached to a currently bound GL_TEXTURE_BUFFER crashes in gleUpdateCtxDirtyStateForBufStampChange deep