1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

A few cleanups and support for ARB_texture_storage

This commit is contained in:
Logan McNaughton 2017-02-01 07:35:39 -08:00
parent 4a7c1ebf04
commit 60cd646bd0
5 changed files with 12 additions and 6 deletions

View File

@ -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
}

View File

@ -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());

View File

@ -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) {

View File

@ -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;

View File

@ -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