diff options
author | Lioncash <mathew1800@gmail.com> | 2019-05-19 08:27:00 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-05-19 08:46:38 +0200 |
commit | f417be9d3be297f5f4ccdf5d31b80394cfdb6c69 (patch) | |
tree | 5c92eeb08f7c1643b9b3474cd88761c06b4cfe01 /src/video_core/renderer_opengl/gl_shader_disk_cache.h | |
parent | Merge pull request #2457 from lioncash/about (diff) | |
download | yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.tar yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.tar.gz yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.tar.bz2 yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.tar.lz yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.tar.xz yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.tar.zst yuzu-f417be9d3be297f5f4ccdf5d31b80394cfdb6c69.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.h | 18 |
1 files changed, 17 insertions, 1 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 0142b2e3b..34d4bd637 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h @@ -259,12 +259,28 @@ private: return SaveArrayToPrecompiled(&object, 1); } + bool SaveObjectToPrecompiled(bool object) { + const auto value = static_cast<u8>(object); + return SaveArrayToPrecompiled(&value, 1); + } + template <typename T> bool LoadObjectFromPrecompiled(T& object) { return LoadArrayFromPrecompiled(&object, 1); } - // Copre system + bool LoadObjectFromPrecompiled(bool& object) { + u8 value; + const bool read_ok = LoadArrayFromPrecompiled(&value, 1); + if (!read_ok) { + return false; + } + + object = value != 0; + return true; + } + + // Core system Core::System& system; // Stored transferable shaders std::map<u64, std::unordered_set<ShaderDiskCacheUsage>> transferable; |