summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_debugger.h
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-05-18 19:59:36 +0200
committerGravatar bunnei2014-06-12 06:10:52 -0400
commitb0051b2203d8319e57603ee6cbfaa5cd798de060 (patch)
tree8d331f1958fbf0dda7215e597faff818a7bda247 /src/video_core/gpu_debugger.h
parentcitra-qt: Add command list view. (diff)
downloadyuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.gz
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.xz
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.zip
Refine command list debugging functionality and its qt interface.
Diffstat (limited to 'src/video_core/gpu_debugger.h')
-rw-r--r--src/video_core/gpu_debugger.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h
index 7ad595493..5ece0a8b7 100644
--- a/src/video_core/gpu_debugger.h
+++ b/src/video_core/gpu_debugger.h
@@ -22,7 +22,8 @@ public:
22 { 22 {
23 Pica::CommandHeader& GetHeader() 23 Pica::CommandHeader& GetHeader()
24 { 24 {
25 return *(Pica::CommandHeader*)&(front()); 25 u32& val = at(1);
26 return *(Pica::CommandHeader*)&val;
26 } 27 }
27 }; 28 };
28 29
@@ -90,14 +91,20 @@ public:
90 91
91 void CommandListCalled(u32 address, u32* command_list, u32 size_in_words) 92 void CommandListCalled(u32 address, u32* command_list, u32 size_in_words)
92 { 93 {
93 // TODO: Decoding fun
94
95 // For now, just treating the whole command list as a single command
96 PicaCommandList cmdlist; 94 PicaCommandList cmdlist;
97 cmdlist.push_back(PicaCommand()); 95 for (u32* parse_pointer = command_list; parse_pointer < command_list + size_in_words;)
98 auto& cmd = cmdlist[0]; 96 {
99 cmd.reserve(size_in_words); 97 const Pica::CommandHeader header = static_cast<Pica::CommandHeader>(parse_pointer[1]);
100 std::copy(command_list, command_list+size_in_words, std::back_inserter(cmd)); 98
99 cmdlist.push_back(PicaCommand());
100 auto& cmd = cmdlist.back();
101
102 size_t size = 2 + header.extra_data_length;
103 cmd.reserve(size);
104 std::copy(parse_pointer, parse_pointer + size, std::back_inserter(cmd));
105
106 parse_pointer += size;
107 }
101 108
102 auto obj = std::pair<u32,PicaCommandList>(address, cmdlist); 109 auto obj = std::pair<u32,PicaCommandList>(address, cmdlist);
103 auto it = std::find(command_lists.begin(), command_lists.end(), obj); 110 auto it = std::find(command_lists.begin(), command_lists.end(), obj);