From 1bf4154e7d0589dab6922321bf39cf80f22c07d0 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sat, 27 Apr 2019 02:37:15 -0300 Subject: gl_shader_decompiler: Implement image binding settings --- .../renderer_opengl/gl_shader_disk_cache.h | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_shader_disk_cache.h') 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 { - 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(bindings.cbuf) ^ + (static_cast(bindings.gmem) << 8) ^ + (static_cast(bindings.sampler) << 16) ^ + (static_cast(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; -- cgit v1.2.3