Added ugly hack, which forces srgb-capable framebuffer creation for intel drivers on linux
This commit is contained in:
parent
b91bcaf554
commit
80d36208f1
@ -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="AdvancedPipeline"/>
|
||||||
<card is="Intel(R) HD Graphics 3000" os="windows" disable="FramebufferSRGBWorking"/>
|
<card is="Intel(R) HD Graphics 3000" os="windows" disable="FramebufferSRGBWorking"/>
|
||||||
<card contains="Intel" os="osx" disable="GI"/>
|
<card contains="Intel" os="osx" disable="GI"/>
|
||||||
|
<card contains="Intel" os="linux" version="<12.0" disable="FramebufferSRGBCapable"/>
|
||||||
<card contains="Intel" disable="TextureCompressionS3TC"/>
|
<card contains="Intel" disable="TextureCompressionS3TC"/>
|
||||||
<card contains="Intel" os="windows" disable="HighDefinitionTextures"/>
|
<card contains="Intel" os="windows" disable="HighDefinitionTextures"/>
|
||||||
<card contains="NVIDIA" os="windows" version="<344.65" disable="BufferStorage"/>
|
<card contains="NVIDIA" os="windows" version="<344.65" disable="BufferStorage"/>
|
||||||
|
@ -59,6 +59,7 @@ namespace GraphicsRestrictions
|
|||||||
"HighDefinitionTextures",
|
"HighDefinitionTextures",
|
||||||
"AdvancedPipeline",
|
"AdvancedPipeline",
|
||||||
"FramebufferSRGBWorking",
|
"FramebufferSRGBWorking",
|
||||||
|
"FramebufferSRGBCapable",
|
||||||
"GI",
|
"GI",
|
||||||
};
|
};
|
||||||
} // namespace Private
|
} // namespace Private
|
||||||
|
@ -53,6 +53,7 @@ namespace GraphicsRestrictions
|
|||||||
GR_HIGHDEFINITION_TEXTURES,
|
GR_HIGHDEFINITION_TEXTURES,
|
||||||
GR_ADVANCED_PIPELINE,
|
GR_ADVANCED_PIPELINE,
|
||||||
GR_FRAMEBUFFER_SRGB_WORKING,
|
GR_FRAMEBUFFER_SRGB_WORKING,
|
||||||
|
GR_FRAMEBUFFER_SRGB_CAPABLE,
|
||||||
GR_GI,
|
GR_GI,
|
||||||
GR_COUNT /** MUST be last entry. */
|
GR_COUNT /** MUST be last entry. */
|
||||||
} ;
|
} ;
|
||||||
|
@ -346,6 +346,8 @@ void IrrDriver::createListOfVideoModes()
|
|||||||
*/
|
*/
|
||||||
void IrrDriver::initDevice()
|
void IrrDriver::initDevice()
|
||||||
{
|
{
|
||||||
|
SIrrlichtCreationParameters params;
|
||||||
|
|
||||||
// If --no-graphics option was used, the null device can still be used.
|
// If --no-graphics option was used, the null device can still be used.
|
||||||
if (!ProfileWorld::isNoGraphics())
|
if (!ProfileWorld::isNoGraphics())
|
||||||
{
|
{
|
||||||
@ -428,7 +430,6 @@ void IrrDriver::initDevice()
|
|||||||
m_device->drop();
|
m_device->drop();
|
||||||
m_device = NULL;
|
m_device = NULL;
|
||||||
|
|
||||||
SIrrlichtCreationParameters params;
|
|
||||||
params.ForceLegacyDevice = (UserConfigParams::m_force_legacy_device ||
|
params.ForceLegacyDevice = (UserConfigParams::m_force_legacy_device ||
|
||||||
UserConfigParams::m_gamepad_visualisation);
|
UserConfigParams::m_gamepad_visualisation);
|
||||||
|
|
||||||
@ -509,6 +510,28 @@ void IrrDriver::initDevice()
|
|||||||
Log::fatal("irr_driver", "Couldn't initialise irrlicht device. Quitting.\n");
|
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. Setting WithAlphaChannel
|
||||||
|
// to true forces using the proper format on mesa side.
|
||||||
|
if (!ProfileWorld::isNoGraphics() && GraphicsRestrictions::isDisabled(
|
||||||
|
GraphicsRestrictions::GR_FRAMEBUFFER_SRGB_CAPABLE))
|
||||||
|
{
|
||||||
|
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_scene_manager = m_device->getSceneManager();
|
||||||
m_gui_env = m_device->getGUIEnvironment();
|
m_gui_env = m_device->getGUIEnvironment();
|
||||||
m_video_driver = m_device->getVideoDriver();
|
m_video_driver = m_device->getVideoDriver();
|
||||||
@ -516,8 +539,6 @@ void IrrDriver::initDevice()
|
|||||||
|
|
||||||
m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize();
|
m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize();
|
||||||
|
|
||||||
CVS->init();
|
|
||||||
|
|
||||||
m_spherical_harmonics = new SphericalHarmonics(m_scene_manager->getAmbientLight().toSColor());
|
m_spherical_harmonics = new SphericalHarmonics(m_scene_manager->getAmbientLight().toSColor());
|
||||||
|
|
||||||
if (UserConfigParams::m_shadows_resolution != 0 &&
|
if (UserConfigParams::m_shadows_resolution != 0 &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user