aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/gpu_debugger.h
diff options
context:
space:
mode:
authorGravatar Tony Wasserka <NeoBrainX@gmail.com>2014-05-18 19:59:36 +0200
committerGravatar bunnei <ericbunnie@gmail.com>2014-06-12 06:10:52 -0400
commitb0051b2203d8319e57603ee6cbfaa5cd798de060 (patch)
tree8d331f1958fbf0dda7215e597faff818a7bda247 /src/video_core/gpu_debugger.h
parent6893732348c3689b094c2e9749f8eb9e877028b8 (diff)
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 7ad59549..5ece0a8b 100644
--- a/src/video_core/gpu_debugger.h
+++ b/src/video_core/gpu_debugger.h
@@ -22,7 +22,8 @@ public:
{
Pica::CommandHeader& GetHeader()
{
- return *(Pica::CommandHeader*)&(front());
+ u32& val = at(1);
+ return *(Pica::CommandHeader*)&val;
}
};
@@ -90,14 +91,20 @@ public:
void CommandListCalled(u32 address, u32* command_list, u32 size_in_words)
{
- // TODO: Decoding fun
-
- // For now, just treating the whole command list as a single command
PicaCommandList cmdlist;
- cmdlist.push_back(PicaCommand());
- auto& cmd = cmdlist[0];
- cmd.reserve(size_in_words);
- std::copy(command_list, command_list+size_in_words, std::back_inserter(cmd));
+ for (u32* parse_pointer = command_list; parse_pointer < command_list + size_in_words;)
+ {
+ const Pica::CommandHeader header = static_cast<Pica::CommandHeader>(parse_pointer[1]);
+
+ cmdlist.push_back(PicaCommand());
+ auto& cmd = cmdlist.back();
+
+ size_t size = 2 + header.extra_data_length;
+ cmd.reserve(size);
+ std::copy(parse_pointer, parse_pointer + size, std::back_inserter(cmd));
+
+ parse_pointer += size;
+ }
auto obj = std::pair<u32,PicaCommandList>(address, cmdlist);
auto it = std::find(command_lists.begin(), command_lists.end(), obj);