From 1b5af4be298198cedc407b6b294b2d71129d7731 Mon Sep 17 00:00:00 2001
From: ruslantproductengine <ruslantproductengine@lindenlab.com>
Date: Fri, 13 May 2016 18:47:23 +0300
Subject: Add invert texture coordinates for media textures.

---
 indra/llrender/llglslshader.cpp | 22 ++++++++++++++++++++++
 indra/llrender/llglslshader.h   |  1 +
 indra/llrender/llrender.cpp     |  8 ++++++++
 indra/llrender/llrender.h       |  1 +
 indra/llrender/llshadermgr.cpp  |  1 +
 indra/llrender/llshadermgr.h    |  3 ++-
 6 files changed, 35 insertions(+), 1 deletion(-)

(limited to 'indra/llrender')

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 52b8de8365..8790b1ed7d 100755
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -1278,6 +1278,28 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
     }
 }
 
+void LLGLSLShader::uniform1b(U32 index, GLboolean x)
+{
+	if (mProgramObject > 0)
+	{
+		if (mUniform.size() <= index)
+		{
+			UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+			return;
+		}
+
+		if (mUniform[index] >= 0)
+		{
+			std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+			if (iter == mValue.end() || iter->second.mV[0] != x)
+			{
+				glUniform1iARB(mUniform[index], x);
+				mValue[mUniform[index]] = LLVector4(x, 0.f, 0.f, 0.f);
+			}
+		}
+	}
+}
+
 GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform)
 {
     GLint ret = -1;
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 0746e8760a..8663a5a5ff 100755
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -125,6 +125,7 @@ public:
 	void uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
 	void uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
 	void uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat *v);
+	void uniform1b(U32 index, GLboolean b);
 
 	void setMinimumAlpha(F32 minimum);
 
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 69420dd0bb..b5ed67f66a 100755
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1466,6 +1466,14 @@ U32 LLRender::getMatrixMode()
 	return mMatrixMode;
 }
 
+void LLRender::setInverseTexCoordByY(bool v)
+{
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+	if (shader)
+	{
+		shader->uniform1b(LLShaderMgr::INVERSE_TEX_Y, v);
+	}
+}
 
 void LLRender::loadIdentity()
 {
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index a67fb8da52..4c3547f8e4 100755
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -355,6 +355,7 @@ public:
 	void multMatrix(const GLfloat* m);
 	void matrixMode(U32 mode);	
 	U32 getMatrixMode();
+	void setInverseTexCoordByY(bool v);
 
 	const glh::matrix4f& getModelviewMatrix();
 	const glh::matrix4f& getProjectionMatrix();
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index b2be3cc3b6..79e0b3da28 100755
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1206,6 +1206,7 @@ void LLShaderMgr::initAttribsAndUniforms()
 
 	mReservedUniforms.push_back("origin");
 	mReservedUniforms.push_back("display_gamma");
+	mReservedUniforms.push_back("invert_tex_y");
 	llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS);
 
 	std::set<std::string> dupe_check;
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 394b38f832..50b7c8b9d9 100755
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -215,7 +215,8 @@ public:
 		TERRAIN_ALPHARAMP,
 		
 		SHINY_ORIGIN,
-DISPLAY_GAMMA,
+		DISPLAY_GAMMA,
+		INVERSE_TEX_Y,
 		END_RESERVED_UNIFORMS
 	} eGLSLReservedUniforms;
 
-- 
cgit v1.2.3


From eebbda288d9ba4f8f3061c05ff5eb2d7b0d1cb35 Mon Sep 17 00:00:00 2001
From: ruslantproductengine <ruslantproductengine@lindenlab.com>
Date: Mon, 18 Jul 2016 20:09:18 +0300
Subject: Backed out changeset: 5fe5ad059c05

---
 indra/llrender/llglslshader.cpp | 22 ----------------------
 indra/llrender/llglslshader.h   |  1 -
 indra/llrender/llrender.cpp     |  8 --------
 indra/llrender/llrender.h       |  1 -
 indra/llrender/llshadermgr.cpp  |  1 -
 indra/llrender/llshadermgr.h    |  3 +--
 6 files changed, 1 insertion(+), 35 deletions(-)

(limited to 'indra/llrender')

diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 2554ccdbe4..58c1186a3e 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -1274,28 +1274,6 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
     }
 }
 
-void LLGLSLShader::uniform1b(U32 index, GLboolean x)
-{
-	if (mProgramObject > 0)
-	{
-		if (mUniform.size() <= index)
-		{
-			UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
-			return;
-		}
-
-		if (mUniform[index] >= 0)
-		{
-			std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
-			if (iter == mValue.end() || iter->second.mV[0] != x)
-			{
-				glUniform1iARB(mUniform[index], x);
-				mValue[mUniform[index]] = LLVector4(x, 0.f, 0.f, 0.f);
-			}
-		}
-	}
-}
-
 GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform)
 {
     GLint ret = -1;
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 8663a5a5ff..0746e8760a 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -125,7 +125,6 @@ public:
 	void uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
 	void uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v);
 	void uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat *v);
