From 1a861c742c3070673f6273fcaed51d29f22b7e3f Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Wed, 18 Feb 2015 23:42:42 +0100 Subject: [PATCH] Add a GR for GI in central_settings --- src/graphics/central_settings.cpp | 8 +++++++- src/graphics/central_settings.hpp | 1 + src/graphics/graphics_restrictions.cpp | 1 + src/graphics/graphics_restrictions.hpp | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/graphics/central_settings.cpp b/src/graphics/central_settings.cpp index 0cecaaae5..864cd710d 100644 --- a/src/graphics/central_settings.cpp +++ b/src/graphics/central_settings.cpp @@ -27,6 +27,7 @@ void CentralVideoSettings::init() hasTextureCompression = false; hasUBO = false; hasGS = false; + m_GI_has_artifact = false; m_need_rh_workaround = false; m_need_srgb_workaround = false; @@ -140,6 +141,11 @@ void CentralVideoSettings::init() UserConfigParams::m_high_definition_textures = 0x00; } + if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_GI)) + { + m_GI_has_artifact = true; + } + // Specific disablement if (strstr((const char *)glGetString(GL_VENDOR), "NVIDIA") != NULL) { @@ -263,7 +269,7 @@ bool CentralVideoSettings::supportsShadows() const bool CentralVideoSettings::supportsGlobalIllumination() const { - return isARBGeometryShader4Usable() && isARBUniformBufferObjectUsable(); + return isARBGeometryShader4Usable() && isARBUniformBufferObjectUsable() && !m_GI_has_artifact; } bool CentralVideoSettings::supportsIndirectInstancingRendering() const diff --git a/src/graphics/central_settings.hpp b/src/graphics/central_settings.hpp index 980c0a666..b7b774541 100644 --- a/src/graphics/central_settings.hpp +++ b/src/graphics/central_settings.hpp @@ -26,6 +26,7 @@ private: bool m_need_rh_workaround; bool m_need_srgb_workaround; + bool m_GI_has_artifact; public: void init(); bool isGLSL() const; diff --git a/src/graphics/graphics_restrictions.cpp b/src/graphics/graphics_restrictions.cpp index 24fb7dae2..e088d935b 100644 --- a/src/graphics/graphics_restrictions.cpp +++ b/src/graphics/graphics_restrictions.cpp @@ -59,6 +59,7 @@ namespace GraphicsRestrictions "HighDefinitionTextures", "AdvancedPipeline", "FramebufferSRGBWorking", + "GI", }; } // namespace Private using namespace Private; diff --git a/src/graphics/graphics_restrictions.hpp b/src/graphics/graphics_restrictions.hpp index 2636e1c64..908a0e03f 100644 --- a/src/graphics/graphics_restrictions.hpp +++ b/src/graphics/graphics_restrictions.hpp @@ -53,6 +53,7 @@ namespace GraphicsRestrictions GR_HIGHDEFINITION_TEXTURES, GR_ADVANCED_PIPELINE, GR_FRAMEBUFFER_SRGB_WORKING, + GR_GI, GR_COUNT /** MUST be last entry. */ } ;