From 81adc3ef4dbc8730dc3ac1d0527ab03068ad51af Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 20 Jan 2017 18:20:51 +0100 Subject: [PATCH] gsdx ogl: don't use per buffer blending It increases the number of state that driver must handle. --- plugins/GSdx/GLLoader.cpp | 19 ------------------- plugins/GSdx/GSDeviceOGL.cpp | 4 ++-- plugins/GSdx/GSWnd.cpp | 3 --- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 2330f7052d..e88ae1eab1 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -169,16 +169,6 @@ PFNGLTEXTUREBARRIERPROC glTextureBarrier = NUL PFNGLGETTEXTURESUBIMAGEPROC glGetTextureSubImage = NULL; namespace ReplaceGL { - void APIENTRY BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeAlpha) - { - glBlendEquationSeparate(modeRGB, modeAlpha); - } - - void APIENTRY BlendFuncSeparateiARB(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) - { - glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); - } - void APIENTRY ScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height) { glScissor(left, bottom, width, height); @@ -206,7 +196,6 @@ namespace GLLoader { bool found_GL_ARB_clear_texture = false; // Miss AMD Mesa (otherwise seems SW) bool found_GL_ARB_get_texture_sub_image = false; // Not yet used // DX11 GPU - bool found_GL_ARB_draw_buffers_blend = false; // Not supported on AMD R600 (80 nm class chip, HD2900). Nvidia requires FERMI. Intel SB bool found_GL_ARB_gpu_shader5 = false; // Require IvyBridge bool found_GL_ARB_shader_image_load_store = false; // Intel IB. Nvidia/AMD miss Mesa implementation. bool found_GL_ARB_viewport_array = false; // Intel IB. AMD/NVIDIA DX10 @@ -313,7 +302,6 @@ namespace GLLoader { if (ext.compare("GL_NVX_gpu_memory_info") == 0) found_GL_NVX_gpu_memory_info = true; // GL4.0 if (ext.compare("GL_ARB_gpu_shader5") == 0) found_GL_ARB_gpu_shader5 = true; - if (ext.compare("GL_ARB_draw_buffers_blend") == 0) found_GL_ARB_draw_buffers_blend = true; // GL4.1 if (ext.compare("GL_ARB_viewport_array") == 0) found_GL_ARB_viewport_array = true; if (ext.compare("GL_ARB_separate_shader_objects") == 0) found_GL_ARB_separate_shader_objects = true; @@ -344,7 +332,6 @@ namespace GLLoader { status &= status_and_override(found_GL_EXT_texture_filter_anisotropic, "GL_EXT_texture_filter_anisotropic"); // GL4.0 status &= status_and_override(found_GL_ARB_gpu_shader5, "GL_ARB_gpu_shader5"); - status &= status_and_override(found_GL_ARB_draw_buffers_blend, "GL_ARB_draw_buffers_blend"); // GL4.1 status &= status_and_override(found_GL_ARB_viewport_array, "GL_ARB_viewport_array"); status &= status_and_override(found_GL_ARB_separate_shader_objects, "GL_ARB_separate_shader_objects", true); @@ -378,12 +365,6 @@ namespace GLLoader { glViewportIndexedf = ReplaceGL::ViewportIndexedf; } - if (!found_GL_ARB_draw_buffers_blend) { - fprintf(stderr, "GL_ARB_draw_buffers_blend: not supported ! function pointer will be replaced\n"); - glBlendFuncSeparateiARB = ReplaceGL::BlendFuncSeparateiARB; - glBlendEquationSeparateiARB = ReplaceGL::BlendEquationSeparateiARB; - } - fprintf(stdout, "\n"); return status; diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 190b5fbd58..bcf6508d21 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -1767,13 +1767,13 @@ void GSDeviceOGL::OMSetBlendState(uint8 blend_index, uint8 blend_factor, bool is if (GLState::eq_RGB != b.op) { GLState::eq_RGB = b.op; - glBlendEquationSeparateiARB(0, b.op, GL_FUNC_ADD); + glBlendEquationSeparate(b.op, GL_FUNC_ADD); } if (GLState::f_sRGB != b.src || GLState::f_dRGB != b.dst) { GLState::f_sRGB = b.src; GLState::f_dRGB = b.dst; - glBlendFuncSeparateiARB(0, b.src, b.dst, GL_ONE, GL_ZERO); + glBlendFuncSeparate(b.src, b.dst, GL_ONE, GL_ZERO); } } else { diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 1a14fee219..90a53c727d 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -95,9 +95,6 @@ void GSWndGL::PopulateGlFunction() GL_EXT_LOAD_OPT(glGetInteger64v); GL_EXT_LOAD_OPT(glCreateQueries); GL_EXT_LOAD_OPT(glDeleteQueries); - // GL4.0 - GL_EXT_LOAD_OPT(glBlendEquationSeparateiARB); - GL_EXT_LOAD_OPT(glBlendFuncSeparateiARB); // GL4.1 GL_EXT_LOAD(glCreateShaderProgramv); GL_EXT_LOAD(glBindProgramPipeline);