summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/app_settings/settings.xml12
-rwxr-xr-xindra/newview/pipeline.cpp21
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);