diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-05-31 02:56:37 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-08 01:20:22 +0200 |
commit | 4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471 (patch) | |
tree | 6df9360ded520f21dd79854ef55eb54c4a105a0c /src/video_core/renderer_opengl/gl_shader_cache.h | |
parent | Merge pull request #2514 from ReinUsesLisp/opengl-compat (diff) | |
download | yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.tar yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.tar.gz yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.tar.bz2 yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.tar.lz yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.tar.xz yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.tar.zst yuzu-4ec8a3df0888f2465cf0d3c9f8fe1bb2893d7471.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 09bd0761d..964f680bc 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -41,17 +41,27 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs; using PrecompiledPrograms = std::unordered_map<ShaderDiskCacheUsage, CachedProgram>; using PrecompiledShaders = std::unordered_map<u64, GLShader::ProgramResult>; +struct ShaderParameters { + ShaderDiskCacheOpenGL& disk_cache; + const PrecompiledPrograms& precompiled_programs; + const Device& device; + VAddr cpu_addr; + u8* host_ptr; + u64 unique_identifier; +}; + class CachedShader final : public RasterizerCacheObject { public: - explicit CachedShader(const Device& device, VAddr cpu_addr, u64 unique_identifier, - Maxwell::ShaderProgram program_type, ShaderDiskCacheOpenGL& disk_cache, - const PrecompiledPrograms& precompiled_programs, - ProgramCode&& program_code, ProgramCode&& program_code_b, u8* host_ptr); + explicit CachedShader(const ShaderParameters& params, Maxwell::ShaderProgram program_type, + GLShader::ProgramResult result); - explicit CachedShader(VAddr cpu_addr, u64 unique_identifier, - Maxwell::ShaderProgram program_type, ShaderDiskCacheOpenGL& disk_cache, - const PrecompiledPrograms& precompiled_programs, - GLShader::ProgramResult result, u8* host_ptr); + static Shader CreateStageFromMemory(const ShaderParameters& params, + Maxwell::ShaderProgram program_type, + ProgramCode&& program_code, ProgramCode&& program_code_b); + + static Shader CreateStageFromCache(const ShaderParameters& params, + Maxwell::ShaderProgram program_type, + GLShader::ProgramResult result); VAddr GetCpuAddr() const override { return cpu_addr; @@ -99,10 +109,9 @@ private: ShaderDiskCacheOpenGL& disk_cache; const PrecompiledPrograms& precompiled_programs; - std::size_t shader_length{}; GLShader::ShaderEntries entries; - std::string code; + std::size_t shader_length{}; std::unordered_map<BaseBindings, CachedProgram> programs; std::unordered_map<BaseBindings, GeometryPrograms> geometry_programs; |