From 1a9cf6a46f7ed1c152d8293f77bd929b4ec953bd Mon Sep 17 00:00:00 2001 From: Deve Date: Wed, 18 Oct 2017 21:13:23 +0200 Subject: [PATCH] Set max texture size to 256 for Raspberry Pi --- data/graphical_restrictions.xml | 1 + src/graphics/central_settings.cpp | 25 ++++++++++++++++++------- src/graphics/graphics_restrictions.cpp | 3 ++- src/graphics/graphics_restrictions.hpp | 1 + 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/data/graphical_restrictions.xml b/data/graphical_restrictions.xml index b0ecf177d..596fd1d5a 100644 --- a/data/graphical_restrictions.xml +++ b/data/graphical_restrictions.xml @@ -38,4 +38,5 @@ + diff --git a/src/graphics/central_settings.cpp b/src/graphics/central_settings.cpp index 24b5348b2..5600437a9 100644 --- a/src/graphics/central_settings.cpp +++ b/src/graphics/central_settings.cpp @@ -211,13 +211,6 @@ void CentralVideoSettings::init() hasSRGBFramebuffer = true; Log::info("GLDriver", "ARB framebuffer sRGB Present"); } - // Only unset the high def textures if they are set as default. If the - // user has enabled them (bit 1 set), then leave them enabled. - if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_HIGHDEFINITION_TEXTURES) && - (UserConfigParams::m_high_definition_textures & 0x02) == 0) - { - UserConfigParams::m_high_definition_textures = 0x00; - } if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_GI)) { @@ -294,6 +287,24 @@ void CentralVideoSettings::init() m_need_vertex_id_workaround = true; } #endif + + // Only unset the high def textures if they are set as default. If the + // user has enabled them (bit 1 set), then leave them enabled. + if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_HIGHDEFINITION_TEXTURES) && + (UserConfigParams::m_high_definition_textures & 0x02) == 0) + { + UserConfigParams::m_high_definition_textures = 0x00; + } + + if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_HIGHDEFINITION_TEXTURES_256)) + { + UserConfigParams::m_high_definition_textures = 0; + + if (UserConfigParams::m_max_texture_size > 256) + { + UserConfigParams::m_max_texture_size = 256; + } + } } } diff --git a/src/graphics/graphics_restrictions.cpp b/src/graphics/graphics_restrictions.cpp index 45a8063e9..790af82cf 100644 --- a/src/graphics/graphics_restrictions.cpp +++ b/src/graphics/graphics_restrictions.cpp @@ -44,7 +44,7 @@ namespace GraphicsRestrictions /** The list of names used in the XML file for the graphics * restriction types. They must be in the same order as the types. */ - std::array m_names_of_restrictions = { + std::array m_names_of_restrictions = { "UniformBufferObject", "GeometryShader", "DrawIndirect", @@ -67,6 +67,7 @@ namespace GraphicsRestrictions "ColorBufferFloat", "DriverRecentEnough", "HighDefinitionTextures", + "HighDefinitionTextures256", "AdvancedPipeline", "FramebufferSRGB", "FramebufferSRGBWorkaround1", diff --git a/src/graphics/graphics_restrictions.hpp b/src/graphics/graphics_restrictions.hpp index 9b48dcb57..ef1d6dbae 100644 --- a/src/graphics/graphics_restrictions.hpp +++ b/src/graphics/graphics_restrictions.hpp @@ -56,6 +56,7 @@ namespace GraphicsRestrictions GR_COLOR_BUFFER_FLOAT, GR_DRIVER_RECENT_ENOUGH, GR_HIGHDEFINITION_TEXTURES, + GR_HIGHDEFINITION_TEXTURES_256, GR_ADVANCED_PIPELINE, GR_FRAMEBUFFER_SRGB, GR_FRAMEBUFFER_SRGB_WORKAROUND1,