diff options
author | bunnei <bunneidev@gmail.com> | 2019-11-25 01:36:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-25 01:36:30 +0100 |
commit | b03242067d9ba9e3ad9804d2ccfe596f45da6ba6 (patch) | |
tree | 386c8566d385869702b34ddb00ff58f7e8e275bf /src/video_core/renderer_opengl/gl_shader_cache.h | |
parent | Merge pull request #3105 from ReinUsesLisp/fix-stencil-reg (diff) | |
parent | gl_device: Reserve base bindings on limited devices (diff) | |
download | yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.tar yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.tar.gz yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.tar.bz2 yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.tar.lz yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.tar.xz yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.tar.zst yuzu-b03242067d9ba9e3ad9804d2ccfe596f45da6ba6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 6bd7c9cf1..7b1470db3 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -17,6 +17,7 @@ #include <glad/glad.h> #include "common/common_types.h" +#include "video_core/engines/shader_type.h" #include "video_core/rasterizer_cache.h" #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_shader_decompiler.h" @@ -47,7 +48,7 @@ using PrecompiledVariants = std::vector<PrecompiledPrograms::iterator>; struct UnspecializedShader { GLShader::ShaderEntries entries; - ProgramType program_type; + Tegra::Engines::ShaderType type; ProgramCode code; ProgramCode code_b; }; @@ -77,7 +78,7 @@ public: } std::size_t GetSizeInBytes() const override { - return program_code.size() * sizeof(u64); + return code.size() * sizeof(u64); } /// Gets the shader entries for the shader @@ -86,7 +87,7 @@ public: } /// Gets the GL program handle for the shader - std::tuple<GLuint, BaseBindings> GetProgramHandle(const ProgramVariant& variant); + GLuint GetHandle(const ProgramVariant& variant); private: struct LockerVariant { @@ -94,11 +95,11 @@ private: std::unordered_map<ProgramVariant, CachedProgram> programs; }; - explicit CachedShader(const ShaderParameters& params, ProgramType program_type, + explicit CachedShader(const ShaderParameters& params, Tegra::Engines::ShaderType shader_type, GLShader::ShaderEntries entries, ProgramCode program_code, ProgramCode program_code_b); - void UpdateVariant(); + bool EnsureValidLockerVariant(); ShaderDiskCacheUsage GetUsage(const ProgramVariant& variant, const VideoCommon::Shader::ConstBufferLocker& locker) const; @@ -110,14 +111,14 @@ private: VAddr cpu_addr{}; u64 unique_identifier{}; - ProgramType program_type{}; + Tegra::Engines::ShaderType shader_type{}; GLShader::ShaderEntries entries; - ProgramCode program_code; - ProgramCode program_code_b; + ProgramCode code; + ProgramCode code_b; - LockerVariant* curr_variant = nullptr; + LockerVariant* curr_locker_variant = nullptr; std::vector<std::unique_ptr<LockerVariant>> locker_variants; }; |