From dfb4b5a33915b026e6aca8e4a18b23fd78d87fbb Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 7 Apr 2016 21:51:37 +0200 Subject: [PATCH] gsdx-ogl: GL_ARB_texture_barrier is now mandatory (GL4.5 extension) --- plugins/GSdx/GLLoader.cpp | 8 +------- plugins/GSdx/GLLoader.h | 1 - plugins/GSdx/GSRendererOGL.cpp | 14 ++------------ plugins/GSdx/GSWnd.cpp | 2 +- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 680f19fab1..d8122e1aaf 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -497,7 +497,7 @@ namespace GLLoader { // 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"); - status &= status_and_override(found_GL_ARB_texture_barrier, "GL_ARB_texture_barrier"); + status &= status_and_override(found_GL_ARB_texture_barrier, "GL_ARB_texture_barrier", true); if (!found_GL_ARB_direct_state_access) { Emulate_DSA::Init(); @@ -507,12 +507,6 @@ namespace GLLoader { status = false; } - if (!found_GL_ARB_texture_barrier) { - fprintf(stderr, "Error GL_ARB_texture_barrier is not supported by your driver. You can't emulate correctly the GS blending unit! Sorry!\n"); - theApp.SetConfig("accurate_blending_unit", 0); - theApp.SetConfig("accurate_date", 0); - } - #ifdef _WIN32 if (status) { if (intel_buggy_driver) { diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index 2d4da9a98c..72c882dec3 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -365,6 +365,5 @@ namespace GLLoader { extern bool found_GL_ARB_buffer_storage; extern bool found_GL_ARB_clip_control; extern bool found_GL_ARB_direct_state_access; - extern bool found_GL_ARB_texture_barrier; extern bool found_GL_EXT_texture_filter_anisotropic; } diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 84afbc66eb..b09162b957 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -55,14 +55,6 @@ bool GSRendererOGL::CreateDevice(GSDevice* dev) if (!GSRenderer::CreateDevice(dev)) return false; - // No sw blending if not supported (Intel GPU) - if (!GLLoader::found_GL_ARB_texture_barrier) { - fprintf(stderr, "Error GL_ARB_texture_barrier is not supported by your driver. You can't emulate correctly the GS blending unit! Sorry!\n"); - m_accurate_date = false; - m_sw_blending = 0; - } - - return true; } @@ -592,13 +584,11 @@ void GSRendererOGL::SendDraw(bool require_barrier) if (!require_barrier && m_unsafe_fbmask) { // Not safe but still worth to take some precautions. - ASSERT(GLLoader::found_GL_ARB_texture_barrier); glTextureBarrier(); dev->DrawIndexedPrimitive(); } else if (!require_barrier) { dev->DrawIndexedPrimitive(); } else if (m_prim_overlap == PRIM_OVERLAP_NO) { - ASSERT(GLLoader::found_GL_ARB_texture_barrier); glTextureBarrier(); dev->DrawIndexedPrimitive(); } else if (m_vt.m_primclass == GS_SPRITE_CLASS) { @@ -682,7 +672,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour GSDeviceOGL* dev = (GSDeviceOGL*)m_dev; dev->s_n = s_n; - if ((DATE || m_sw_blending) && GLLoader::found_GL_ARB_texture_barrier && (m_vt.m_primclass == GS_SPRITE_CLASS)) { + if ((DATE || m_sw_blending) && (m_vt.m_primclass == GS_SPRITE_CLASS)) { // Except 2D games, sprites are often use for special post-processing effect m_prim_overlap = PrimitiveOverlap(); } else { @@ -698,7 +688,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour // DATE: selection of the algorithm. Must be done before blending because GL42 is not compatible with blending - if (DATE && GLLoader::found_GL_ARB_texture_barrier) { + if (DATE) { if (m_prim_overlap == PRIM_OVERLAP_NO || m_texture_shuffle) { // It is way too complex to emulate texture shuffle with DATE. So just use // the slow but accurate algo diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index ebc230f19a..c501ea8c88 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -169,7 +169,7 @@ void GSWndGL::PopulateGlFunction() GL_EXT_LOAD_OPT(glCreateProgramPipelines); GL_EXT_LOAD_OPT(glClipControl); - GL_EXT_LOAD_OPT(glTextureBarrier); + GL_EXT_LOAD(glTextureBarrier); if (glCreateFramebuffers == NULL) { Emulate_DSA::Init();