summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2018-12-29 02:44:54 -0300
committerGravatar ReinUsesLisp2019-02-06 22:20:57 -0300
commit049050856f30ba68e86197ac5cac622c3770e44b (patch)
treeefe29ddc7ab9677c25302a7e3c7a7bafba411242
parentMerge pull request #2042 from ReinUsesLisp/nouveau-tex (diff)
downloadyuzu-049050856f30ba68e86197ac5cac622c3770e44b.tar.gz
yuzu-049050856f30ba68e86197ac5cac622c3770e44b.tar.xz
yuzu-049050856f30ba68e86197ac5cac622c3770e44b.zip
shader_decode: Implement LDG and basic cbuf tracking
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.h33
1 files changed, 33 insertions, 0 deletions
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:
92 std::string name; 92 std::string name;
93}; 93};
94 94
95class GlobalMemoryEntry {
96public:
97 explicit GlobalMemoryEntry(u32 cbuf_index, u32 cbuf_offset, Maxwell::ShaderStage stage,
98 std::string name)
99 : cbuf_index{cbuf_index}, cbuf_offset{cbuf_offset}, stage{stage}, name{std::move(name)} {}
100
101 u32 GetCbufIndex() const {
102 return cbuf_index;
103 }
104
105 u32 GetCbufOffset() const {
106 return cbuf_offset;
107 }
108
109 const std::string& GetName() const {
110 return name;
111 }
112
113 Maxwell::ShaderStage GetStage() const {
114 return stage;
115 }
116
117 u32 GetHash() const {
118 return (static_cast<u32>(stage) << 24) | (cbuf_index << 16) | cbuf_offset;
119 }
120
121private:
122 u32 cbuf_index{};
123 u32 cbuf_offset{};
124 Maxwell::ShaderStage stage{};
125 std::string name;
126};
127
95struct ShaderEntries { 128struct ShaderEntries {
96 std::vector<ConstBufferEntry> const_buffers; 129 std::vector<ConstBufferEntry> const_buffers;
97 std::vector<SamplerEntry> samplers; 130 std::vector<SamplerEntry> samplers;