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:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user