summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp50
1 files changed, 18 insertions, 32 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index edd1546263..062808fe53 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -275,16 +275,11 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
mShaderList.push_back(&gUnderWaterProgram);
mShaderList.push_back(&gDeferredSunProgram);
mShaderList.push_back(&gDeferredSoftenProgram);
- mShaderList.push_back(&gDeferredMaterialProgram[1]);
- mShaderList.push_back(&gDeferredMaterialProgram[5]);
- mShaderList.push_back(&gDeferredMaterialProgram[9]);
- mShaderList.push_back(&gDeferredMaterialProgram[13]);
- mShaderList.push_back(&gDeferredMaterialProgram[1+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialProgram[5+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT]);
mShaderList.push_back(&gDeferredAlphaProgram);
mShaderList.push_back(&gDeferredSkinnedAlphaProgram);
+#if LL_DARWIN
+ mShaderList.push_back(&gDeferredSkinnedAlphaProgramMac);
+#endif
mShaderList.push_back(&gDeferredFullbrightProgram);
mShaderList.push_back(&gDeferredEmissiveProgram);
mShaderList.push_back(&gDeferredAvatarEyesProgram);
@@ -792,9 +787,6 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
// Load basic dependency shaders first
// All of these have to load for any shaders to function
-#if LL_DARWIN // Mac can't currently handle all 8 lights,
- S32 sum_lights_class = 2;
-#else
S32 sum_lights_class = 3;
// class one cards will get the lower sum lights
@@ -805,14 +797,21 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
{
sum_lights_class = 2;
}
-#endif
// If we have sun and moon only checked, then only sum those lights.
if (gPipeline.getLightingDetail() == 0)
{
sum_lights_class = 1;
}
-
+
+#if LL_DARWIN
+ // Work around driver crashes on older Macs when using deferred rendering
+ // NORSPEC-59
+ //
+ if (gGLManager.mIsMobileGF)
+ sum_lights_class = 3;
+#endif
+
// Use the feature table to mask out the max light level to use. Also make sure it's at least 1.
S32 max_light_class = gSavedSettings.getS32("RenderShaderLightingMaxLevel");
sum_lights_class = llclamp(sum_lights_class, 1, max_light_class);
@@ -1087,6 +1086,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredSkinnedDiffuseProgram.unload();
gDeferredSkinnedBumpProgram.unload();
gDeferredSkinnedAlphaProgram.unload();
+#if LL_DARWIN
+ gDeferredSkinnedAlphaProgramMac.unload();
+#endif
gDeferredBumpProgram.unload();
gDeferredImpostorProgram.unload();
gDeferredTerrainProgram.unload();
@@ -1111,7 +1113,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredPostProgram.unload();
gDeferredCoFProgram.unload();
gDeferredDoFCombineProgram.unload();
- gDeferredPostGammaCorrectProgram.unload();
gFXAAProgram.unload();
gDeferredWaterProgram.unload();
gDeferredWLSkyProgram.unload();
@@ -1414,10 +1415,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAlphaProgram.mShaderFiles.clear();
gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredAlphaProgram.addPermutation("INDEX_MODE", "1");
- gDeferredAlphaProgram.addPermutation("HAS_SKIN", "0");
- gDeferredAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0");
gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+
success = gDeferredAlphaProgram.createShader(NULL, NULL);
// Hack
@@ -1590,11 +1589,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true;
gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true;
gDeferredAvatarAlphaProgram.mShaderFiles.clear();
- gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB));
- gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3");
- gDeferredAvatarAlphaProgram.addPermutation("HAS_SKIN", "0");
- gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1");
+ gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaNoColorV.glsl", GL_VERTEX_SHADER_ARB));
+ gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms);
@@ -1602,16 +1598,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true;
gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true;
}
-
- if (success)
- {
- gDeferredPostGammaCorrectProgram.mName = "Deferred Gamma Correction Post Process";
- gDeferredPostGammaCorrectProgram.mShaderFiles.clear();
- gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB));
- gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredPostGammaCorrectProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
- success = gDeferredPostGammaCorrectProgram.createShader(NULL, NULL);
- }
if (success)
{