summaryrefslogtreecommitdiffstats
path: root/src/video_core/gpu_debugger.h
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-05-18 19:59:36 +0200
committerbunnei <ericbunnie@gmail.com>2014-06-12 12:10:52 +0200
commitb0051b2203d8319e57603ee6cbfaa5cd798de060 (patch)
tree8d331f1958fbf0dda7215e597faff818a7bda247 /src/video_core/gpu_debugger.h
parentcitra-qt: Add command list view. (diff)
downloadyuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.gz
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.bz2
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.lz
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.xz
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.tar.zst
yuzu-b0051b2203d8319e57603ee6cbfaa5cd798de060.zip
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:
{
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);