diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 4668bdb9d3..22b822d29d 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -410,6 +410,7 @@ namespace GLLoader { } bool status = true; + bool required_for_hw = (theApp.GetCurrentRendererType() == GSRendererType::OGL_HW); // Bonus status &= status_and_override(found_GL_EXT_texture_filter_anisotropic, "GL_EXT_texture_filter_anisotropic"); @@ -429,7 +430,7 @@ namespace GLLoader { status &= status_and_override(found_GL_ARB_buffer_storage,"GL_ARB_buffer_storage", true); 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", true); + status &= status_and_override(found_GL_ARB_clip_control, "GL_ARB_clip_control", required_for_hw); status &= status_and_override(found_GL_ARB_direct_state_access, "GL_ARB_direct_state_access"); // 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. diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index 66fd7b4151..3c1856fb68 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -370,6 +370,7 @@ namespace GLLoader { // GL extern bool found_geometry_shader; + extern bool found_GL_ARB_clip_control; extern bool found_GL_ARB_gpu_shader5; extern bool found_GL_ARB_shader_image_load_store; extern bool found_GL_ARB_clear_texture; diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index e05b3e2817..178611dc44 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -489,7 +489,8 @@ bool GSDeviceOGL::Create(const std::shared_ptr &wnd) // This extension allow FS depth to range from -1 to 1. So // gl_position.z could range from [0, 1] // Change depth convention - glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE); + if (GLLoader::found_GL_ARB_clip_control && glClipControl) + glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE); // **************************************************************** // HW renderer shader diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index e25c331d42..ba10701813 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -167,7 +167,7 @@ void GSWndGL::PopulateGlFunction() GL_EXT_LOAD_OPT(glCreateSamplers); GL_EXT_LOAD_OPT(glCreateProgramPipelines); - GL_EXT_LOAD(glClipControl); + GL_EXT_LOAD_OPT(glClipControl); GL_EXT_LOAD_OPT(glTextureBarrier); GL_EXT_LOAD_OPT(glGetTextureSubImage); diff --git a/plugins/GSdx/GSdx.cpp b/plugins/GSdx/GSdx.cpp index 2a298f1b9c..1df797e9c9 100644 --- a/plugins/GSdx/GSdx.cpp +++ b/plugins/GSdx/GSdx.cpp @@ -341,6 +341,7 @@ void GSdxApp::Init() m_default_configuration["osd_max_log_messages"] = "3"; m_default_configuration["override_geometry_shader"] = "-1"; m_default_configuration["override_GL_ARB_clear_texture"] = "-1"; + m_default_configuration["override_GL_ARB_clip_control"] = "-1"; m_default_configuration["override_GL_ARB_direct_state_access"] = "-1"; m_default_configuration["override_GL_ARB_draw_buffers_blend"] = "-1"; m_default_configuration["override_GL_ARB_get_texture_sub_image"] = "-1";