summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-05-19 17:28:23 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-05-19 17:28:23 -0700
commit19a06478d9863c451450b7c9e2f931ba587a3cec (patch)
treec7a700998ebd071b447ae1e50fb08be6f1eaf004 /indra/newview/pipeline.cpp
parenta704394bb50012e3e8d3be358d286188afccbdf2 (diff)
SH-1618 FIX -- Lighting and shadows crash ATI macs
* Fixed ATI mac "lighting and shadows" related crash * Fixed up numerous GL errors on macs related to multiple color formats, the use of glEnable/glDisable on textures above the texture unit count and old ATI-specific code that was not appropriate for Mac. * Disabled SSAO for ATI macs due to it not working with shadows * Ongoing work to properly get shadows and SSAO functioning on ATI macs is required. Reviewed by davep
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f64eb89866..845a87b8cf 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -625,8 +625,14 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
addDeferredAttachments(mDeferredScreen);
- mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+
+#if LL_DARWIN
+ // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
+ mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+#else
mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+#endif
if (shadow_detail > 0 || ssao)
{ //only need mDeferredLight[0] for shadows OR ssao
@@ -651,7 +657,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
mDeferredLight[2].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
for (U32 i = 0; i < 2; i++)
{
+#if LL_DARWIN
+ // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO
+ mGIMapPost[i].allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+#else
mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+#endif
}
}
else
@@ -666,8 +677,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY)
F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale");
+#if LL_DARWIN
+ U32 shadow_fmt = 0;
+#else
//HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug)
U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0;
+#endif
if (shadow_detail > 0)
{ //allocate 4 sun shadow maps