From a1bfb237e62f9713e16aedadf2d785894e15d92c Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 15 May 2015 20:58:14 +0200 Subject: [PATCH] Partially Revert "gsdx-ogl: drop support of GL_ARB_clear_texture extension" This reverts commit 03e72781aa81da7c69a1c1601e95fc56f5e561ad. Let's add back the clean texture pointer I want to test it on 1/ DSA 2/ MT driver --- plugins/GSdx/GLLoader.cpp | 5 +++++ plugins/GSdx/GLLoader.h | 1 + plugins/GSdx/GSWnd.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 378efba5ca..d88323dac3 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -108,6 +108,7 @@ PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NU PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL; PFNGLTEXSTORAGE2DPROC gl_TexStorage2D = NULL; // GL4.4 +PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage = NULL; PFNGLBUFFERSTORAGEPROC gl_BufferStorage = NULL; // GL_ARB_bindless_texture (GL5?) PFNGLGETTEXTURESAMPLERHANDLEARBPROC gl_GetTextureSamplerHandleARB = NULL; @@ -324,6 +325,8 @@ namespace GLLoader { bool found_GL_ARB_separate_shader_objects = false; // Issue with Mesa and Catalyst... bool found_geometry_shader = true; // we require GL3.3 so geometry must be supported by default bool found_GL_EXT_texture_filter_anisotropic = false; + bool found_GL_ARB_clear_texture = false; // Don't know if GL3 GPU can support it + // Note: except Apple, all drivers support explicit uniform location bool found_GL_ARB_explicit_uniform_location = false; // need by subroutine and bindless texture // GL4 hardware @@ -455,6 +458,7 @@ namespace GLLoader { if (ext.compare("GL_ARB_explicit_uniform_location") == 0) found_GL_ARB_explicit_uniform_location = true; // GL4.4 if (ext.compare("GL_ARB_buffer_storage") == 0) found_GL_ARB_buffer_storage = true; + if (ext.compare("GL_ARB_clear_texture") == 0) found_GL_ARB_clear_texture = true; // FIXME: I have a crash when I hit pause (debug build) //if (ext.compare("GL_ARB_bindless_texture") == 0) found_GL_ARB_bindless_texture = true; // GL4.5 @@ -486,6 +490,7 @@ namespace GLLoader { // GL4.4 status &= status_and_override(found_GL_ARB_buffer_storage,"GL_ARB_buffer_storage"); status &= status_and_override(found_GL_ARB_bindless_texture,"GL_ARB_bindless_texture"); + status &= status_and_override(found_GL_ARB_clear_texture,"GL_ARB_clear_texture"); // GL4.5 status &= status_and_override(found_GL_ARB_clip_control, "GL_ARB_clip_control"); status &= status_and_override(found_GL_ARB_direct_state_access, "GL_ARB_direct_state_access"); diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index a69a24e70a..0b7a633fa8 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -292,6 +292,7 @@ extern PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage; extern PFNGLPUSHDEBUGGROUPPROC gl_PushDebugGroup; extern PFNGLDEBUGMESSAGEINSERTPROC gl_DebugMessageInsert; // GL4.4 +extern PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage; extern PFNGLBUFFERSTORAGEPROC gl_BufferStorage; // GL_ARB_bindless_texture (GL5?) extern PFNGLGETTEXTURESAMPLERHANDLEARBPROC gl_GetTextureSamplerHandleARB; diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 5fbbc4f970..ddfbceb684 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -116,6 +116,7 @@ void GSWndGL::PopulateGlFunction() *(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", debug_optional); *(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", debug_optional); // GL4.4 + *(void**)&(gl_ClearTexImage) = GetProcAddress("glClearTexImage", true); *(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true); // GL_ARB_bindless_texture (GL5?) *(void**)&(gl_GetTextureSamplerHandleARB) = GetProcAddress("glGetTextureSamplerHandleARB", true);