From c074a6cdec14799fc82dcb98070943bb02095936 Mon Sep 17 00:00:00 2001 From: Logan McNaughton Date: Tue, 31 Jan 2017 12:39:11 -0800 Subject: [PATCH] Fix a few GL errors Check for ARB_buffer_storage instead of the function pointers Image Textures also require ARB_compute_shader, which provides glMemoryBarrier --- src/Graphics/OpenGLContext/opengl_ContextImpl.cpp | 2 +- src/Graphics/OpenGLContext/opengl_GLInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp b/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp index 309241ca..c566b58c 100644 --- a/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp +++ b/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp @@ -274,7 +274,7 @@ graphics::ColorBufferReader * ContextImpl::createColorBufferReader(CachedTexture return new ColorBufferReaderWithEGLImage(_pTexture, m_cachedFunctions->getCachedBindTexture()); #endif*/ - if (glBufferStorage != nullptr && glMemoryBarrier != nullptr) + if (Utils::isExtensionSupported("GL_ARB_buffer_storage")) return new ColorBufferReaderWithBufferStorage(_pTexture, m_cachedFunctions->getCachedBindBuffer()); return new ColorBufferReaderWithPixelBuffer(_pTexture, m_cachedFunctions->getCachedBindBuffer()); diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp index ed26f5c9..2aa87441 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp @@ -34,7 +34,7 @@ void GLInfo::init() { imageTextures = (majorVersion * 10 + minorVersion >= 31) && (glBindImageTexture != nullptr); msaa = majorVersion * 10 + minorVersion >= 31; } else { - imageTextures = ((majorVersion * 10 + minorVersion >= 43) || Utils::isExtensionSupported("GL_ARB_shader_image_load_store")) && (glBindImageTexture != nullptr); + imageTextures = ((majorVersion * 10 + minorVersion >= 43) || (Utils::isExtensionSupported("GL_ARB_shader_image_load_store") && Utils::isExtensionSupported("GL_ARB_compute_shader"))) && (glBindImageTexture != nullptr); msaa = true; }