diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-15 06:17:38 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-07 02:23:40 +0100 |
commit | 8ee3666a3c19c3522fc980c5bed8a519e99e0d95 (patch) | |
tree | 226bf4dc7f51d76bfa4198bdcc9af1d9e95e3440 /src/video_core/renderer_opengl/gl_shader_disk_cache.h | |
parent | gl_shader_disk_cache: Compress program binaries using LZ4 (diff) | |
download | yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.tar yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.tar.gz yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.tar.bz2 yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.tar.lz yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.tar.xz yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.tar.zst yuzu-8ee3666a3c19c3522fc980c5bed8a519e99e0d95.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_disk_cache.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.h b/src/video_core/renderer_opengl/gl_shader_disk_cache.h index f11693789..c44a776d9 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h @@ -4,9 +4,11 @@ #pragma once +#include <optional> #include <set> #include <string> #include <tuple> +#include <utility> #include <vector> #include <glad/glad.h> @@ -142,13 +144,14 @@ struct ShaderDiskCacheDump { class ShaderDiskCacheOpenGL { public: - /// Loads transferable cache. If file has a old version, it deletes it. Returns true on success. - bool LoadTransferable(std::vector<ShaderDiskCacheRaw>& raws, - std::vector<ShaderDiskCacheUsage>& usages); - - /// Loads current game's precompiled cache. Invalidates if emulator's version has changed. - bool LoadPrecompiled(std::map<u64, ShaderDiskCacheDecompiled>& decompiled, - std::map<ShaderDiskCacheUsage, ShaderDiskCacheDump>& dumps); + /// Loads transferable cache. If file has a old version or on failure, it deletes the file. + std::optional<std::pair<std::vector<ShaderDiskCacheRaw>, std::vector<ShaderDiskCacheUsage>>> + LoadTransferable(); + + /// Loads current game's precompiled cache. Invalidates on failure. + std::pair<std::map<u64, ShaderDiskCacheDecompiled>, + std::map<ShaderDiskCacheUsage, ShaderDiskCacheDump>> + LoadPrecompiled(); /// Removes the transferable (and precompiled) cache file. void InvalidateTransferable() const; |