diff options
author | Tony Wasserka <NeoBrainX@gmail.com> | 2015-05-27 16:20:46 +0200 |
---|---|---|
committer | Tony Wasserka <NeoBrainX@gmail.com> | 2015-08-16 13:22:00 +0200 |
commit | 4cb302c8aeb86bdb7c7bd6f9e5d716e140868075 (patch) | |
tree | 3aebbc2a55c68a48cbf72bcf7652485c1ac9b745 /src/citra_qt/debugger | |
parent | citra-qt: Print the correct swizzle mask for SRC2 in the shader disassembler. (diff) | |
download | yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.tar yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.tar.gz yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.tar.bz2 yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.tar.lz yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.tar.xz yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.tar.zst yuzu-4cb302c8aeb86bdb7c7bd6f9e5d716e140868075.zip |
Diffstat (limited to 'src/citra_qt/debugger')
-rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 21 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.h | 2 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index b7882741d..92d3a8323 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp @@ -6,6 +6,8 @@ #include <sstream> #include <QBoxLayout> +#include <QLabel> +#include <QPushButton> #include <QTreeView> #include "video_core/shader/shader_interpreter.h" @@ -253,18 +255,27 @@ void GraphicsVertexShaderModel::OnUpdate() info.Clear(); - for (auto instr : Pica::g_state.vs.program_code) + auto& shader_setup = Pica::g_state.vs; + for (auto instr : shader_setup.program_code) info.code.push_back({instr}); - for (auto pattern : Pica::g_state.vs.swizzle_data) + for (auto pattern : shader_setup.swizzle_data) info.swizzle_info.push_back({pattern}); - info.labels.insert({ Pica::g_state.regs.vs.main_offset, "main" }); + u32 entry_point = Pica::g_state.regs.vs.main_offset; + info.labels.insert({ entry_point, "main" }); endResetModel(); } +void GraphicsVertexShaderModel::DumpShader() { + auto& setup = Pica::g_state.vs; + auto& config = Pica::g_state.regs.vs; + Pica::DebugUtils::DumpShader(setup.program_code.data(), setup.program_code.size(), + setup.swizzle_data.data(), setup.swizzle_data.size(), + config.main_offset, Pica::g_state.regs.vs_output_attributes); +} GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::DebugContext > debug_context, QWidget* parent) : BreakPointObserverDock(debug_context, "Pica Vertex Shader", parent) { @@ -276,6 +287,9 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::De binary_list->setRootIsDecorated(false); binary_list->setAlternatingRowColors(true); + auto dump_shader = new QPushButton(tr("Dump")); + + connect(dump_shader, SIGNAL(clicked()), binary_model, SLOT(DumpShader())); connect(this, SIGNAL(Update()), binary_model, SLOT(OnUpdate())); auto main_widget = new QWidget; @@ -285,6 +299,7 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::De sub_layout->addWidget(binary_list); main_layout->addLayout(sub_layout); } + main_layout->addWidget(dump_shader); main_widget->setLayout(main_layout); setWidget(main_widget); } diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics_vertex_shader.h index 38339dc05..5dc9e3703 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics_vertex_shader.h @@ -26,6 +26,8 @@ public: public slots: void OnUpdate(); + void DumpShader(); + private: nihstro::ShaderInfo info; }; |