diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-27 07:37:15 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:33 +0200 |
commit | 1bf4154e7d0589dab6922321bf39cf80f22c07d0 (patch) | |
tree | fd7a2fa46e99d3126f66bdd1a8b6aa232a65d800 /src/video_core/renderer_opengl/gl_shader_disk_cache.h | |
parent | shader: Implement bindless images (diff) | |
download | yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.tar yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.tar.gz yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.tar.bz2 yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.tar.lz yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.tar.xz yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.tar.zst yuzu-1bf4154e7d0589dab6922321bf39cf80f22c07d0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.h | 24 |
1 files changed, 9 insertions, 15 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 7c9f0cc75..aa12ffc71 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h @@ -45,9 +45,11 @@ struct BaseBindings { u32 cbuf{}; u32 gmem{}; u32 sampler{}; + u32 image{}; bool operator==(const BaseBindings& rhs) const { - return std::tie(cbuf, gmem, sampler) == std::tie(rhs.cbuf, rhs.gmem, rhs.sampler); + return std::tie(cbuf, gmem, sampler, image) == + std::tie(rhs.cbuf, rhs.gmem, rhs.sampler, rhs.image); } bool operator!=(const BaseBindings& rhs) const { @@ -91,8 +93,11 @@ namespace std { template <> struct hash<OpenGL::BaseBindings> { - std::size_t operator()(const OpenGL::BaseBindings& bindings) const noexcept { - return bindings.cbuf | bindings.gmem << 8 | bindings.sampler << 16; + std::size_t operator()(const OpenGL::BaseBindings& bindings) const { + return static_cast<std::size_t>(bindings.cbuf) ^ + (static_cast<std::size_t>(bindings.gmem) << 8) ^ + (static_cast<std::size_t>(bindings.sampler) << 16) ^ + (static_cast<std::size_t>(bindings.image) << 24); } }; @@ -300,19 +305,8 @@ private: return LoadArrayFromPrecompiled(&object, 1); } - 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; + // Stores whole precompiled cache which will be read from or saved to the precompiled chache // file FileSys::VectorVfsFile precompiled_cache_virtual_file; |