Improved work around for graphics cards that do not allow stencil for FBOs

(like Intel hd3000). If a FBO with stencil can not be allocated, disable
stencil, and switch off pixel shaders.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14643 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-12-06 12:05:21 +00:00
parent ee2cea0aca
commit 94abdc5b05

View File

@ -49,13 +49,20 @@ RTT::RTT()
//
// Optionally, the collapse ones use a smaller format.
// Work around for intel hd3000 cards :(
#ifdef DONT_USE_STENCILS
bool stencil = false;
#else
bool stencil = true;
#endif
rtts[RTT_TMP1] = drv->addRenderTargetTexture(res, "rtt.tmp1", ECF_A8R8G8B8, stencil);
if(!rtts[RTT_TMP1])
{
// Work around for intel hd3000 cards :(
stencil = false;
rtts[RTT_TMP1] = drv->addRenderTargetTexture(res, "rtt.tmp1", ECF_A8R8G8B8, stencil);
Log::error("rtts", "Stencils for rtt not available, most likely a driver bug.");
if(UserConfigParams::m_pixel_shaders)
{
Log::error("rtts", "This requires pixel shaders to be disabled.");
UserConfigParams::m_pixel_shaders = false;
}
}
rtts[RTT_TMP2] = drv->addRenderTargetTexture(res, "rtt.tmp2", ECF_A8R8G8B8, stencil);
rtts[RTT_TMP3] = drv->addRenderTargetTexture(res, "rtt.tmp3", ECF_A8R8G8B8, stencil);
rtts[RTT_TMP4] = drv->addRenderTargetTexture(res, "rtt.tmp4", ECF_A8R8G8B8, stencil);