Only add shaders to precompiled cache if they are new
This commit is contained in:
parent
061a33477f
commit
7092ba8480
1 changed files with 10 additions and 7 deletions
|
@ -573,20 +573,23 @@ void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading,
|
||||||
result = r;
|
result = r;
|
||||||
} else {
|
} else {
|
||||||
// Unsupported shader type got stored somehow so nuke the cache
|
// Unsupported shader type got stored somehow so nuke the cache
|
||||||
LOG_CRITICAL(Frontend, "failed to load raw programtype {}",
|
LOG_ERROR(Frontend, "failed to load raw programtype {}",
|
||||||
static_cast<u32>(raw.GetProgramType()));
|
static_cast<u32>(raw.GetProgramType()));
|
||||||
compilation_failed = true;
|
compilation_failed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (handle == 0) {
|
if (handle == 0) {
|
||||||
LOG_CRITICAL(Frontend, "compilation from raw failed {:x} {:x}",
|
LOG_ERROR(Frontend, "compilation from raw failed {:x} {:x}",
|
||||||
raw.GetProgramCode().at(0), raw.GetProgramCode().at(1));
|
raw.GetProgramCode().at(0), raw.GetProgramCode().at(1));
|
||||||
compilation_failed = true;
|
compilation_failed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// If this is a new shader, add it the precompiled cache
|
||||||
|
if (result) {
|
||||||
disk_cache.SaveDecompiled(unique_identifier, *result);
|
disk_cache.SaveDecompiled(unique_identifier, *result);
|
||||||
disk_cache.SaveDump(unique_identifier, handle);
|
disk_cache.SaveDump(unique_identifier, handle);
|
||||||
precompiled_cache_altered = true;
|
precompiled_cache_altered = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(VideoCore::LoadCallbackStage::Build, i, raws.size());
|
callback(VideoCore::LoadCallbackStage::Build, i, raws.size());
|
||||||
|
|
Loading…
Reference in a new issue