diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 82b16d67bd62d1be2d00b79002f292b78f80799c..d52f0b68fad5cb3abe0013344620f22015ba96b9 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2286,12 +2286,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
         if (local_light_kill)
         {
             gDeferredSoftenWaterProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
-            gDeferredSoftenWaterProgram.addPermutation("HAS_SSAO", "1");
         }
 
 		if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
 		{ //if using SSAO, take screen space light map into account as if shadows are enabled
 			gDeferredSoftenWaterProgram.mShaderLevel = llmax(gDeferredSoftenWaterProgram.mShaderLevel, 2);
+            gDeferredSoftenWaterProgram.addPermutation("HAS_SSAO", "1");
 		}
 
 		success = gDeferredSoftenWaterProgram.createShader(NULL, NULL);