From cfb20c4c9d863698b938aaad3d27cfe8e4eedb2b Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 15 Jan 2019 01:07:57 -0300 Subject: gl_shader_disk_cache: Save GLSL and entries into the precompiled file --- .../renderer_opengl/gl_shader_decompiler.h | 65 ++-------------------- 1 file changed, 5 insertions(+), 60 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.h') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.h b/src/video_core/renderer_opengl/gl_shader_decompiler.h index 398be13d6..0031cb614 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.h +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.h @@ -23,65 +23,23 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs; class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer { public: - explicit ConstBufferEntry(const VideoCommon::Shader::ConstBuffer& entry, - Maxwell::ShaderStage stage, u32 index) - : VideoCommon::Shader::ConstBuffer{entry}, stage{stage}, index{index} {} - - Maxwell::ShaderStage GetStage() const { - return stage; - } + explicit ConstBufferEntry(u32 max_offset, bool is_indirect, u32 index) + : VideoCommon::Shader::ConstBuffer{max_offset, is_indirect}, index{index} {} u32 GetIndex() const { return index; } private: - Maxwell::ShaderStage stage{}; u32 index{}; }; -class SamplerEntry : public VideoCommon::Shader::Sampler { -public: - explicit SamplerEntry(const VideoCommon::Shader::Sampler& entry, Maxwell::ShaderStage stage) - : VideoCommon::Shader::Sampler{entry}, stage{stage} {} - - Maxwell::ShaderStage GetStage() const { - return stage; - } - -private: - Maxwell::ShaderStage stage{}; -}; - -class GlobalMemoryEntry { -public: - explicit GlobalMemoryEntry(u32 cbuf_index, u32 cbuf_offset, Maxwell::ShaderStage stage) - : cbuf_index{cbuf_index}, cbuf_offset{cbuf_offset}, stage{stage} {} - - u32 GetCbufIndex() const { - return cbuf_index; - } - - u32 GetCbufOffset() const { - return cbuf_offset; - } - - Maxwell::ShaderStage GetStage() const { - return stage; - } - -private: - u32 cbuf_index{}; - u32 cbuf_offset{}; - Maxwell::ShaderStage stage{}; - std::string name; -}; +using SamplerEntry = VideoCommon::Shader::Sampler; class GlobalMemoryEntry { public: - explicit GlobalMemoryEntry(u32 cbuf_index, u32 cbuf_offset, Maxwell::ShaderStage stage, - std::string name) - : cbuf_index{cbuf_index}, cbuf_offset{cbuf_offset}, stage{stage}, name{std::move(name)} {} + explicit GlobalMemoryEntry(u32 cbuf_index, u32 cbuf_offset) + : cbuf_index{cbuf_index}, cbuf_offset{cbuf_offset} {} u32 GetCbufIndex() const { return cbuf_index; @@ -91,22 +49,9 @@ public: return cbuf_offset; } - const std::string& GetName() const { - return name; - } - - Maxwell::ShaderStage GetStage() const { - return stage; - } - - u32 GetHash() const { - return (static_cast(stage) << 24) | (cbuf_index << 16) | cbuf_offset; - } - private: u32 cbuf_index{}; u32 cbuf_offset{}; - Maxwell::ShaderStage stage{}; }; struct ShaderEntries { -- cgit v1.2.3