From 53789008221043052360dcff2c1faeb11c64d9f6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 25 Jun 2013 10:21:59 -0700 Subject: NORSPEC-250 add setting to force higher LUT precision and made LUT cleanup match creation --- indra/newview/app_settings/settings.xml | 12 ++++++++++++ indra/newview/pipeline.cpp | 21 +++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 344079b640..ebb01fb330 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8592,6 +8592,18 @@ + RenderSpecularPrecision + + Comment + Force 32-bit floating point LUT + Persist + 1 + Type + U32 + Value + 0 + + RenderSpecularResX Comment diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9713f963b9..442b0b6d2d 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1201,7 +1201,15 @@ void LLPipeline::releaseLUTBuffers() { if (mLightFunc) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 0, 1, &mLightFunc); + U32 use_high_precision = gSavedSettings.getU32("RenderSpecularPrecision"); + + U32 pix_format = use_high_precision ? GL_R32F : GL_R16F; + +#if LL_DARWIN + pix_format = GL_R32F; +#endif + + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, pix_format, 0, 1, &mLightFunc); mLightFunc = 0; } } @@ -1402,7 +1410,16 @@ void LLPipeline::createLUTBuffers() } // Need to work around limited precision with 10.6.8 and older drivers // - U32 pix_format = GL_R32F; + U32 use_high_precision = gSavedSettings.getU32("RenderSpecularPrecision"); + + U32 pix_format = use_high_precision ? GL_R32F : GL_R16F; + +#if LL_DARWIN + // Forced to work around 10.6.8. driver bugs on most every GPU + // + pix_format = GL_R32F; +#endif + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); -- cgit v1.2.3