From 2e3abae206c0ed73ebefd80b6518c065b89c8910 Mon Sep 17 00:00:00 2001 From: Mark Janes Date: Wed, 26 Apr 2017 18:16:56 -0700 Subject: Experiments: Add Disable Draw experiment Add a tab to hold frame experiments. The first experiment is the simplest: Disable the selected draw calls. When an experiment is enabled, all UI for the frame needs to be refreshed to take into account the modified frame: - Bar graph - Metrics table - Render target - Shaders (for Disable Draw, they will be unchanged) - GPU Batch Subsequent retrace requests for these items are out of date at the point an experiment is enabled, in the same way that Selection outdates several the API log and other visualizations. ExperimentId is distributed throughout the models in the same way as selection, and they respond to that signal to request new data. The Retrace interface drops out of date requests based on both selection and experiment status. --- retrace/daemon/bargraph/glframe_qbargraph.cpp | 3 ++- retrace/daemon/bargraph/glframe_qbargraph.hpp | 2 +- retrace/daemon/bargraph/glframe_qselection.cpp | 11 +++++++++-- retrace/daemon/bargraph/glframe_qselection.hpp | 7 ++++++- retrace/daemon/bargraph/test/test_selection.hpp | 4 +++- 5 files changed, 21 insertions(+), 6 deletions(-) (limited to 'retrace/daemon/bargraph') diff --git a/retrace/daemon/bargraph/glframe_qbargraph.cpp b/retrace/daemon/bargraph/glframe_qbargraph.cpp index 5a5d2920..68737870 100644 --- a/retrace/daemon/bargraph/glframe_qbargraph.cpp +++ b/retrace/daemon/bargraph/glframe_qbargraph.cpp @@ -42,6 +42,7 @@ using glretrace::BarMetrics; using glretrace::FrameRetraceModel; using glretrace::QBarGraphRenderer; using glretrace::QSelection; +using glretrace::SelectionId; QBarGraphRenderer::QBarGraphRenderer() : m_graph(true), selection(NULL), @@ -108,7 +109,7 @@ QBarGraphRenderer::onBarSelect(const std::vector selection) { } void -QBarGraphRenderer::onSelect(QList selection) { +QBarGraphRenderer::onSelect(SelectionId, QList selection) { std::set s; for (auto i : selection) s.insert(i); diff --git a/retrace/daemon/bargraph/glframe_qbargraph.hpp b/retrace/daemon/bargraph/glframe_qbargraph.hpp index a31aad00..bfa736b1 100644 --- a/retrace/daemon/bargraph/glframe_qbargraph.hpp +++ b/retrace/daemon/bargraph/glframe_qbargraph.hpp @@ -53,7 +53,7 @@ class QBarGraphRenderer : public QObject, // to ensure that we get a multisample fbo QOpenGLFramebufferObject * createFramebufferObject(const QSize & size); public slots: - void onSelect(QList selection); + void onSelect(glretrace::SelectionId id, QList selection); void onMetrics(QList metrics); signals: void barSelect(QList selection); diff --git a/retrace/daemon/bargraph/glframe_qselection.cpp b/retrace/daemon/bargraph/glframe_qselection.cpp index 1df7bcb6..7eeb31e8 100644 --- a/retrace/daemon/bargraph/glframe_qselection.cpp +++ b/retrace/daemon/bargraph/glframe_qselection.cpp @@ -29,7 +29,8 @@ using glretrace::QSelection; -QSelection::QSelection() {} +QSelection::QSelection() : m_selection_count(0), + m_experiment_count(0) {} QSelection::~QSelection() {} @@ -39,6 +40,12 @@ QSelection::select(QList selection) { if (selection == _selection) return; _selection = selection; - emit onSelect(_selection); + ++m_selection_count; + emit onSelect(m_selection_count, _selection); } +void +QSelection::experiment() { + ++m_experiment_count; + emit onExperiment(m_experiment_count); +} diff --git a/retrace/daemon/bargraph/glframe_qselection.hpp b/retrace/daemon/bargraph/glframe_qselection.hpp index 5e88e8e9..7ccde0a4 100644 --- a/retrace/daemon/bargraph/glframe_qselection.hpp +++ b/retrace/daemon/bargraph/glframe_qselection.hpp @@ -30,6 +30,7 @@ #include #include "glframe_traits.hpp" +#include "glframe_retrace_interface.hpp" namespace glretrace { @@ -41,10 +42,14 @@ class QSelection : public QObject, virtual ~QSelection(); public slots: void select(QList selection); + void experiment(); signals: - void onSelect(QList selection); + void onSelect(glretrace::SelectionId selection_count, QList selection); + void onExperiment(glretrace::ExperimentId experiment_count); private: QList _selection; + SelectionId m_selection_count; + ExperimentId m_experiment_count; }; } // namespace glretrace diff --git a/retrace/daemon/bargraph/test/test_selection.hpp b/retrace/daemon/bargraph/test/test_selection.hpp index 0b69f6e5..874013b8 100644 --- a/retrace/daemon/bargraph/test/test_selection.hpp +++ b/retrace/daemon/bargraph/test/test_selection.hpp @@ -44,9 +44,11 @@ class SelectionObserver : public QObject { } virtual ~SelectionObserver() {} QList selection_state; + SelectionId selection_count; bool notified; public slots: - void onSelect(QList selection) { + void onSelect(glretrace::SelectionId id, QList selection) { + selection_count = id; selection_state = selection; notified = true; } -- cgit v1.2.3