diff options
author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2013-01-14 09:31:57 -0800 |
---|---|---|
committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2013-01-14 09:31:57 -0800 |
commit | 4de7c27d9343d866a313ca16f3f102e2750ddb89 (patch) | |
tree | a5a49491169f87a891a41e8916dcaa4e5c03302c /indra/newview/pipeline.cpp | |
parent | deb4dfbae5aa72c8e688f214f2e806b2345b93c5 (diff) | |
parent | cb676675335791d9dacd032c389a0346c725d9d7 (diff) |
Merge in viewer-development
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7255f8ec21..75f5e16452 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -799,7 +799,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); } - bool ret = doAllocateScreenBuffer(resX, resY); + eFBOStatus ret = doAllocateScreenBuffer(resX, resY); if (save_settings) { @@ -808,24 +808,35 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); } - return ret; + if (ret == FBO_FAILURE) + { //FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled + //NOTE: if the session closes successfully after this call, deferred rendering will be + // disabled on future sessions + if (LLPipeline::sRenderDeferred) + { + gSavedSettings.setBOOL("RenderDeferred", FALSE); + LLPipeline::refreshCachedSettings(); + } + } + + return ret == FBO_SUCCESS_FULLRES; } -bool LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) +LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) { - //try to allocate screen buffers at requested resolution and samples + // try to allocate screen buffers at requested resolution and samples // - on failure, shrink number of samples and try again // - if not multisampled, shrink resolution and try again (favor X resolution over Y) // Make sure to call "releaseScreenBuffers" after each failure to cleanup the partially loaded state U32 samples = RenderFSAASamples; - bool ret = true; + eFBOStatus ret = FBO_SUCCESS_FULLRES; if (!allocateScreenBuffer(resX, resY, samples)) { //failed to allocate at requested specification, return false - ret = false; + ret = FBO_FAILURE; releaseScreenBuffers(); //reduce number of samples @@ -834,7 +845,7 @@ bool LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) samples /= 2; if (allocateScreenBuffer(resX, resY, samples)) { //success - return ret; + return FBO_SUCCESS_LOWRES; } releaseScreenBuffers(); } @@ -847,14 +858,14 @@ bool LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY) resY /= 2; if (allocateScreenBuffer(resX, resY, samples)) { - return ret; + return FBO_SUCCESS_LOWRES; } releaseScreenBuffers(); resX /= 2; if (allocateScreenBuffer(resX, resY, samples)) { - return ret; + return FBO_SUCCESS_LOWRES; } releaseScreenBuffers(); } @@ -936,7 +947,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) } } - U32 width = (U32)(resX*scale); + U32 width = (U32) (resX*scale); U32 height = width; if (shadow_detail > 1) |