From c6acd4723526ed82e79dccef18aaf4821e53dfeb Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Wed, 8 Feb 2012 15:14:03 -0600
Subject: [PATCH] SH-2592 Fix for some shader uniforms using the wrong vector
 size.

---
 indra/newview/app_settings/shaders/class1/deferred/skyV.glsl  | 2 --
 .../app_settings/shaders/class2/windlight/cloudsV.glsl        | 4 ++--
 indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 2 --
 indra/newview/llwaterparammanager.cpp                         | 2 +-
 indra/newview/llwlparamset.cpp                                | 4 ++--
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 2c8808bdcef..cb7603f4fd3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -55,8 +55,6 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
-
 void main()
 {
 
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 24063597215..c1dd45cd672 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -60,7 +60,7 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
+uniform float cloud_scale;
 
 void main()
 {
@@ -169,7 +169,7 @@ void main()
 	// Texture coords
 	vary_texcoord0 = texcoord0;
 	vary_texcoord0.xy -= 0.5;
-	vary_texcoord0.xy /= cloud_scale.x;
+	vary_texcoord0.xy /= cloud_scale;
 	vary_texcoord0.xy += 0.5;
 
 	vary_texcoord1 = vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 6a87caa8cf3..3788ddaf2d4 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -53,8 +53,6 @@ uniform vec4 glow;
 
 uniform vec4 cloud_color;
 
-uniform vec4 cloud_scale;
-
 void main()
 {
 
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 20b34637b8c..e3861123348 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -194,7 +194,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
 		shader->uniform4fv("waterPlane", 1, mWaterPlane.mV);
 		shader->uniform1f("waterFogDensity", getFogDensity());
 		shader->uniform1f("waterFogKS", mWaterFogKS);
-		shader->uniform4f("distance_multiplier", 0, 0, 0, 0);
+		shader->uniform1f("distance_multiplier", 0);
 	}
 }
 
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 1e95b3ea4a7..b04d30db552 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -75,9 +75,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const
 			stop_glerror();
 		}
 		else if (param == "cloud_scale" || param == "cloud_shadow" ||
-				 param == "density_multiplier" ||
+				 param == "density_multiplier" || param == "distance_multiplier" ||
 				 param == "haze_density" || param == "haze_horizon" ||
-				 param == "max_y")
+				 param == "max_y" )
 		{
 			F32 val = (F32) i->second[0].asReal();
 
-- 
GitLab