From bf44d3f98e0419195e6bb601aa6a028aa973f449 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 3 Feb 2012 14:12:36 -0600 Subject: [PATCH] Prevent using multisample FBOs if FBOs are not enabled, or multisample FBOs are unsupported --- indra/newview/pipeline.cpp | 11 ++++++++--- indra/newview/pipeline.h | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f9cf2030e..cb3c19b74 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -607,7 +607,13 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) { refreshCachedSettings(); static const LLCachedControl 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) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 5b139f860..47e7b963e 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -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