summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-10-29 23:02:20 +0100
committerGraham Linden <graham@lindenlab.com>2018-10-29 23:02:20 +0100
commit536799d07e4298ff8157ef51ed00040e10a5ba65 (patch)
tree3f9322b25efd552a4d4b1c617b39b81136d1b084 /indra/llrender
parente9faa3cce8897af2a4303538672e2262ed39520a (diff)
SL-9977
SL-9973
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llgl.cpp63
-rw-r--r--indra/llrender/llgl.h9
-rw-r--r--indra/llrender/llglslshader.cpp50
-rw-r--r--indra/llrender/llglstates.h24
-rw-r--r--indra/llrender/llrender.cpp2
-rw-r--r--indra/llrender/llrender.h9
-rw-r--r--indra/llrender/llshadermgr.cpp63
-rw-r--r--indra/llrender/llshadermgr.h6
8 files changed, 165 insertions, 61 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 2f78b6e104..a55a72c18f 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -36,6 +36,7 @@
#include "llsys.h"
#include "llgl.h"
+#include "llglstates.h"
#include "llrender.h"
#include "llerror.h"
@@ -2478,27 +2479,45 @@ void LLGLDepthTest::checkState()
}
}
-LLGLSquashToFarClip::LLGLSquashToFarClip(glh::matrix4f P, U32 layer)
+LLGLSquashToFarClip::LLGLSquashToFarClip()
+{
+ glh::matrix4f proj = get_current_projection();
+ setProjectionMatrix(proj, 0);
+}
+
+LLGLSquashToFarClip::LLGLSquashToFarClip(glh::matrix4f& P, U32 layer)
+{
+ setProjectionMatrix(P, layer);
+}
+
+
+void LLGLSquashToFarClip::setProjectionMatrix(glh::matrix4f& projection, U32 layer)
{
F32 depth = 0.99999f - 0.0001f * layer;
for (U32 i = 0; i < 4; i++)
{
- P.element(2, i) = P.element(3, i) * depth;
+ projection.element(2, i) = projection.element(3, i) * depth;
}
+ U32 last_matrix_mode = gGL.getMatrixMode();
+
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.pushMatrix();
- gGL.loadMatrix(P.m);
- gGL.matrixMode(LLRender::MM_MODELVIEW);
+ gGL.loadMatrix(projection.m);
+
+ gGL.matrixMode(last_matrix_mode);
}
LLGLSquashToFarClip::~LLGLSquashToFarClip()
{
+ U32 last_matrix_mode = gGL.getMatrixMode();
+
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.popMatrix();
- gGL.matrixMode(LLRender::MM_MODELVIEW);
+
+ gGL.matrixMode(last_matrix_mode);
}
@@ -2561,5 +2580,39 @@ void LLGLSyncFence::wait()
#endif
}
+LLGLSPipelineSkyBox::LLGLSPipelineSkyBox()
+: mAlphaTest(GL_ALPHA_TEST)
+, mCullFace(GL_CULL_FACE)
+, mSquashClip()
+{
+ if (!LLGLSLShader::sNoFixedFunction)
+ {
+ glDisable(GL_LIGHTING);
+ glDisable(GL_FOG);
+ glDisable(GL_CLIP_PLANE0);
+ }
+}
+LLGLSPipelineSkyBox::~LLGLSPipelineSkyBox()
+{
+ if (!LLGLSLShader::sNoFixedFunction)
+ {
+ glEnable(GL_LIGHTING);
+ glEnable(GL_FOG);
+ glEnable(GL_CLIP_PLANE0);
+ }
+}
+LLGLSPipelineDepthTestSkyBox::LLGLSPipelineDepthTestSkyBox(bool depth_test, bool depth_write)
+: LLGLSPipelineSkyBox()
+, mDepth(depth_test ? GL_TRUE : GL_FALSE, depth_write ? GL_TRUE : GL_FALSE, GL_LEQUAL)
+{
+
+}
+
+LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_write)
+: LLGLSPipelineDepthTestSkyBox(depth_test, depth_write)
+, mBlend(GL_BLEND)
+{
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+}
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 4c4302d05b..96cbf2e3c2 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -360,14 +360,17 @@ private:
Modify and load projection matrix to push depth values to far clip plane.
Restores projection matrix on destruction.
- GL_MODELVIEW_MATRIX is active whenever program execution
- leaves this class.
+ Saves/restores matrix mode around projection manipulation.
Does not stack.
*/
class LLGLSquashToFarClip
{
public:
- LLGLSquashToFarClip(glh::matrix4f projection, U32 layer = 0);
+ LLGLSquashToFarClip();
+ LLGLSquashToFarClip(glh::matrix4f& projection, U32 layer = 0);
+
+ void setProjectionMatrix(glh::matrix4f& projection, U32 layer);
+
~LLGLSquashToFarClip();
};
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index c03d33080f..f0cc9acc06 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -37,12 +37,6 @@
#include "OpenGL/OpenGL.h"
#endif
-#ifdef LL_RELEASE_FOR_DOWNLOAD
-#define UNIFORM_ERRS LL_WARNS_ONCE("Shader")
-#else
-#define UNIFORM_ERRS LL_ERRS("Shader")
-#endif
-
// Lots of STL stuff in here, using namespace std to keep things more readable
using std::vector;
using std::pair;
@@ -456,12 +450,12 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
}
if( !success )
{
- LL_WARNS("ShaderLoading") << "Failed to link shader: " << mName << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "Failed to link shader: " << mName << LL_ENDL;
// Try again using a lower shader level;
if (mShaderLevel > 0)
{
- LL_WARNS("ShaderLoading") << "Failed to link using shader level " << mShaderLevel << " trying again using shader level " << (mShaderLevel - 1) << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "Failed to link using shader level " << mShaderLevel << " trying again using shader level " << (mShaderLevel - 1) << LL_ENDL;
mShaderLevel--;
return createShader(attributes,uniforms);
}
@@ -504,7 +498,7 @@ BOOL LLGLSLShader::attachObject(std::string object)
}
else
{
- LL_WARNS("ShaderLoading") << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL;
return FALSE;
}
}
@@ -519,7 +513,7 @@ void LLGLSLShader::attachObject(GLhandleARB object)
}
else
{
- LL_WARNS("ShaderLoading") << "Attempting to attach non existing shader object. " << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "Attempting to attach non existing shader object. " << LL_ENDL;
}
}
@@ -937,7 +931,7 @@ S32 LLGLSLShader::bindTexture(S32 uniform, LLTexture *texture, LLTexUnit::eTextu
{
if (uniform < 0 || uniform >= (S32)mTexture.size())
{
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL;
return -1;
}
@@ -963,7 +957,7 @@ S32 LLGLSLShader::unbindTexture(S32 uniform, LLTexUnit::eTextureType mode)
{
if (uniform < 0 || uniform >= (S32)mTexture.size())
{
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL;
return -1;
}
@@ -981,7 +975,7 @@ S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode)
{
if (uniform < 0 || uniform >= (S32)mTexture.size())
{
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL;
return -1;
}
S32 index = mTexture[uniform];
@@ -997,7 +991,7 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode)
{
if (uniform < 0 || uniform >= (S32)mTexture.size())
{
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL;
return -1;
}
S32 index = mTexture[uniform];
@@ -1026,7 +1020,7 @@ void LLGLSLShader::uniform1i(U32 index, GLint x)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1048,7 +1042,7 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1070,7 +1064,7 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1093,7 +1087,7 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1116,7 +1110,7 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1139,7 +1133,7 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1162,7 +1156,7 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1185,7 +1179,7 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1208,7 +1202,7 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1231,7 +1225,7 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v)
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1254,7 +1248,7 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1271,7 +1265,7 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1288,7 +1282,7 @@ void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose,
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
@@ -1305,7 +1299,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
{
if (mUniform.size() <= index)
{
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL;
return;
}
diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h
index 0e2c3bcb44..a4924eba14 100644
--- a/indra/llrender/llglstates.h
+++ b/indra/llrender/llglstates.h
@@ -208,11 +208,27 @@ public:
class LLGLSPipelineSkyBox
{
protected:
- LLGLDisable mAlphaTest, mCullFace, mFog;
+ LLGLDisable mAlphaTest;
+ LLGLDisable mCullFace;
+ LLGLSquashToFarClip mSquashClip;
public:
- LLGLSPipelineSkyBox()
- : mAlphaTest(GL_ALPHA_TEST), mCullFace(GL_CULL_FACE), mFog(GL_FOG)
- { }
+ LLGLSPipelineSkyBox();
+ ~LLGLSPipelineSkyBox();
+};
+
+class LLGLSPipelineDepthTestSkyBox : public LLGLSPipelineSkyBox
+{
+public:
+ LLGLSPipelineDepthTestSkyBox(bool depth_test, bool depth_write);
+
+ LLGLDepthTest mDepth;
+};
+
+class LLGLSPipelineBlendSkyBox : public LLGLSPipelineDepthTestSkyBox
+{
+public:
+ LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_write);
+ LLGLEnable mBlend;
};
class LLGLSTracker
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 251c02dd77..5733a18f47 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1270,7 +1270,7 @@ void LLRender::syncMatrices()
glh::matrix4f& mat = mMatrix[MM_PROJECTION][mMatIdx[MM_PROJECTION]];
// it would be nice to have this automatically track the state of the proj matrix
- // but certain render paths require it to be mismatched *sigh*
+ // but certain render paths (deferred lighting) require it to be mismatched *sigh*
//if (shader->getUniformLocation(LLShaderMgr::INVERSE_PROJECTION_MATRIX))
//{
// glh::matrix4f inv_proj = mat.inverse();
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 62cd526550..a79db80ebe 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -517,4 +517,13 @@ void set_current_projection(glh::matrix4f& mat);
glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar);
glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up);
+
+#if LL_RELEASE_FOR_DOWNLOAD
+ #define LL_SHADER_LOADING_WARNS(...) LL_WARNS_ONCE("ShaderLoading")
+ #define LL_SHADER_UNIFORM_ERRS(...) LL_WARNS_ONCE("Shader")
+#else
+ #define LL_SHADER_LOADING_WARNS(...) LL_WARNS()
+ #define LL_SHADER_UNIFORM_ERRS(...) LL_ERRS("Shader")
+#endif
+
#endif
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 8617b58d2e..9da705bb2d 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -25,18 +25,14 @@
*/
#include "linden_common.h"
-
#include "llshadermgr.h"
-
-#include "llfile.h"
#include "llrender.h"
+#include "llfile.h"
#if LL_DARWIN
#include "OpenGL/OpenGL.h"
#endif
-#define UNIFORM_ERRS LL_WARNS_ONCE("Shader")
-
// Lots of STL stuff in here, using namespace std to keep things more readable
using std::vector;
using std::pair;
@@ -537,6 +533,16 @@ static std::string get_object_log(GLhandleARB ret)
return res;
}
+//dump shader source for debugging
+void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text)
+{
+ for (GLuint i = 0; i < shader_code_count; i++)
+ {
+ LL_SHADER_LOADING_WARNS() << i << ": " << shader_code_text[i] << LL_ENDL;
+ }
+ LL_SHADER_LOADING_WARNS() << LL_ENDL;
+}
+
void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string& filename)
{
std::string log = get_object_log(ret);
@@ -548,8 +554,8 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string&
if (log.length() > 0)
{
- LL_WARNS("ShaderLoading") << "Shader loading from " << fname << ":\n" << LL_ENDL;
- LL_WARNS("ShaderLoading") << log << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "Shader loading from " << fname << ":\n" << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << log << LL_ENDL;
}
}
@@ -570,11 +576,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
error = glGetError();
if (error != GL_NO_ERROR)
{
- LL_WARNS("ShaderLoading") << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL;
}
}
- LL_DEBUGS("ShaderLoading") << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL;
+ //LL_SHADER_LOADING_WARNS() << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL;
if (filename.empty())
{
@@ -588,6 +594,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
S32 try_gpu_class = shader_level;
S32 gpu_class;
+ std::string open_file_name;
//find the most relevant file
for (gpu_class = try_gpu_class; gpu_class > 0; gpu_class--)
{ //search from the current gpu class down to class 1 to find the most relevant shader
@@ -595,18 +602,33 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
fname << getShaderDirPrefix();
fname << gpu_class << "/" << filename;
- LL_DEBUGS("ShaderLoading") << "Looking in " << fname.str() << LL_ENDL;
- file = LLFile::fopen(fname.str(), "r"); /* Flawfinder: ignore */
+ open_file_name = fname.str();
+
+ /*
+ Would be awesome, if we didn't have shaders that re-use files
+ with different environments to say, add skinning, etc
+ can't depend on cached version to have evaluate ifdefs identically...
+ if we can define a deterministic hash for the shader based on
+ all the inputs, maybe we can save some time here.
+ if (mShaderObjects.count(filename) > 0)
+ {
+ return mShaderObjects[filename];
+ }
+
+ */
+
+ LL_DEBUGS("ShaderLoading") << "Looking in " << open_file_name << LL_ENDL;
+ file = LLFile::fopen(open_file_name, "r"); /* Flawfinder: ignore */
if (file)
{
- LL_DEBUGS("ShaderLoading") << "Loading file: shaders/class" << gpu_class << "/" << filename << " (Want class " << gpu_class << ")" << LL_ENDL;
+ LL_DEBUGS("ShaderLoading") << "Loading file: shaders/class" << gpu_class << "/" << open_file_name << " (Want class " << gpu_class << ")" << LL_ENDL;
break; // done
}
}
if (file == NULL)
{
- LL_WARNS("ShaderLoading") << "GLSL Shader file not found: " << filename << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "GLSL Shader file not found: " << filename << LL_ENDL;
return 0;
}
@@ -685,7 +707,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
extra_code_text[extra_code_count++] = strdup("#define texture2D texture\n");
extra_code_text[extra_code_count++] = strdup("#define textureCube texture\n");
extra_code_text[extra_code_count++] = strdup("#define texture2DLod textureLod\n");
- extra_code_text[extra_code_count++] = strdup("#define shadow2D(a,b) vec2(texture(a,b))\n");
+ extra_code_text[extra_code_count++] = strdup("#define shadow2D(a,b) vec2(texture(a,b))\n");
if (major_version > 1 || minor_version >= 40)
{ //GLSL 1.40 replaces texture2DRect et al with texture
@@ -1012,7 +1034,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
if (!suppress_errors && success == GL_FALSE)
{
//an error occured, print log
- LL_WARNS("ShaderLoading") << "GLSL Linker Error:" << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "GLSL Linker Error:" << LL_ENDL;
}
#if LL_DARWIN
@@ -1045,7 +1067,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
CGLGetParameter(ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing);
if (!fragmentGPUProcessing || !vertexGPUProcessing)
{
- LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "GLSL Linker: Running in Software:" << LL_ENDL;
success = GL_FALSE;
suppress_errors = FALSE;
}
@@ -1056,7 +1078,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
LLStringUtil::toLower(log);
if (log.find("software") != std::string::npos)
{
- LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "GLSL Linker: Running in Software:" << LL_ENDL;
success = GL_FALSE;
suppress_errors = FALSE;
}
@@ -1072,7 +1094,7 @@ BOOL LLShaderMgr::validateProgramObject(GLhandleARB obj)
glGetObjectParameterivARB(obj, GL_OBJECT_VALIDATE_STATUS_ARB, &success);
if (success == GL_FALSE)
{
- LL_WARNS("ShaderLoading") << "GLSL program not valid: " << LL_ENDL;
+ LL_SHADER_LOADING_WARNS() << "GLSL program not valid: " << LL_ENDL;
dumpObjectLog(obj);
}
else
@@ -1326,9 +1348,12 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("rainbow_map");
mReservedUniforms.push_back("halo_map");
mReservedUniforms.push_back("moon_brightness");
- mReservedUniforms.push_back("moon_phase");
mReservedUniforms.push_back("cloud_variance");
+ mReservedUniforms.push_back("sh_input_r");
+ mReservedUniforms.push_back("sh_input_g");
+ mReservedUniforms.push_back("sh_input_b");
+
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 af34c70c54..c22fe44750 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -241,10 +241,13 @@ public:
HALO_MAP,
MOON_BRIGHTNESS,
- MOON_PHASE,
CLOUD_VARIANCE,
+ SH_INPUT_L1R,
+ SH_INPUT_L1G,
+ SH_INPUT_L1B,
+
END_RESERVED_UNIFORMS
} eGLSLReservedUniforms;
@@ -255,6 +258,7 @@ public:
BOOL attachShaderFeatures(LLGLSLShader * shader);
void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE, const std::string& filename = "");
+ void dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text);
BOOL linkProgramObject(GLhandleARB obj, BOOL suppress_errors = FALSE);
BOOL validateProgramObject(GLhandleARB obj);
GLhandleARB loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, boost::unordered_map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1);