Browse Source

Platform: new nv-egl-forward-compatible-context-unhappy workaround.

SIGH. WHY CAN'T WE HAVE NICE THINGS.
pull/368/head
Vladimír Vondruš 7 years ago
parent
commit
4e218d3f24
  1. 5
      doc/changelog.dox
  2. 6
      src/Magnum/GL/Implementation/driverSpecific.cpp
  3. 12
      src/Magnum/Platform/WindowlessEglApplication.cpp

5
doc/changelog.dox

@ -303,6 +303,11 @@ See also:
would assume a zero-sized framebuffer. This behavior is no longer silent
but advertised as a @cpp "apitrace-zero-initial-viewport" @ce workaround.
See @ref opengl-workarounds for more information.
- Added a @cpp "nv-egl-forward-compatible-context-unhappy" @ce workaround
that removes @ref Platform::WindowlessEglApplication::Configuration::Flag::ForwardCompatible
from flags passed to `eglCreateContext()` as that otherwise causes NVidia
to fail with `EGL_BAD_MATCH`. See @ref opengl-workarounds for more
information.
@subsubsection changelog-latest-changes-math Math library

6
src/Magnum/GL/Implementation/driverSpecific.cpp

@ -105,6 +105,12 @@ namespace {
possible to get driver version through EGL, so enabling this unconditionally
on all EGL NV contexts. */
"nv-egl-incorrect-gl11-function-pointers",
/* NVidia is unhappy when EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR is
present among attributes passed to eglCreateContext(), blowing up with
EGL_BAD_MATCH. This flag is enabled by default, wiping it away to make the
context creation work. */
"nv-egl-forward-compatible-context-unhappy",
#endif
#ifndef MAGNUM_TARGET_GLES

12
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -169,6 +169,16 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G
flags |= Configuration::Flag::Debug;
#endif
#ifndef MAGNUM_TARGET_GLES
/* NVidia doesn't like EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR for
some reason, failing eglCreateContext() with EGL_BAD_MATCH. If this flag
is set, wipe it away. */
const char* vendor = eglQueryString(_display, EGL_VENDOR);
if((flags & Configuration::Flag::ForwardCompatible) && vendor && std::strcmp(vendor, "NVIDIA") == 0 && (!magnumContext || !magnumContext->isDriverWorkaroundDisabled("nv-egl-forward-compatible-context-unhappy"))) {
flags &= ~Configuration::Flag::ForwardCompatible;
}
#endif
#if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_WEBGL)
const /* Is modified below to work around a SwiftShader limitation */
#endif
@ -197,8 +207,6 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G
#ifdef MAGNUM_TARGET_WEBGL
static_cast<void>(configuration);
#endif
#if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_WEBGL)
static_cast<void>(magnumContext);
#endif

Loading…
Cancel
Save