Merge pull request #2443 from ReinUsesLisp/skip-repeated-variants

gl_shader_disk_cache: Skip stored shader variants instead of asserting
This commit is contained in:
bunnei 2019-05-09 13:22:42 -04:00 committed by GitHub
commit f69d3a6351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -475,7 +475,10 @@ void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) {
ASSERT_MSG(it != transferable.end(), "Saving shader usage without storing raw previously");
auto& usages{it->second};
ASSERT(usages.find(usage) == usages.end());
if (usages.find(usage) != usages.end()) {
// Skip this variant since the shader is already stored.
return;
}
usages.insert(usage);
FileUtil::IOFile file = AppendTransferableFile();