From 63944e8c43471237cd2971594207ed8c381ae87f Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 3 Feb 2017 17:33:07 +0100 Subject: [PATCH] gsdx ogl: allow to start without GL_ARB_texture_barrier Rendering will be corrupted (for advance effects) if the driver doesn't support it. However it allow to run with Mesa software emulation (or inside a virtual machine) Note: mesa still requires an override of the buffer storage extension MESA_EXTENSION_OVERRIDE=GL_ARB_buffer_storage --- plugins/GSdx/GLLoader.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index e3d8d9a47e..1ffd83f9d9 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -178,6 +178,11 @@ namespace ReplaceGL { { glViewport(GLint(x), GLint(y), GLsizei(w), GLsizei(h)); } + + void APIENTRY TextureBarrier() + { + } + } namespace GLLoader { @@ -326,7 +331,6 @@ namespace GLLoader { } bool status = true; - bool mandatory_hw = static_cast(theApp.GetConfigI("Renderer")) == GSRendererType::OGL_HW; // Bonus status &= status_and_override(found_GL_EXT_texture_filter_anisotropic, "GL_EXT_texture_filter_anisotropic"); @@ -348,7 +352,9 @@ namespace GLLoader { // GL4.5 status &= status_and_override(found_GL_ARB_clip_control, "GL_ARB_clip_control", true); status &= status_and_override(found_GL_ARB_direct_state_access, "GL_ARB_direct_state_access", true); - status &= status_and_override(found_GL_ARB_texture_barrier, "GL_ARB_texture_barrier", mandatory_hw); + // Mandatory for the advance HW renderer effect. Unfortunately Mesa LLVMPIPE/SWR renderers doesn't support this extension. + // Rendering might be corrupted but it could be good enough for test/virtual machine. + status &= status_and_override(found_GL_ARB_texture_barrier, "GL_ARB_texture_barrier"); status &= status_and_override(found_GL_ARB_get_texture_sub_image, "GL_ARB_get_texture_sub_image"); #ifdef _WIN32 @@ -370,6 +376,11 @@ namespace GLLoader { glViewportIndexedf = ReplaceGL::ViewportIndexedf; } + if (!found_GL_ARB_texture_barrier) { + fprintf(stderr, "GL_ARB_texture_barrier: not supported ! Rendering will be corrupted\n"); + glTextureBarrier = ReplaceGL::TextureBarrier; + } + fprintf(stdout, "\n"); return status;