From 049050856f30ba68e86197ac5cac622c3770e44b Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sat, 29 Dec 2018 02:44:54 -0300 Subject: shader_decode: Implement LDG and basic cbuf tracking --- .../renderer_opengl/gl_shader_decompiler.h | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.h b/src/video_core/renderer_opengl/gl_shader_decompiler.h index 0856a1361..a5bdbaf7a 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.h +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.h @@ -92,6 +92,39 @@ private: std::string name; }; +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)} {} + + u32 GetCbufIndex() const { + return cbuf_index; + } + + u32 GetCbufOffset() const { + 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{}; + std::string name; +}; + struct ShaderEntries { std::vector const_buffers; std::vector samplers; -- cgit v1.2.3