-	void uniform1b(U32 index, GLboolean b);
 
 	void setMinimumAlpha(F32 minimum);
 
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index b5ed67f66a..69420dd0bb 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1466,14 +1466,6 @@ U32 LLRender::getMatrixMode()
 	return mMatrixMode;
 }
 
-void LLRender::setInverseTexCoordByY(bool v)
-{
-	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
-	if (shader)
-	{
-		shader->uniform1b(LLShaderMgr::INVERSE_TEX_Y, v);
-	}
-}
 
 void LLRender::loadIdentity()
 {
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 4c3547f8e4..a67fb8da52 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -355,7 +355,6 @@ public:
 	void multMatrix(const GLfloat* m);
 	void matrixMode(U32 mode);	
 	U32 getMatrixMode();
-	void setInverseTexCoordByY(bool v);
 
 	const glh::matrix4f& getModelviewMatrix();
 	const glh::matrix4f& getProjectionMatrix();
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 7d857c6930..55f0791174 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1190,7 +1190,6 @@ void LLShaderMgr::initAttribsAndUniforms()
 
 	mReservedUniforms.push_back("origin");
 	mReservedUniforms.push_back("display_gamma");
-	mReservedUniforms.push_back("invert_tex_y");
 	llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS);
 
 	std::set<std::string> dupe_check;
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 50b7c8b9d9..394b38f832 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -215,8 +215,7 @@ public:
 		TERRAIN_ALPHARAMP,
 		
 		SHINY_ORIGIN,
-		DISPLAY_GAMMA,
-		INVERSE_TEX_Y,
+DISPLAY_GAMMA,
 		END_RESERVED_UNIFORMS
 	} eGLSLReservedUniforms;
 
-- 
cgit v1.2.3


From 20cf275d21c0dce569bb3a16393b529c5c9f1c6c Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Mon, 29 Aug 2016 18:51:32 +0000
Subject: MAINT-5011: Work around gcc 4.7.2 overly (?) picky fatal warning.

---
 indra/llrender/llimagegl.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to 'indra/llrender')

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index ebed454271..01c1d81823 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -240,6 +240,15 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
 
 //----------------------------------------------------------------------------
 
+#if LL_LINUX
+// gcc 4.7.2 produces this error for the following function, which nat has
+// been unable to diagnose as an actual problem:
+// llimagegl.cpp:247:2: error: '<anonymous>.LLTrace::BlockTimer::mStartTime'
+// may be used uninitialized in this function [-Werror=uninitialized]
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
+
 static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_STATS("Image Stats");
 // static
 void LLImageGL::updateStats(F32 current_time)
@@ -250,6 +259,11 @@ void LLImageGL::updateStats(F32 current_time)
 	sCurBoundTextureMemory = S32Bytes(0);
 }
 
+#if LL_LINUX
+// In general we do want to know about uninitialized variables!
+#pragma GCC diagnostic pop
+#endif
+
 //static
 S32 LLImageGL::updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category)
 {
-- 
cgit v1.2.3


From bfb400ccd7fbf6718751aaab65c68c9a84aa7585 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 6 Sep 2016 20:41:23 -0400
Subject: Backed out changeset c30d8774c404: remove warning suppression for
 possibly-uninitialized data member in BlockTimer::BlockTimer.

NickyD suggested a real fix.
---
 indra/llrender/llimagegl.cpp | 14 --------------
 1 file changed, 14 deletions(-)

(limited to 'indra/llrender')

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 01c1d81823..ebed454271 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -240,15 +240,6 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
 
 //----------------------------------------------------------------------------
 
-#if LL_LINUX
-// gcc 4.7.2 produces this error for the following function, which nat has
-// been unable to diagnose as an actual problem:
-// llimagegl.cpp:247:2: error: '<anonymous>.LLTrace::BlockTimer::mStartTime'
-// may be used uninitialized in this function [-Werror=uninitialized]
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
-
 static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_STATS("Image Stats");
 // static
 void LLImageGL::updateStats(F32 current_time)
@@ -259,11 +250,6 @@ void LLImageGL::updateStats(F32 current_time)
 	sCurBoundTextureMemory = S32Bytes(0);
 }
 
-#if LL_LINUX
-// In general we do want to know about uninitialized variables!
-#pragma GCC diagnostic pop
-#endif
-
 //static
 S32 LLImageGL::updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category)
 {
-- 
cgit v1.2.3