From 710b529372f4d7da699318c4761963ae9dde9a63 Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Sun, 21 Jul 2013 16:29:05 -0700
Subject: [PATCH] NORSPEC-311 NORSPEC-312 make mac happy with shader ifdefs for
 haze/masking

---
 .../newview/app_settings/shaders/class1/deferred/alphaF.glsl  | 4 ++--
 .../app_settings/shaders/class1/deferred/fullbrightF.glsl     | 4 ++--
 .../app_settings/shaders/class1/deferred/fullbrightV.glsl     | 4 ++--
 indra/newview/llviewershadermgr.cpp                           | 1 -
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 69b0f8f012c..69b29269c7e 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -136,7 +136,7 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc)
 }
 #endif
 
-#if WATER_FOG
+#ifdef WATER_FOG
 uniform vec4 waterPlane;
 uniform vec4 waterFogColor;
 uniform float waterFogDensity;
@@ -330,7 +330,7 @@ void main()
 
 	color.rgb = linear_to_srgb(color.rgb);
 
-#if WATER_FOG
+#ifdef WATER_FOG
 	color = applyWaterFogDeferred(pos.xyz, color);
 #endif
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 1e8df68a727..a6f55dfb46e 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -42,7 +42,7 @@ VARYING vec2 vary_texcoord0;
 vec3 fullbrightAtmosTransport(vec3 light);
 vec3 fullbrightScaleSoftClip(vec3 light);
 
-#if HAS_ALPHA_MASK
+#ifdef HAS_ALPHA_MASK
 uniform float minimum_alpha;
 #endif
 
@@ -122,7 +122,7 @@ void main()
 
 	float final_alpha = color.a * vertex_color.a;
 
-#if HAS_ALPHA_MASK
+#ifdef HAS_ALPHA_MASK
 	if (color.a < minimum_alpha)
 	{
 		discard;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 22f47b75724..8e899e3e0f3 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -40,7 +40,7 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
 vec3 scaleDownLight(vec3 light);
 vec3 scaleUpLight(vec3 light);
 
-#if WATER_FOG
+#ifdef WATER_FOG
 VARYING vec3 vary_position;
 #endif
 
@@ -57,7 +57,7 @@ void main()
 
 	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
 
-#if WATER_FOG
+#ifdef WATER_FOG
 	vary_position = pos.xyz;
 #endif
 
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index f0e48252799..25f2fbda072 100755
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1528,7 +1528,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
 		gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB));
 		gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1");
 		//gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1");
-		gDeferredAlphaProgram.addPermutation("WATER_FOG", "0");
 		gDeferredAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0");
 		gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
 
-- 
GitLab