From b873a942a8e78d42d159aa1e307b7c8155d6e755 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 25 Apr 2017 15:59:05 +0300 Subject: Add option for enable/disable DSA OpenGL extension. By default this option disabled. --- src/defaults.cpp | 1 + src/graphicsmanager.cpp | 42 ++++++++++++++++++------------- src/gui/widgets/tabs/setup_perfomance.cpp | 4 +++ 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/defaults.cpp b/src/defaults.cpp index cf4687973..10f0f1374 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -401,6 +401,7 @@ DefaultsData* getConfigDefaults() AddDEF("checkOpenGLVersion", true); AddDEF("openglContext", false); AddDEF("allowMoveByMouse", true); + AddDEF("enableDSA", false); return configData; } diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 412a4e388..2cc41bb15 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -1058,27 +1058,35 @@ void GraphicsManager::initOpenGLFunctions() */ { // not for NVIDIA. in NVIDIA atleast in windows drivers DSA is broken // Mesa 10.6.3 show support for DSA, but it broken. Works in 10.7 dev - if (is45) + if (config.getBoolValue("enableDSA") == true) { - logger->log1("found GL_EXT_direct_state_access"); - assignFunction(glTextureSubImage2D); - } - else if (supportExtension("GL_EXT_direct_state_access")) - { - logger->log1("found GL_EXT_direct_state_access"); - assignFunctionEmu2(glTextureSubImage2DEXT, - "glTextureSubImage2DEXT"); - } - else if (supportExtension("GL_ARB_direct_state_access")) - { - logger->log1("found GL_ARB_direct_state_access"); - logger->log1("GL_EXT_direct_state_access not found"); - assignFunction(glTextureSubImage2D); + if (is45) + { + logger->log1("found GL_EXT_direct_state_access"); + assignFunction(glTextureSubImage2D); + } + else if (supportExtension("GL_EXT_direct_state_access")) + { + logger->log1("found GL_EXT_direct_state_access"); + assignFunctionEmu2(glTextureSubImage2DEXT, + "glTextureSubImage2DEXT"); + } + else if (supportExtension("GL_ARB_direct_state_access")) + { + logger->log1("found GL_ARB_direct_state_access"); + logger->log1("GL_EXT_direct_state_access not found"); + assignFunction(glTextureSubImage2D); + } + else + { + logger->log1("GL_EXT_direct_state_access not found"); + logger->log1("GL_ARB_direct_state_access not found"); + emulateFunction(glTextureSubImage2DEXT); + } } else { - logger->log1("GL_EXT_direct_state_access not found"); - logger->log1("GL_ARB_direct_state_access not found"); + logger->log1("Direct state access disabled in settings"); emulateFunction(glTextureSubImage2DEXT); } } diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp index 9e507c74d..b583257d8 100644 --- a/src/gui/widgets/tabs/setup_perfomance.cpp +++ b/src/gui/widgets/tabs/setup_perfomance.cpp @@ -96,6 +96,10 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : new SetupItemCheckBox(_("Enable OpenGL context creation"), "", "openglContext", this, "openglContextEvent"); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Enable OpenGL direct state access"), + "", "enableDSA", this, "enableDSAEvent"); + // TRANSLATORS: settings option new SetupItemLabel(_("Better quality (disable for better performance)"), -- cgit v1.2.3-70-g09d2