Fix shader error dumping. (the error file was not being written to.) Also catch exceptions if shader log dir is inaccessable or otherwise unable to be cleared.

This commit is contained in:
Shyotl
2011-11-23 21:29:42 -06:00
parent e46c906a8b
commit 5d8d402403
2 changed files with 10 additions and 3 deletions

View File

@@ -768,8 +768,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
file.write(ostr.str().c_str(),ostr.str().length());
if(!error_str.empty())
{
LLAPRFile file2(maindir + shader_name + "_ERROR" + ".txt", LL_APR_W);
file.write(error_str.c_str(),error_str.length());
LLAPRFile file2(maindir + shader_name + "_ERROR.txt", LL_APR_W);
file2.write(error_str.c_str(),error_str.length());
}
}
stop_glerror();

View File

@@ -354,7 +354,14 @@ void LLViewerShaderMgr::setShaders()
{
const std::string dumpdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump")+gDirUtilp->getDirDelimiter();
boost::filesystem::remove_all(dumpdir);
try
{
boost::filesystem::remove_all(dumpdir);
}
catch(const boost::filesystem::filesystem_error& e)
{
llinfos << "boost::filesystem::remove_all(\""+dumpdir+"\") failed: '" + e.code().message() + "'" << llendl;
}
}
LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);