Author: vcheng Date: 2015-12-23 21:09:18 +0000 (Wed, 23 Dec 2015) New Revision: 15657
Added: packages/trunk/supertuxkart/debian/patches/srgb_workaround.patch Modified: packages/trunk/supertuxkart/debian/changelog packages/trunk/supertuxkart/debian/patches/series Log: supertuxkart: add srgb_workaround.patch Modified: packages/trunk/supertuxkart/debian/changelog =================================================================== --- packages/trunk/supertuxkart/debian/changelog 2015-12-23 06:15:19 UTC (rev 15656) +++ packages/trunk/supertuxkart/debian/changelog 2015-12-23 21:09:18 UTC (rev 15657) @@ -1,3 +1,11 @@ +supertuxkart (0.9.1-3) unstable; urgency=medium + + * Add srgb_workaround.patch to provide workaround for darker screens on + Intel GPUs with mesa >= 10.6. (Closes: #808857) More info upstream at: + https://github.com/supertuxkart/stk-code/issues/2190 + + -- Vincent Cheng <[email protected]> Wed, 23 Dec 2015 13:07:40 -0800 + supertuxkart (0.9.1-2) unstable; urgency=medium * Fix fix_angelscript_build_on_non-x86_arches.patch to fix FTBFS on armhf. Modified: packages/trunk/supertuxkart/debian/patches/series =================================================================== --- packages/trunk/supertuxkart/debian/patches/series 2015-12-23 06:15:19 UTC (rev 15656) +++ packages/trunk/supertuxkart/debian/patches/series 2015-12-23 21:09:18 UTC (rev 15657) @@ -2,6 +2,7 @@ link_against_system_libs.patch remove_irrlicht_embedded_libs.patch fix_angelscript_build_on_non-x86_arches.patch +srgb_workaround.patch # Irrlicht patches taken directly from irrlicht source package in Debian irrlicht/arch-support.diff irrlicht/use-system-libs.diff Added: packages/trunk/supertuxkart/debian/patches/srgb_workaround.patch =================================================================== --- packages/trunk/supertuxkart/debian/patches/srgb_workaround.patch (rev 0) +++ packages/trunk/supertuxkart/debian/patches/srgb_workaround.patch 2015-12-23 21:09:18 UTC (rev 15657) @@ -0,0 +1,168 @@ +Description: Workaround for darker screen on Intel GPUs with mesa >= 10.6 +Origin: upstream, https://github.com/supertuxkart/stk-code/issues/2190 +Bug-Debian: https://bugs.debian.org/808857 +Last-Update: 2015-12-23 + +diff --git a/data/graphical_restrictions.xml b/data/graphical_restrictions.xml +index 16bb607..b2480dc 100644 +--- a/data/graphical_restrictions.xml ++++ b/data/graphical_restrictions.xml +@@ -4,6 +4,7 @@ + <card is="Intel(R) HD Graphics 3000" os="windows" disable="AdvancedPipeline"/> + <card is="Intel(R) HD Graphics 3000" os="windows" disable="FramebufferSRGBWorking"/> + <card contains="Intel" os="osx" disable="GI"/> ++ <card contains="Intel" os="linux" disable="FramebufferSRGBCapable"/> + <card contains="Intel" disable="TextureCompressionS3TC"/> + <card contains="Intel" os="windows" disable="HighDefinitionTextures"/> + <card contains="NVIDIA" os="windows" version="<344.65" disable="BufferStorage"/> +diff --git a/src/graphics/central_settings.cpp b/src/graphics/central_settings.cpp +index 719e7f4..2eace45 100644 +--- a/src/graphics/central_settings.cpp ++++ b/src/graphics/central_settings.cpp +@@ -46,10 +46,11 @@ void CentralVideoSettings::init() + hasTextureCompression = false; + hasUBO = false; + hasGS = false; +- m_GI_has_artifact = false; + ++ m_GI_has_artifact = false; + m_need_rh_workaround = false; + m_need_srgb_workaround = false; ++ m_need_srgb_visual_workaround = false; + + // Call to glGetIntegerv should not be made if --no-graphics is used + if (!ProfileWorld::isNoGraphics()) +@@ -179,6 +180,16 @@ void CentralVideoSettings::init() + // Bindless textures are all treated RGB even sRGB one + m_need_srgb_workaround = true; + } ++ ++ // Check if visual is sRGB-capable ++ if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FRAMEBUFFER_SRGB_CAPABLE) && ++ m_glsl == true) ++ { ++ GLint param = GL_SRGB; ++ glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_BACK_LEFT, ++ GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, ¶m); ++ m_need_srgb_visual_workaround = (param != GL_SRGB); ++ } + } + } + +@@ -207,6 +218,11 @@ bool CentralVideoSettings::needsRGBBindlessWorkaround() const + return m_need_srgb_workaround; + } + ++bool CentralVideoSettings::needsSRGBCapableVisualWorkaround() const ++{ ++ return m_need_srgb_visual_workaround; ++} ++ + bool CentralVideoSettings::isARBGeometryShader4Usable() const + { + return hasGS; +diff --git a/src/graphics/central_settings.hpp b/src/graphics/central_settings.hpp +index dbde9c6..c9a5bbe 100644 +--- a/src/graphics/central_settings.hpp ++++ b/src/graphics/central_settings.hpp +@@ -43,6 +43,7 @@ private: + + bool m_need_rh_workaround; + bool m_need_srgb_workaround; ++ bool m_need_srgb_visual_workaround; + bool m_GI_has_artifact; + public: + void init(); +@@ -52,6 +53,7 @@ public: + // Needs special handle ? + bool needRHWorkaround() const; + bool needsRGBBindlessWorkaround() const; ++ bool needsSRGBCapableVisualWorkaround() const; + + // Extension is available and safe to use + bool isARBUniformBufferObjectUsable() const; +diff --git a/src/graphics/graphics_restrictions.cpp b/src/graphics/graphics_restrictions.cpp +index 7d132ea..83c6ded 100644 +--- a/src/graphics/graphics_restrictions.cpp ++++ b/src/graphics/graphics_restrictions.cpp +@@ -59,6 +59,7 @@ namespace GraphicsRestrictions + "HighDefinitionTextures", + "AdvancedPipeline", + "FramebufferSRGBWorking", ++ "FramebufferSRGBCapable", + "GI", + }; + } // namespace Private +diff --git a/src/graphics/graphics_restrictions.hpp b/src/graphics/graphics_restrictions.hpp +index ab44ce9..faf5151 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_FRAMEBUFFER_SRGB_CAPABLE, + GR_GI, + GR_COUNT /** MUST be last entry. */ + } ; +diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp +index e736293..8bbb3c3 100644 +--- a/src/graphics/irr_driver.cpp ++++ b/src/graphics/irr_driver.cpp +@@ -344,6 +344,8 @@ void IrrDriver::createListOfVideoModes() + */ + void IrrDriver::initDevice() + { ++ SIrrlichtCreationParameters params; ++ + // If --no-graphics option was used, the null device can still be used. + if (!ProfileWorld::isNoGraphics()) + { +@@ -426,7 +428,6 @@ void IrrDriver::initDevice() + m_device->drop(); + m_device = NULL; + +- SIrrlichtCreationParameters params; + params.ForceLegacyDevice = (UserConfigParams::m_force_legacy_device || + UserConfigParams::m_gamepad_visualisation); + +@@ -505,6 +506,30 @@ void IrrDriver::initDevice() + { + Log::fatal("irr_driver", "Couldn't initialise irrlicht device. Quitting.\n"); + } ++ ++ CVS->init(); ++ ++ // This is the ugly hack for intel driver on linux, which doesn't ++ // use sRGB-capable visual, even if we request it. This causes ++ // the screen to be darker than expected. It affects mesa 10.6 and newer. ++ // Though we are able to force to use the proper format on mesa side by ++ // setting WithAlphaChannel parameter. ++ if (!ProfileWorld::isNoGraphics() && CVS->needsSRGBCapableVisualWorkaround()) ++ { ++ Log::warn("irr_driver", "Created visual is not sRGB-capable. " ++ "Re-creating device to workaround the issue."); ++ m_device->closeDevice(); ++ m_device->drop(); ++ ++ params.WithAlphaChannel = true; ++ ++ m_device = createDeviceEx(params); ++ ++ if(!m_device) ++ { ++ Log::fatal("irr_driver", "Couldn't initialise irrlicht device. Quitting.\n"); ++ } ++ } + + m_scene_manager = m_device->getSceneManager(); + m_gui_env = m_device->getGUIEnvironment(); +@@ -513,8 +538,6 @@ void IrrDriver::initDevice() + + m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize(); + +- CVS->init(); +- + m_spherical_harmonics = new SphericalHarmonics(m_scene_manager->getAmbientLight().toSColor()); + + if (UserConfigParams::m_shadows_resolution != 0 && _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

