summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-01-17 08:32:09 -0800
committerGraham Linden <graham@lindenlab.com>2019-01-17 08:32:09 -0800
commit066eb59808d5649c745fdc6c37b62f2eb9a19b6f (patch)
treef020f149739116455ff83dd94fbc62884a619916 /indra/newview/llviewershadermgr.cpp
parent042454bda9506185ebf82e3bbdf4305214d6af84 (diff)
SL-10368
Fix OSX shader compile bug from use of #if FOO instead of #ifdef FOO or #if defined(FOO) preventing atmospherics (and thus ALM) from working on OSX.
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 000d67a4e2..1686aeea4f 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2142,7 +2142,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
+ if (gGLManager.mHasDepthClamp)
+ {
+ gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", "1");
+ }
success = gDeferredShadowProgram.createShader(NULL, NULL);
llassert(success);
}
@@ -2155,7 +2158,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowCubeProgram.mShaderFiles.clear();
gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowCubeV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
+ if (gGLManager.mHasDepthClamp)
+ {
+ gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", "1");
+ }
gDeferredShadowCubeProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = gDeferredShadowCubeProgram.createShader(NULL, NULL);
llassert(success);
@@ -2170,7 +2176,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowAlphaMaskProgram.mShaderFiles.clear();
gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
+ if (gGLManager.mHasDepthClamp)
+ {
+ gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", "1");
+ }
gDeferredShadowAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL);
llassert(success);
@@ -2185,7 +2194,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarShadowProgram.mShaderFiles.clear();
gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
+ if (gGLManager.mHasDepthClamp)
+ {
+ gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", "1");
+ }
gDeferredAvatarShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = gDeferredAvatarShadowProgram.createShader(NULL, NULL);
llassert(success);
@@ -2200,7 +2212,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAttachmentShadowProgram.mShaderFiles.clear();
gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0");
+ if (gGLManager.mHasDepthClamp)
+ {
+ gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", "1");
+ }
gDeferredAttachmentShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL);
llassert(success);
@@ -3862,6 +3877,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
success = gWLCloudProgram.createShader(NULL, NULL);
}
+ /* unused outside of ALM at the moment and failing to link on OSX for reasons only Timmy knows.
if (success)
{
gWLCloudShadowProgram.mName = "Windlight Cloud Shadow Program";
@@ -3874,7 +3890,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
gWLCloudShadowProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT];
gWLCloudShadowProgram.mShaderGroup = LLGLSLShader::SG_SKY;
success = gWLCloudShadowProgram.createShader(NULL, NULL);
- }
+ }*/
if (success)
{