summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-09-21 18:00:38 -0700
committerMark Janes <mark.a.janes@intel.com>2017-09-22 09:52:10 -0700
commit72ef7ceeadcf28f23aa2387df6a5d1ac052c2775 (patch)
treedf4392bfebd00bb9039ad61883567c4fe4994956 /retrace
parent2a039171d780f7d3df7bd9adabc4c08ef9a9bdc7 (diff)
Shaders: Associate shader compiler error with the shader model
Diffstat (limited to 'retrace')
-rw-r--r--retrace/daemon/ui/glframe_retrace_model.cpp6
-rw-r--r--retrace/daemon/ui/glframe_retrace_model.hpp5
-rw-r--r--retrace/daemon/ui/glframe_shader_model.cpp11
-rw-r--r--retrace/daemon/ui/glframe_shader_model.hpp14
-rw-r--r--retrace/daemon/ui/qml/RenderShadersControl.qml2
5 files changed, 26 insertions, 12 deletions
diff --git a/retrace/daemon/ui/glframe_retrace_model.cpp b/retrace/daemon/ui/glframe_retrace_model.cpp
index 6890265a..48841e34 100644
--- a/retrace/daemon/ui/glframe_retrace_model.cpp
+++ b/retrace/daemon/ui/glframe_retrace_model.cpp
@@ -70,7 +70,6 @@ FrameRetraceModel::FrameRetraceModel()
m_selection(NULL),
m_selection_count(0),
m_experiment_count(0),
- m_shader_compile_error(""),
m_open_percent(0),
m_frame_count(0),
m_max_metric(0),
@@ -228,10 +227,7 @@ FrameRetraceModel::onShaderCompile(RenderId renderId,
ExperimentId experimentCount,
bool status,
const std::string &errorString) {
- if (errorString.size())
- GRLOGF(WARN, "Compilation error: %s", errorString.c_str());
- m_shader_compile_error = errorString.c_str();
- emit onShaderCompileError();
+ m_shaders.onShaderCompile(renderId, experimentCount, status, errorString);
}
void
diff --git a/retrace/daemon/ui/glframe_retrace_model.hpp b/retrace/daemon/ui/glframe_retrace_model.hpp
index 07579e4c..099b094f 100644
--- a/retrace/daemon/ui/glframe_retrace_model.hpp
+++ b/retrace/daemon/ui/glframe_retrace_model.hpp
@@ -106,8 +106,6 @@ class FrameRetraceModel : public QObject,
Q_PROPERTY(glretrace::QRenderShadersList* shaders READ shaders CONSTANT)
Q_PROPERTY(glretrace::QApiModel* api READ api CONSTANT)
Q_PROPERTY(glretrace::QBatchModel* batch READ batch CONSTANT)
- Q_PROPERTY(QString shaderCompileError READ shaderCompileError
- NOTIFY onShaderCompileError)
Q_PROPERTY(QString argvZero READ argvZero WRITE setArgvZero
NOTIFY onArgvZero)
Q_PROPERTY(glretrace::QMetricsModel* metricTab READ metricTab CONSTANT)
@@ -191,7 +189,6 @@ class FrameRetraceModel : public QObject,
QApiModel *api() { return &m_api; }
QBatchModel *batch() { return &m_batch; }
QRenderTargetModel *rendertarget() { return m_rendertarget; }
- QString shaderCompileError() { return m_shader_compile_error; }
QString argvZero() { return main_exe; }
void setArgvZero(const QString &a) { main_exe = a; emit onArgvZero(); }
QMetricsModel *metricTab() { return &m_metrics_table; }
@@ -215,7 +212,6 @@ class FrameRetraceModel : public QObject,
void onRenders();
void onFrameCount();
void onMaxMetric();
- void onShaderCompileError();
void onArgvZero();
void onGeneralError();
@@ -257,7 +253,6 @@ class FrameRetraceModel : public QObject,
QList<BarMetrics> m_metrics;
QRenderShadersList m_shaders;
- QString m_shader_compile_error;
QString main_exe; // for path to frameretrace_server
int m_target_frame_number, m_open_percent, m_frame_count;
diff --git a/retrace/daemon/ui/glframe_shader_model.cpp b/retrace/daemon/ui/glframe_shader_model.cpp
index bfe9273f..c45db629 100644
--- a/retrace/daemon/ui/glframe_shader_model.cpp
+++ b/retrace/daemon/ui/glframe_shader_model.cpp
@@ -191,3 +191,14 @@ QRenderShadersList::onExperiment(ExperimentId id) {
m_render_strings.clear();
}
}
+
+void
+QRenderShadersList::onShaderCompile(RenderId renderId,
+ ExperimentId experimentCount,
+ bool status,
+ const std::string &errorString) {
+ if (errorString.size())
+ GRLOGF(WARN, "Compilation error: %s", errorString.c_str());
+ m_shader_compile_error = errorString.c_str();
+ emit onShaderCompileError();
+}
diff --git a/retrace/daemon/ui/glframe_shader_model.hpp b/retrace/daemon/ui/glframe_shader_model.hpp
index e259a5f5..97416efd 100644
--- a/retrace/daemon/ui/glframe_shader_model.hpp
+++ b/retrace/daemon/ui/glframe_shader_model.hpp
@@ -35,6 +35,7 @@
#include <mutex>
#include <vector>
+#include <string>
#include "glframe_retrace_interface.hpp"
#include "glframe_traits.hpp"
@@ -170,8 +171,12 @@ class QRenderShadersList : public QObject,
CONSTANT)
Q_PROPERTY(QStringList renders
READ renders NOTIFY onRendersChanged)
+ Q_PROPERTY(QString shaderCompileError READ shaderCompileError
+ NOTIFY onShaderCompileError)
public:
- QRenderShadersList() : m_retracer(NULL), m_retraceModel(NULL) {}
+ QRenderShadersList() : m_shader_compile_error(""),
+ m_retracer(NULL),
+ m_retraceModel(NULL) {}
~QRenderShadersList() {}
void setRetrace(IFrameRetrace *retracer,
FrameRetraceModel *model);
@@ -185,6 +190,11 @@ class QRenderShadersList : public QObject,
const ShaderAssembly &geom,
const ShaderAssembly &comp);
QStringList renders();
+ QString shaderCompileError() { return m_shader_compile_error; }
+ void onShaderCompile(RenderId renderId,
+ ExperimentId experimentCount,
+ bool status,
+ const std::string &errorString);
Q_INVOKABLE void setIndex(int index);
Q_INVOKABLE void overrideShaders(int index,
const QString &vs, const QString &fs,
@@ -196,6 +206,7 @@ class QRenderShadersList : public QObject,
signals:
void onRendersChanged();
void shadersChanged();
+ void onShaderCompileError();
private:
void setIndexDirect(int index);
@@ -206,6 +217,7 @@ class QRenderShadersList : public QObject,
std::vector<std::vector<ShaderAssembly>> m_shader_assemblies;
SelectionId m_current_selection;
ExperimentId m_experiment_count;
+ QString m_shader_compile_error;
IFrameRetrace *m_retracer;
FrameRetraceModel *m_retraceModel;
};
diff --git a/retrace/daemon/ui/qml/RenderShadersControl.qml b/retrace/daemon/ui/qml/RenderShadersControl.qml
index 53f6c6b6..3a6dad00 100644
--- a/retrace/daemon/ui/qml/RenderShadersControl.qml
+++ b/retrace/daemon/ui/qml/RenderShadersControl.qml
@@ -11,7 +11,7 @@ Item {
id: compileError
title: "Shader Compilation Error"
icon: StandardIcon.Warning
- text: frameRetrace.shaderCompileError
+ text: renderModel.shaderCompileError
onTextChanged: {
if (Boolean(text))
visible = true;