From 2664e843223e558a781d00191b7dffd962aa5618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 27 Aug 2018 12:43:50 +0200 Subject: [PATCH] macOS: Remove support for QSurfaceFormat::StereoBuffers The NSOpenGLPFAStereo attribute was deprecated in macOS 10.12, without any replacement, and adding the attribute to the pixel format results in context creation failure, so we're assuming the feature is no longer supported an disable it wholesale on macOS. Change-Id: I27d9f300fdaff9abe90781e3160b97f8b66121ad Reviewed-by: Laszlo Agocs --- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 4d0fa2e28e..c23636a1a0 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -217,9 +217,6 @@ NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurface << NSOpenGLPFASamples << NSOpenGLPixelFormatAttribute(format.samples()); } - if (format.stereo()) - attrs << NSOpenGLPFAStereo; - // Allow rendering on GPUs without a connected display attrs << NSOpenGLPFAAllowOfflineRenderers; @@ -277,6 +274,9 @@ void QCocoaGLContext::updateSurfaceFormat() // Debug contexts not supported on macOS m_format.setOption(QSurfaceFormat::DebugContext, false); + // Nor are stereo buffers (deprecated in macOS 10.12) + m_format.setOption(QSurfaceFormat::StereoBuffers, false); + // ------------------ Query the pixel format ------------------ NSOpenGLPixelFormat *pixelFormat = m_context.pixelFormat; @@ -306,8 +306,6 @@ void QCocoaGLContext::updateSurfaceFormat() else m_format.setSwapBehavior(QSurfaceFormat::SingleBuffer); - m_format.setOption(QSurfaceFormat::StereoBuffers, [pixelFormat qt_getAttribute:NSOpenGLPFAStereo]); - // ------------------- Query the context ------------------- m_format.setSwapInterval([m_context qt_getParameter:NSOpenGLCPSwapInterval]);