From 77f9113301e56ed07dc86d848edececc68c2692e Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Tue, 29 Dec 2015 22:27:24 +0100 Subject: [PATCH] gsdx-gl: use CONTEXT_FLAG_NO_ERROR_BIT_KHR to reduce driver overheard Didn't test it yet as my driver is too old. Note: might break the open source drivers. --- plugins/GSdx/GLLoader.h | 6 +++++- plugins/GSdx/GSWndEGL.cpp | 3 +++ plugins/GSdx/GSWndOGL.cpp | 3 +++ plugins/GSdx/GSWndWGL.cpp | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index 87250746c5..1a339d1b6b 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -26,8 +26,12 @@ #define GL_FB_DEFAULT (0) #define GL_BUFFER_0 (0) +#ifndef GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 +#endif + // FIX compilation issue with Mesa 10 -// Note it might be possible to do better with the right include +// Note it might be possible to do better with the right include // in the rigth order but I don't have time #ifndef APIENTRY #define APIENTRY diff --git a/plugins/GSdx/GSWndEGL.cpp b/plugins/GSdx/GSWndEGL.cpp index 551cbfd587..3b51fe02d1 100644 --- a/plugins/GSdx/GSWndEGL.cpp +++ b/plugins/GSdx/GSWndEGL.cpp @@ -39,6 +39,9 @@ void GSWndEGL::CreateContext(int major, int minor) EGL_CONTEXT_MINOR_VERSION_KHR, minor, #ifdef ENABLE_OGL_DEBUG EGL_CONTEXT_FLAGS_KHR, EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, +#else + // Open Source isn't happy with an unsupported flags... + //EGL_CONTEXT_FLAGS_KHR, GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR, #endif EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, EGL_NONE diff --git a/plugins/GSdx/GSWndOGL.cpp b/plugins/GSdx/GSWndOGL.cpp index 6c9da4f08c..5537f2d555 100644 --- a/plugins/GSdx/GSWndOGL.cpp +++ b/plugins/GSdx/GSWndOGL.cpp @@ -81,6 +81,9 @@ void GSWndOGL::CreateContext(int major, int minor) GLX_CONTEXT_MINOR_VERSION_ARB, minor, #ifdef ENABLE_OGL_DEBUG GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, +#else + // Open Source isn't happy with an unsupported flags... + //GLX_CONTEXT_FLAGS_ARB, GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR, #endif GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, None diff --git a/plugins/GSdx/GSWndWGL.cpp b/plugins/GSdx/GSWndWGL.cpp index f4e44ab4ed..e7af7dcae1 100644 --- a/plugins/GSdx/GSWndWGL.cpp +++ b/plugins/GSdx/GSWndWGL.cpp @@ -77,6 +77,8 @@ bool GSWndWGL::CreateContext(int major, int minor) WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB #ifdef ENABLE_OGL_DEBUG | WGL_CONTEXT_DEBUG_BIT_ARB +#else + | GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR #endif , WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,