From 8833afc2fa3142313ec7456c2cd50f83dd5621cb Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 28 Sep 2014 12:18:07 +0200 Subject: [PATCH] gsdx-ogl: drop GL_ARB_multi_bind It will be replaced by DSA so let's reduce the complexity of opengl --- plugins/GSdx/GLLoader.cpp | 2 -- plugins/GSdx/GLLoader.h | 2 -- plugins/GSdx/GSDeviceOGL.cpp | 32 ++++++++++---------------------- plugins/GSdx/GSWnd.cpp | 1 - 4 files changed, 10 insertions(+), 27 deletions(-) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index ce9e1ed735..f9de5dc3d2 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -110,7 +110,6 @@ PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NU PFNGLTEXSTORAGE2DPROC gl_TexStorage2D = NULL; // GL4.4 PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage = NULL; -PFNGLBINDTEXTURESPROC gl_BindTextures = NULL; PFNGLBUFFERSTORAGEPROC gl_BufferStorage = NULL; // GL_ARB_bindless_texture (GL5?) PFNGLGETTEXTURESAMPLERHANDLEARBPROC gl_GetTextureSamplerHandleARB = NULL; @@ -179,7 +178,6 @@ namespace GLLoader { // Mandatory for FULL GL (but optional for GLES) - bool found_GL_ARB_multi_bind = false; // Not yet. Wait Mesa & AMD drivers. bool found_GL_ARB_shading_language_420pack = false; // GLES 3.1 ??? // Mandatory diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index da4a7ff46a..0536622773 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -294,7 +294,6 @@ extern PFNGLTEXSTORAGE2DPROC gl_TexStorage2D; extern PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData; // GL4.4 extern PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage; -extern PFNGLBINDTEXTURESPROC gl_BindTextures; extern PFNGLBUFFERSTORAGEPROC gl_BufferStorage; // GL_ARB_bindless_texture (GL5?) extern PFNGLGETTEXTURESAMPLERHANDLEARBPROC gl_GetTextureSamplerHandleARB; @@ -429,7 +428,6 @@ namespace GLLoader { extern bool found_GL_ARB_gpu_shader5; extern bool found_GL_ARB_shader_image_load_store; extern bool found_GL_ARB_clear_texture; - extern bool found_GL_ARB_multi_bind; extern bool found_GL_ARB_buffer_storage; extern bool found_GL_ARB_shader_subroutine; extern bool found_GL_ARB_bindless_texture; diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 527473252c..53b522754c 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -1062,17 +1062,11 @@ void GSDeviceOGL::PSSetShaderResource(GLuint sr) if (GLState::tex_unit[0] != sr) { GLState::tex_unit[0] = sr; - if (GLLoader::found_GL_ARB_multi_bind) { -#ifndef ENABLE_GLES - gl_BindTextures(0, 1, &sr); -#endif - } else { - gl_ActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, sr); + gl_ActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, sr); - // Get back to the expected active texture unit - gl_ActiveTexture(GL_TEXTURE0 + 3); - } + // Get back to the expected active texture unit + gl_ActiveTexture(GL_TEXTURE0 + 3); } } @@ -1082,20 +1076,14 @@ void GSDeviceOGL::PSSetShaderResources(GLuint tex[2]) GLState::tex_unit[0] = tex[0]; GLState::tex_unit[1] = tex[1]; - if (GLLoader::found_GL_ARB_multi_bind) { -#ifndef ENABLE_GLES - gl_BindTextures(0, 2, tex); -#endif - } else { - gl_ActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, tex[0]); + gl_ActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, tex[0]); - gl_ActiveTexture(GL_TEXTURE0 + 1); - glBindTexture(GL_TEXTURE_2D, tex[1]); + gl_ActiveTexture(GL_TEXTURE0 + 1); + glBindTexture(GL_TEXTURE_2D, tex[1]); - // Get back to the expected active texture unit - gl_ActiveTexture(GL_TEXTURE0 + 3); - } + // Get back to the expected active texture unit + gl_ActiveTexture(GL_TEXTURE0 + 3); } } diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 8ae15f2f0f..90da398811 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -113,7 +113,6 @@ void GSWndGL::PopulateGlFunction() *(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true); // GL4.4 *(void**)&(gl_ClearTexImage) = GetProcAddress("glClearTexImage", true); - *(void**)&(gl_BindTextures) = GetProcAddress("glBindTextures", true); *(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true); // GL_ARB_bindless_texture (GL5?) *(void**)&(gl_GetTextureSamplerHandleARB) = GetProcAddress("glGetTextureSamplerHandleARB", true);