diff options
| author | 2014-05-18 21:18:38 +0200 | |
|---|---|---|
| committer | 2014-06-12 06:10:53 -0400 | |
| commit | f82410e6335b02603c7a6fc0fc63894b6a820a5b (patch) | |
| tree | e703a09ea87cd532ed24bea5067e5c26bcf2ac1a /src | |
| parent | Refine command list debugging functionality and its qt interface. (diff) | |
| download | yuzu-f82410e6335b02603c7a6fc0fc63894b6a820a5b.tar.gz yuzu-f82410e6335b02603c7a6fc0fc63894b6a820a5b.tar.xz yuzu-f82410e6335b02603c7a6fc0fc63894b6a820a5b.zip | |
Further refine GPU command list debugging.
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/gpu_debugger.h | 1 | ||||
| -rw-r--r-- | src/video_core/pica.h | 16 |
3 files changed, 27 insertions, 4 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index d07645e78..195197ef5 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp | |||
| @@ -53,7 +53,7 @@ int GPUCommandListModel::rowCount(const QModelIndex& parent) const | |||
| 53 | 53 | ||
| 54 | int GPUCommandListModel::columnCount(const QModelIndex& parent) const | 54 | int GPUCommandListModel::columnCount(const QModelIndex& parent) const |
| 55 | { | 55 | { |
| 56 | return 1; | 56 | return 2; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const | 59 | QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const |
| @@ -68,7 +68,7 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const | |||
| 68 | const GraphicsDebugger::PicaCommandList& cmdlist = command_lists[item->index].second; | 68 | const GraphicsDebugger::PicaCommandList& cmdlist = command_lists[item->index].second; |
| 69 | u32 address = command_lists[item->index].first; | 69 | u32 address = command_lists[item->index].first; |
| 70 | 70 | ||
| 71 | if (role == Qt::DisplayRole) | 71 | if (role == Qt::DisplayRole && index.column() == 0) |
| 72 | { | 72 | { |
| 73 | return QVariant(QString("0x%1 bytes at 0x%2").arg(cmdlist.size(), 0, 16).arg(address, 8, 16, QLatin1Char('0'))); | 73 | return QVariant(QString("0x%1 bytes at 0x%2").arg(cmdlist.size(), 0, 16).arg(address, 8, 16, QLatin1Char('0'))); |
| 74 | } | 74 | } |
| @@ -78,11 +78,17 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const | |||
| 78 | // index refers to a specific command | 78 | // index refers to a specific command |
| 79 | const GraphicsDebugger::PicaCommandList& cmdlist = command_lists[item->parent->index].second; | 79 | const GraphicsDebugger::PicaCommandList& cmdlist = command_lists[item->parent->index].second; |
| 80 | const GraphicsDebugger::PicaCommand& cmd = cmdlist[item->index]; | 80 | const GraphicsDebugger::PicaCommand& cmd = cmdlist[item->index]; |
| 81 | const Pica::CommandHeader& header = cmd.GetHeader(); | ||
| 81 | 82 | ||
| 82 | if (role == Qt::DisplayRole) { | 83 | if (role == Qt::DisplayRole) { |
| 83 | QString content; | 84 | QString content; |
| 84 | for (int j = 0; j < cmd.size(); ++j) | 85 | if (index.column() == 0) { |
| 85 | content.append(QString("%1 ").arg(cmd[j], 8, 16, QLatin1Char('0'))); | 86 | content = Pica::command_names[header.cmd_id]; |
| 87 | content.append(" "); | ||
| 88 | } else if (index.column() == 1) { | ||
| 89 | for (int j = 0; j < cmd.size(); ++j) | ||
| 90 | content.append(QString("%1 ").arg(cmd[j], 8, 16, QLatin1Char('0'))); | ||
| 91 | } | ||
| 86 | 92 | ||
| 87 | return QVariant(content); | 93 | return QVariant(content); |
| 88 | } | 94 | } |
diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h index 5ece0a8b7..6a1e04244 100644 --- a/src/video_core/gpu_debugger.h +++ b/src/video_core/gpu_debugger.h | |||
| @@ -100,6 +100,7 @@ public: | |||
| 100 | auto& cmd = cmdlist.back(); | 100 | auto& cmd = cmdlist.back(); |
| 101 | 101 | ||
| 102 | size_t size = 2 + header.extra_data_length; | 102 | size_t size = 2 + header.extra_data_length; |
| 103 | size = (size + 1) / 2 * 2; // align to 8 bytes | ||
| 103 | cmd.reserve(size); | 104 | cmd.reserve(size); |
| 104 | std::copy(parse_pointer, parse_pointer + size, std::back_inserter(cmd)); | 105 | std::copy(parse_pointer, parse_pointer + size, std::back_inserter(cmd)); |
| 105 | 106 | ||
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 8ebe0dc3c..7cbc45f98 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -4,6 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <initializer_list> | ||
| 8 | #include <map> | ||
| 9 | |||
| 7 | #include "common/bit_field.h" | 10 | #include "common/bit_field.h" |
| 8 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 9 | 12 | ||
| @@ -34,4 +37,17 @@ union CommandHeader { | |||
| 34 | BitField<31, 1, u32> group_commands; | 37 | BitField<31, 1, u32> group_commands; |
| 35 | }; | 38 | }; |
| 36 | 39 | ||
| 40 | static std::map<CommandId, const char*> command_names = { | ||
| 41 | {CommandId::ViewportSizeX, "ViewportSizeX" }, | ||
| 42 | {CommandId::ViewportInvSizeX, "ViewportInvSizeX" }, | ||
| 43 | {CommandId::ViewportSizeY, "ViewportSizeY" }, | ||
| 44 | {CommandId::ViewportInvSizeY, "ViewportInvSizeY" }, | ||
| 45 | {CommandId::ViewportCorner, "ViewportCorner" }, | ||
| 46 | {CommandId::DepthBufferFormat, "DepthBufferFormat" }, | ||
| 47 | {CommandId::ColorBufferFormat, "ColorBufferFormat" }, | ||
| 48 | {CommandId::DepthBufferAddress, "DepthBufferAddress" }, | ||
| 49 | {CommandId::ColorBufferAddress, "ColorBufferAddress" }, | ||
| 50 | {CommandId::ColorBufferSize, "ColorBufferSize" }, | ||
| 51 | }; | ||
| 52 | |||
| 37 | } | 53 | } |