Ignore invalid shader cache index (Bug #1664)

deque
scrawl 11 years ago
parent 8c81e22f3e
commit d7acb7fc7d

@ -51,24 +51,32 @@ namespace sh
{
assert(mCurrentLanguage != Language_None);
if (boost::filesystem::exists (mPlatform->getCacheFolder () + "/lastModified.txt"))
try
{
std::ifstream file;
file.open(std::string(mPlatform->getCacheFolder () + "/lastModified.txt").c_str());
std::string line;
while (getline(file, line))
if (boost::filesystem::exists (mPlatform->getCacheFolder () + "/lastModified.txt"))
{
std::string sourceFile = line;
std::ifstream file;
file.open(std::string(mPlatform->getCacheFolder () + "/lastModified.txt").c_str());
std::string line;
while (getline(file, line))
{
std::string sourceFile = line;
if (!getline(file, line))
assert(0);
if (!getline(file, line))
assert(0);
int modified = boost::lexical_cast<int>(line);
int modified = boost::lexical_cast<int>(line);
mShadersLastModified[sourceFile] = modified;
mShadersLastModified[sourceFile] = modified;
}
}
}
catch (std::exception& e)
{
std::cerr << "Failed to load shader modification index: " << e.what() << std::endl;
mShadersLastModified.clear();
}
// load configurations
{

Loading…
Cancel
Save