Prevent using multisample FBOs if FBOs are not enabled, or multisample FBOs are unsupported

This commit is contained in:
Shyotl
2012-02-03 14:12:36 -06:00
parent b6fa215c4e
commit bf44d3f98e
2 changed files with 8 additions and 4 deletions

View File

@@ -607,7 +607,13 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
{
refreshCachedSettings();
static const LLCachedControl<U32> RenderFSAASamples("RenderFSAASamples",0);
U32 samples = RenderFSAASamples;
U32 samples = RenderFSAASamples.get() - RenderFSAASamples.get() % 2; //Must be multipe of 2.
//Don't multisample if not using FXAA, or if fbos are disabled, or if multisampled fbos are not supported.
if(!LLPipeline::sRenderDeferred && (!LLRenderTarget::sUseFBO || !gGLManager.mHasFramebufferMultisample))
{
samples = 0;
}
//try to allocate screen buffers at requested resolution and samples
// - on failure, shrink number of samples and try again
@@ -628,8 +634,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
releaseScreenBuffers();
}
if(LLPipeline::sRenderDeferred || !LLRenderTarget::sUseFBO || !gGLManager.mHasFramebufferMultisample)
samples = 0;
samples = 0;
//reduce resolution
while (resY > 0 && resX > 0)

View File

@@ -502,7 +502,6 @@ public:
static BOOL sRenderBump;
static BOOL sBakeSunlight;
static BOOL sNoAlpha;
static BOOL sUseFBO;
static BOOL sUseFarClip;
static BOOL sShadowRender;
static BOOL sSkipUpdate; //skip lod updates