diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-14 02:36:52 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-07 02:20:57 +0100 |
commit | 145c3ac89e14c5400e617d4af08c3b8c251cf7c8 (patch) | |
tree | 581e011f906a7ff4db4df9d6aaf20280a3ac1112 | |
parent | gl_shader_decompiler: Remove name entries (diff) | |
download | yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.tar yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.tar.gz yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.tar.bz2 yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.tar.lz yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.tar.xz yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.tar.zst yuzu-145c3ac89e14c5400e617d4af08c3b8c251cf7c8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.h | 11 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 14 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.h | 41 |
4 files changed, 58 insertions, 10 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 6113e17ff..48be37082 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -44,6 +44,8 @@ add_library(video_core STATIC renderer_opengl/gl_shader_cache.h renderer_opengl/gl_shader_decompiler.cpp renderer_opengl/gl_shader_decompiler.h + renderer_opengl/gl_shader_disk_cache.cpp + renderer_opengl/gl_shader_disk_cache.h renderer_opengl/gl_shader_gen.cpp renderer_opengl/gl_shader_gen.h renderer_opengl/gl_shader_manager.cpp diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 5e72912f5..18fb80bcc 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -16,6 +16,7 @@ #include "video_core/rasterizer_cache.h" #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_shader_decompiler.h" +#include "video_core/renderer_opengl/gl_shader_disk_cache.h" #include "video_core/renderer_opengl/gl_shader_gen.h" namespace OpenGL { @@ -26,16 +27,6 @@ class RasterizerOpenGL; using Shader = std::shared_ptr<CachedShader>; using Maxwell = Tegra::Engines::Maxwell3D::Regs; -struct BaseBindings { - u32 cbuf{}; - u32 gmem{}; - u32 sampler{}; - - bool operator<(const BaseBindings& rhs) const { - return std::tie(cbuf, gmem, sampler) < std::tie(rhs.cbuf, rhs.gmem, rhs.sampler); - } -}; - class CachedShader final : public RasterizerCacheObject { public: CachedShader(VAddr addr, Maxwell::ShaderProgram program_type); diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp new file mode 100644 index 000000000..b7876c3a7 --- /dev/null +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -0,0 +1,14 @@ +// Copyright 2019 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "video_core/renderer_opengl/gl_shader_disk_cache.h" + +namespace OpenGL { + +// Making sure sizes doesn't change by accident +static_assert(sizeof(BaseBindings) == 12); + +} // namespace OpenGL
\ No newline at end of file diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.h b/src/video_core/renderer_opengl/gl_shader_disk_cache.h new file mode 100644 index 000000000..cb40e9926 --- /dev/null +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.h @@ -0,0 +1,41 @@ +// Copyright 2019 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <tuple> + +#include "common/common_types.h" +#include "video_core/engines/maxwell_3d.h" + +namespace OpenGL { + +using ProgramCode = std::vector<u64>; +using Maxwell = Tegra::Engines::Maxwell3D::Regs; + +struct BaseBindings { +private: + auto Tie() const { + return std::tie(cbuf, gmem, sampler); + } + +public: + u32 cbuf{}; + u32 gmem{}; + u32 sampler{}; + + bool operator<(const BaseBindings& rhs) const { + return Tie() < rhs.Tie(); + } + + bool operator==(const BaseBindings& rhs) const { + return Tie() == rhs.Tie(); + } + + bool operator!=(const BaseBindings& rhs) const { + return !this->operator==(rhs); + } +}; + +} // namespace OpenGL
\ No newline at end of file |