diff options
| author | 2019-05-01 00:36:11 -0300 | |
|---|---|---|
| committer | 2019-05-01 00:36:11 -0300 | |
| commit | 4aa081b4e774436d7a4ba70a42a14ff5b1869662 (patch) | |
| tree | 5dcaada5d1f568f85fd2f006eafbecd148916c34 /src | |
| parent | Merge pull request #2406 from FearlessTobi/port-3839 (diff) | |
| download | yuzu-4aa081b4e774436d7a4ba70a42a14ff5b1869662.tar.gz yuzu-4aa081b4e774436d7a4ba70a42a14ff5b1869662.tar.xz yuzu-4aa081b4e774436d7a4ba70a42a14ff5b1869662.zip | |
gl_shader_disk_cache: Skip stored shader variants instead of asserting
Instead of asserting on already stored shader variants, silently skip them.
This shouldn't be happening but when a shader is invalidated and it is
not stored in the shader cache, this assert would hit and save that
shader anyways when the asserts are disabled.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index ed7afc4a0..254c0d499 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | |||
| @@ -475,7 +475,10 @@ void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) { | |||
| 475 | ASSERT_MSG(it != transferable.end(), "Saving shader usage without storing raw previously"); | 475 | ASSERT_MSG(it != transferable.end(), "Saving shader usage without storing raw previously"); |
| 476 | 476 | ||
| 477 | auto& usages{it->second}; | 477 | auto& usages{it->second}; |
| 478 | ASSERT(usages.find(usage) == usages.end()); | 478 | if (usages.find(usage) != usages.end()) { |
| 479 | // Skip this variant since the shader is already stored. | ||
| 480 | return; | ||
| 481 | } | ||
| 479 | usages.insert(usage); | 482 | usages.insert(usage); |
| 480 | 483 | ||
| 481 | FileUtil::IOFile file = AppendTransferableFile(); | 484 | FileUtil::IOFile file = AppendTransferableFile(); |