Browse Source

GL: fix compilation on macOS + ANGLE.

pull/461/head
Vladimír Vondruš 6 years ago
parent
commit
6feb5a4cab
  1. 5
      doc/changelog.dox
  2. 4
      src/Magnum/GL/Buffer.cpp
  3. 2
      src/Magnum/GL/Buffer.h
  4. 2
      src/Magnum/GL/Implementation/TextureState.cpp
  5. 2
      src/Magnum/GL/Implementation/TextureState.h
  6. 2
      src/Magnum/GL/Implementation/driverSpecific.cpp

5
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

4
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

2
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

2
src/Magnum/GL/Implementation/TextureState.cpp

@ -490,7 +490,7 @@ TextureState::TextureState(Context& context, std::vector<std::string>& extension
CORRADE_INTERNAL_ASSERT(maxTextureUnits > 0);
bindings = Containers::Array<std::pair<GLenum, GLuint>>{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

2
src/Magnum/GL/Implementation/TextureState.h

@ -158,7 +158,7 @@ struct TextureState {
#endif
Containers::Array<std::pair<GLenum, GLuint>> 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)

2
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

Loading…
Cancel
Save