From 4cb302c8aeb86bdb7c7bd6f9e5d716e140868075 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Wed, 27 May 2015 16:20:46 +0200 Subject: citra-qt: Improve shader debugger. Now supports dumping the current shader and recognizes a larger number of output semantics. --- src/citra_qt/debugger/graphics_vertex_shader.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/citra_qt/debugger/graphics_vertex_shader.h') 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; }; -- cgit v1.2.3 From 33ba604fd903d9511a414a54b91ebe818df338ef Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sun, 12 Jul 2015 01:57:59 +0200 Subject: Introduce a shader tracer to allow inspection of input/output values for each processed instruction. --- src/citra_qt/debugger/graphics_vertex_shader.h | 52 ++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 8 deletions(-) (limited to 'src/citra_qt/debugger/graphics_vertex_shader.h') diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics_vertex_shader.h index 5dc9e3703..1b46aa0d9 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics_vertex_shader.h @@ -10,11 +10,18 @@ #include "nihstro/parser_shbin.h" +#include "video_core/shader/shader.h" + +class QLabel; +class QSpinBox; + +class GraphicsVertexShaderWidget; + class GraphicsVertexShaderModel : public QAbstractItemModel { Q_OBJECT public: - GraphicsVertexShaderModel(QObject* parent); + GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent); QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex& child) const override; @@ -23,13 +30,10 @@ public: QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; -public slots: - void OnUpdate(); - - void DumpShader(); - private: - nihstro::ShaderInfo info; + GraphicsVertexShaderWidget* par; + + friend class GraphicsVertexShaderWidget; }; class GraphicsVertexShaderWidget : public BreakPointObserverDock { @@ -45,9 +49,41 @@ private slots: void OnBreakPointHit(Pica::DebugContext::Event event, void* data) override; void OnResumed() override; + void OnInputAttributeChanged(int index); + + void OnIterationIndexChanged(int index); + + void DumpShader(); + + /** Reload widget based on the current PICA200 state + * @param replace_vertex_data If true, invalidate all current vertex data + * @param vertex_data New vertex data to use, as passed to OnBreakPointHit. May be nullptr to specify that no valid vertex data can be retrieved currently. Only used if replace_vertex_data is true. + */ + void Reload(bool replace_vertex_data = false, void* vertex_data = nullptr); + + signals: - void Update(); + // Call this to change the current command selection in the disassembly view + void SelectCommand(const QModelIndex&, QItemSelectionModel::SelectionFlags); private: + QLabel* instruction_description; + QTreeView* binary_list; + GraphicsVertexShaderModel* model; + + // TODO: Move these into a single struct + std::array input_data; // A text box for each of the 4 components of up to 16 vertex attributes + std::array input_data_container; // QWidget containing the QLayout containing each vertex attribute + std::array input_data_mapping; // A QLabel denoting the shader input attribute which the vertex attribute maps to + + // Text to be shown when input vertex data is not retrievable + QLabel* breakpoint_warning; + + QSpinBox* iteration_index; + + nihstro::ShaderInfo info; + Pica::Shader::DebugData debug_data; + Pica::Shader::InputVertex input_vertex; + friend class GraphicsVertexShaderModel; }; -- cgit v1.2.3 From 493c432d1e33a66c234485ea09c167888a6f9567 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 15 Aug 2015 19:55:26 +0200 Subject: citra-qt: Fix comment style. --- src/citra_qt/debugger/graphics_vertex_shader.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/citra_qt/debugger/graphics_vertex_shader.h') diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics_vertex_shader.h index 1b46aa0d9..6e99f3674 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics_vertex_shader.h @@ -55,10 +55,11 @@ private slots: void DumpShader(); - /** Reload widget based on the current PICA200 state - * @param replace_vertex_data If true, invalidate all current vertex data - * @param vertex_data New vertex data to use, as passed to OnBreakPointHit. May be nullptr to specify that no valid vertex data can be retrieved currently. Only used if replace_vertex_data is true. - */ + /** + * Reload widget based on the current PICA200 state + * @param replace_vertex_data If true, invalidate all current vertex data + * @param vertex_data New vertex data to use, as passed to OnBreakPointHit. May be nullptr to specify that no valid vertex data can be retrieved currently. Only used if replace_vertex_data is true. + */ void Reload(bool replace_vertex_data = false, void* vertex_data = nullptr); @@ -71,7 +72,7 @@ private: QTreeView* binary_list; GraphicsVertexShaderModel* model; - // TODO: Move these into a single struct + /// TODO: Move these into a single struct std::array input_data; // A text box for each of the 4 components of up to 16 vertex attributes std::array input_data_container; // QWidget containing the QLayout containing each vertex attribute std::array input_data_mapping; // A QLabel denoting the shader input attribute which the vertex attribute maps to -- cgit v1.2.3 From 32592364b8f43232fce583d9711a653e99953028 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 15 Aug 2015 20:13:48 +0200 Subject: citra-qt/VertexShader: Minor UI improvements. Renamed "Iteration index" to the (hopefully) more intuitive "Cycle Index". Added flexible space at the bottom of the widget. --- src/citra_qt/debugger/graphics_vertex_shader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/citra_qt/debugger/graphics_vertex_shader.h') diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics_vertex_shader.h index 6e99f3674..1b3f1f7ec 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics_vertex_shader.h @@ -51,7 +51,7 @@ private slots: void OnInputAttributeChanged(int index); - void OnIterationIndexChanged(int index); + void OnCycleIndexChanged(int index); void DumpShader(); @@ -80,7 +80,7 @@ private: // Text to be shown when input vertex data is not retrievable QLabel* breakpoint_warning; - QSpinBox* iteration_index; + QSpinBox* cycle_index; nihstro::ShaderInfo info; Pica::Shader::DebugData debug_data; -- cgit v1.2.3