diff --git a/src/Graphics/OpenGLContext/GLFunctions.cpp b/src/Graphics/OpenGLContext/GLFunctions.cpp index e2b7a798..753bb2a7 100644 --- a/src/Graphics/OpenGLContext/GLFunctions.cpp +++ b/src/Graphics/OpenGLContext/GLFunctions.cpp @@ -253,10 +253,6 @@ void initGLFunctions() GL_GET_PROC_ADR(PFNGLGETSTRINGIPROC, glGetStringi); GL_GET_PROC_ADR(PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer); GL_GET_PROC_ADR(PFNGLBUFFERSTORAGEPROC, glBufferStorage); -#ifdef EGL - if (g_glBufferStorage == nullptr) - g_glBufferStorage = (PFNGLBUFFERSTORAGEPROC) eglGetProcAddress("glBufferStorageEXT"); -#endif GL_GET_PROC_ADR(PFNGLFENCESYNCPROC, glFenceSync); GL_GET_PROC_ADR(PFNGLCLIENTWAITSYNCPROC, glClientWaitSync); GL_GET_PROC_ADR(PFNGLDELETESYNCPROC, glDeleteSync); @@ -284,4 +280,10 @@ void initGLFunctions() GL_GET_PROC_ADR(PFNGLCREATEBUFFERSPROC, glCreateBuffers); GL_GET_PROC_ADR(PFNGLCREATEFRAMEBUFFERSPROC, glCreateFramebuffers); GL_GET_PROC_ADR(PFNGLNAMEDFRAMEBUFFERTEXTUREPROC, glNamedFramebufferTexture); +#ifdef EGL + if (g_glBufferStorage == nullptr) + g_glBufferStorage = (PFNGLBUFFERSTORAGEPROC) eglGetProcAddress("glBufferStorageEXT"); + if (g_glTexStorage2D == nullptr) + g_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC) eglGetProcAddress("glTexStorage2DEXT"); +#endif } diff --git a/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp b/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp index 232cd4a4..fb95fe48 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 (Utils::isExtensionSupported("GL_ARB_buffer_storage") || Utils::isExtensionSupported("GL_EXT_buffer_storage")) + if (m_glInfo.bufferStorage) 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 2aa87441..6dd7df02 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp @@ -37,6 +37,8 @@ void GLInfo::init() { imageTextures = ((majorVersion * 10 + minorVersion >= 43) || (Utils::isExtensionSupported("GL_ARB_shader_image_load_store") && Utils::isExtensionSupported("GL_ARB_compute_shader"))) && (glBindImageTexture != nullptr); msaa = true; } + bufferStorage = Utils::isExtensionSupported("GL_ARB_buffer_storage") || Utils::isExtensionSupported("GL_EXT_buffer_storage"); + texStorage = Utils::isExtensionSupported("GL_ARB_texture_storage") || Utils::isExtensionSupported("GL_EXT_texture_storage"); shaderStorage = false; if (config.generalEmulation.enableShadersStorage != 0) { diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.h b/src/Graphics/OpenGLContext/opengl_GLInfo.h index 5cbcb1b5..3110388d 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.h +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.h @@ -14,6 +14,8 @@ struct GLInfo { bool isGLES2 = false; bool isGLESX = false; bool imageTextures = false; + bool bufferStorage = false; + bool texStorage = false; bool shaderStorage = false; bool msaa = false; Renderer renderer = Renderer::Other; diff --git a/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp b/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp index 223a25fc..4140100f 100644 --- a/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp +++ b/src/Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp @@ -92,7 +92,7 @@ namespace opengl { public: static bool Check(const GLInfo & _glinfo) { #ifdef ENABLE_GL_4_2 - return (_glinfo.majorVersion > 4) || (_glinfo.majorVersion == 4 && _glinfo.minorVersion >= 2); + return (_glinfo.texStorage); #else return false; #endif