summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-06-25 10:21:59 -0700
committerGraham Linden <graham@lindenlab.com>2013-06-25 10:21:59 -0700
commit53789008221043052360dcff2c1faeb11c64d9f6 (patch)
tree059238feed716a103cdc6636860187cb121823a3 /indra/newview/pipeline.cpp
parent269519e267cfb1a5d61205684f0030a726deb516 (diff)
NORSPEC-250 add setting to force higher LUT precision and made LUT cleanup match creation
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rwxr-xr-xindra/newview/pipeline.cpp21
1 files changed, 19 insertions, 2 deletions
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);