diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-02-11 16:04:31 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-02-11 16:04:31 -0500 |
commit | 969cb45920c568aeebf145480b7beacb2a157bcf (patch) | |
tree | 63dfb29d5e0226b054094d88358bec6ede68c197 /indra/llrender | |
parent | d8f627d8bd45cc356583e2251500c23bed836b16 (diff) | |
parent | 413be91cf5044889ade97dcbec4b17fceff122e3 (diff) |
merge
Diffstat (limited to 'indra/llrender')
-rwxr-xr-x | indra/llrender/llglslshader.cpp | 9 | ||||
-rwxr-xr-x | indra/llrender/llshadermgr.cpp | 30 | ||||
-rwxr-xr-x | indra/llrender/llshadermgr.h | 3 |
3 files changed, 31 insertions, 11 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 35620bb656..1c50a51d02 100755 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -717,7 +717,14 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms) BOOL LLGLSLShader::link(BOOL suppress_errors) { - return LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors); + BOOL success = LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors); + + if (!suppress_errors) + { + LLShaderMgr::instance()->dumpObjectLog(mProgramObject, !success, mName); + } + + return success; } void LLGLSLShader::bind() diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index d230574752..6e04fc82df 100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -505,9 +505,25 @@ static std::string get_object_log(GLhandleARB ret) return res; } -void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) +void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string& filename) { std::string log = get_object_log(ret); + + if (log.length() > 0 || warns) + { + if (!filename.empty()) + { + if (warns) + { + LL_WARNS("ShaderLoading") << "From " << filename << ":" << LL_ENDL; + } + else + { + LL_INFOS("ShaderLoading") << "From " << filename << ":" << LL_ENDL; + } + } + } + if ( log.length() > 0 ) { if (warns) @@ -558,7 +574,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade file = LLFile::fopen(fname.str(), "r"); /* Flawfinder: ignore */ if (file) { - LL_INFOS("ShaderLoading") << "Loading file: shaders/class" << gpu_class << "/" << filename << " (Want class " << gpu_class << ")" << LL_ENDL; + LL_DEBUGS("ShaderLoading") << "Loading file: shaders/class" << gpu_class << "/" << filename << " (Want class " << gpu_class << ")" << LL_ENDL; break; // done } } @@ -812,8 +828,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (error != GL_NO_ERROR || success == GL_FALSE) { //an error occured, print log - LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL; - dumpObjectLog(ret); + LL_WARNS("ShaderLoading") << "GLSL Compilation Error:" << LL_ENDL; + dumpObjectLog(ret, TRUE, filename); #if LL_WINDOWS std::stringstream ostr; //dump shader source for debugging @@ -938,11 +954,6 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors) suppress_errors = FALSE; } #endif - if (!suppress_errors) - { - dumpObjectLog(obj, !success); - } - return success; } @@ -1146,6 +1157,7 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("env_intensity"); mReservedUniforms.push_back("matrixPalette"); + mReservedUniforms.push_back("translationPalette"); mReservedUniforms.push_back("screenTex"); mReservedUniforms.push_back("screenDepth"); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 51c27fc8b6..394b38f832 100755 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -176,6 +176,7 @@ public: ENVIRONMENT_INTENSITY, AVATAR_MATRIX, + AVATAR_TRANSLATION, WATER_SCREENTEX, WATER_SCREENDEPTH, @@ -224,7 +225,7 @@ DISPLAY_GAMMA, virtual void initAttribsAndUniforms(void); BOOL attachShaderFeatures(LLGLSLShader * shader); - void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE); + void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE, const std::string& filename = ""); 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); |