diff options
author | Graham Linden <graham@lindenlab.com> | 2013-06-25 10:21:59 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-06-25 10:21:59 -0700 |
commit | 53789008221043052360dcff2c1faeb11c64d9f6 (patch) | |
tree | 059238feed716a103cdc6636860187cb121823a3 | |
parent | 269519e267cfb1a5d61205684f0030a726deb516 (diff) |
NORSPEC-250 add setting to force higher LUT precision and made LUT cleanup match creation
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 12 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 21 |
2 files changed, 31 insertions, 2 deletions
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 @@ </array> </map> + <key>RenderSpecularPrecision</key> + <map> + <key>Comment</key> + <string>Force 32-bit floating point LUT</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>0</real> + </map> + <key>RenderSpecularResX</key> <map> <key>Comment</key> 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); |