diff options
-rw-r--r-- | retrace/daemon/glframe_retrace.cpp | 4 | ||||
-rw-r--r-- | retrace/daemon/glframe_retrace.hpp | 10 | ||||
-rw-r--r-- | retrace/daemon/glframe_retrace_skeleton.cpp | 6 | ||||
-rw-r--r-- | retrace/daemon/glframe_retrace_skeleton.hpp | 4 | ||||
-rw-r--r-- | retrace/daemon/glframe_retrace_stub.cpp | 4 | ||||
-rw-r--r-- | retrace/daemon/glframe_state.cpp | 32 | ||||
-rw-r--r-- | retrace/daemon/playback.proto | 2 | ||||
-rw-r--r-- | retrace/daemon/test/retrace_daemon_test.cpp | 4 | ||||
-rw-r--r-- | retrace/daemon/test/retrace_metrics_test.cpp | 4 | ||||
-rw-r--r-- | retrace/daemon/ui/glframe_retrace_model.cpp | 6 | ||||
-rw-r--r-- | retrace/daemon/ui/glframe_retrace_model.hpp | 10 | ||||
-rw-r--r-- | retrace/daemon/ui/qml/mainwin.qml | 22 |
12 files changed, 83 insertions, 25 deletions
diff --git a/retrace/daemon/glframe_retrace.cpp b/retrace/daemon/glframe_retrace.cpp index 32d1b957..0e9b6a4b 100644 --- a/retrace/daemon/glframe_retrace.cpp +++ b/retrace/daemon/glframe_retrace.cpp @@ -281,7 +281,9 @@ FrameRetrace::retraceShaderAssembly(RenderId renderId, tmp_tracker.currentFragmentShader(), tmp_tracker.currentFragmentIr(), tmp_tracker.currentFragmentSimd8(), - tmp_tracker.currentFragmentSimd16()); + tmp_tracker.currentFragmentSimd16(), + tmp_tracker.currentFragmentSSA(), + tmp_tracker.currentFragmentNIR()); } FrameState::FrameState(const std::string &filename, diff --git a/retrace/daemon/glframe_retrace.hpp b/retrace/daemon/glframe_retrace.hpp index 66b94ecf..9a2da90f 100644 --- a/retrace/daemon/glframe_retrace.hpp +++ b/retrace/daemon/glframe_retrace.hpp @@ -167,10 +167,12 @@ class OnFrameRetrace { const std::string &vertex_shader, const std::string &vertex_ir, const std::string &vertex_vec4, - const std::string &fragemnt_shader, - const std::string &fragemnt_ir, - const std::string &fragemnt_simd8, - const std::string &fragemnt_simd16) = 0; + const std::string &fragment_shader, + const std::string &fragment_ir, + const std::string &fragment_simd8, + const std::string &fragment_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final) = 0; virtual void onRenderTarget(RenderId renderId, RenderTargetType type, const uvec & pngImageData) = 0; virtual void onShaderCompile(RenderId renderId, int status, diff --git a/retrace/daemon/glframe_retrace_skeleton.cpp b/retrace/daemon/glframe_retrace_skeleton.cpp index b9b25b7d..6c866b97 100644 --- a/retrace/daemon/glframe_retrace_skeleton.cpp +++ b/retrace/daemon/glframe_retrace_skeleton.cpp @@ -166,7 +166,9 @@ FrameRetraceSkeleton::onShaderAssembly(RenderId renderId, const std::string &fragment_shader, const std::string &fragment_ir, const std::string &fragment_simd8, - const std::string &fragment_simd16) { + const std::string &fragment_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final) { RetraceResponse proto_response; auto shader = proto_response.mutable_shaderassembly(); shader->set_vertex_shader(vertex_shader); @@ -176,6 +178,8 @@ FrameRetraceSkeleton::onShaderAssembly(RenderId renderId, shader->set_fragment_ir(fragment_ir); shader->set_fragment_simd8(fragment_simd8); shader->set_fragment_simd16(fragment_simd16); + shader->set_fragment_ssa(fragment_nir_ssa); + shader->set_fragment_nir(fragment_nir_final); writeResponse(m_socket, proto_response, &m_buf); } diff --git a/retrace/daemon/glframe_retrace_skeleton.hpp b/retrace/daemon/glframe_retrace_skeleton.hpp index 9f780371..8182ae1a 100644 --- a/retrace/daemon/glframe_retrace_skeleton.hpp +++ b/retrace/daemon/glframe_retrace_skeleton.hpp @@ -58,7 +58,9 @@ class FrameRetraceSkeleton : public Thread, const std::string &fragment_shader, const std::string &fragment_ir, const std::string &fragment_simd8, - const std::string &fragment_simd16); + const std::string &fragment_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final); virtual void onFileOpening(bool finished, uint32_t percent_complete); virtual void onRenderTarget(RenderId renderId, RenderTargetType type, diff --git a/retrace/daemon/glframe_retrace_stub.cpp b/retrace/daemon/glframe_retrace_stub.cpp index 34958bff..9526a95e 100644 --- a/retrace/daemon/glframe_retrace_stub.cpp +++ b/retrace/daemon/glframe_retrace_stub.cpp @@ -171,7 +171,9 @@ class RetraceShaderAssemblyRequest : public IRetraceRequest { shader.fragment_shader(), shader.fragment_ir(), shader.fragment_simd8(), - shader.fragment_simd16()); + shader.fragment_simd16(), + shader.fragment_ssa(), + shader.fragment_nir()); } private: diff --git a/retrace/daemon/glframe_state.cpp b/retrace/daemon/glframe_state.cpp index 10185743..b65c2768 100644 --- a/retrace/daemon/glframe_state.cpp +++ b/retrace/daemon/glframe_state.cpp @@ -120,19 +120,11 @@ StateTrack::parse(const std::string &output) { if (matches > 0) current_target = &vs_ir; - if (matches <= 0) { - matches = sscanf(line.c_str(), - "NIR (SSA form) for fragment shader:"); - if (matches > 0) - current_target = &fs_nir_ssa; - } + if (0 == strcmp(line.c_str(), "NIR (SSA form) for fragment shader:")) + current_target = &fs_nir_ssa; - if (matches <= 0) { - matches = sscanf(line.c_str(), - "NIR (final form) for fragment shader:"); - if (matches > 0) - current_target = &fs_nir_final; - } + if (0 == strcmp(line.c_str(), "NIR (final form) for fragment shader:")) + current_target = &fs_nir_final; if (matches <= 0) { matches = sscanf(line.c_str(), @@ -256,3 +248,19 @@ StateTrack::currentFragmentSimd16() const { return ""; return sh->second; } + +std::string +StateTrack::currentFragmentSSA() const { + auto sh = program_to_fragment_shader_ssa.find(current_program); + if (sh == program_to_fragment_shader_ssa.end()) + return ""; + return sh->second; +} + +std::string +StateTrack::currentFragmentNIR() const { + auto sh = program_to_fragment_shader_nir.find(current_program); + if (sh == program_to_fragment_shader_nir.end()) + return ""; + return sh->second; +} diff --git a/retrace/daemon/playback.proto b/retrace/daemon/playback.proto index 997364bc..3d5a8dd9 100644 --- a/retrace/daemon/playback.proto +++ b/retrace/daemon/playback.proto @@ -57,6 +57,8 @@ message ShaderAssemblyResponse { required string fragment_ir = 5; required string fragment_simd8 = 6; required string fragment_simd16 = 7; + required string fragment_ssa = 8; + required string fragment_nir = 9; } message MetricSeries { diff --git a/retrace/daemon/test/retrace_daemon_test.cpp b/retrace/daemon/test/retrace_daemon_test.cpp index e8a75f05..073ab858 100644 --- a/retrace/daemon/test/retrace_daemon_test.cpp +++ b/retrace/daemon/test/retrace_daemon_test.cpp @@ -57,7 +57,9 @@ class NullCallback : public OnFrameRetrace { const std::string &fragemnt_shader, const std::string &fragemnt_ir, const std::string &fragemnt_simd8, - const std::string &fragemnt_simd16) {} + const std::string &fragemnt_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final) {} void onRenderTarget(RenderId renderId, RenderTargetType type, const uvec & pngImageData) {} void onShaderCompile(RenderId renderId, int status, diff --git a/retrace/daemon/test/retrace_metrics_test.cpp b/retrace/daemon/test/retrace_metrics_test.cpp index 5cc66f5b..71cbdcbf 100644 --- a/retrace/daemon/test/retrace_metrics_test.cpp +++ b/retrace/daemon/test/retrace_metrics_test.cpp @@ -46,7 +46,9 @@ class MetricsCallback : public OnFrameRetrace { const std::string &fragemnt_shader, const std::string &fragemnt_ir, const std::string &fragemnt_simd8, - const std::string &fragemnt_simd16) {} + const std::string &fragemnt_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final) {} void onRenderTarget(RenderId renderId, RenderTargetType type, const uvec & pngImageData) {} void onShaderCompile(RenderId renderId, int status, diff --git a/retrace/daemon/ui/glframe_retrace_model.cpp b/retrace/daemon/ui/glframe_retrace_model.cpp index ee9e931b..79c02cfb 100644 --- a/retrace/daemon/ui/glframe_retrace_model.cpp +++ b/retrace/daemon/ui/glframe_retrace_model.cpp @@ -95,7 +95,9 @@ FrameRetraceModel::onShaderAssembly(RenderId renderId, const std::string &fragment_shader, const std::string &fragment_ir, const std::string &fragment_simd8, - const std::string &fragment_simd16) { + const std::string &fragment_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final) { ScopedLock s(m_protect); m_vs_ir = vertex_ir.c_str(); m_fs_ir = fragment_ir.c_str(); @@ -104,6 +106,8 @@ FrameRetraceModel::onShaderAssembly(RenderId renderId, m_vs_vec4 = vertex_vec4.c_str(); m_fs_simd8 = fragment_simd8.c_str(); m_fs_simd16 = fragment_simd16.c_str(); + m_fs_ssa = fragment_nir_ssa.c_str(); + m_fs_nir = fragment_nir_final.c_str(); emit onShaders(); } diff --git a/retrace/daemon/ui/glframe_retrace_model.hpp b/retrace/daemon/ui/glframe_retrace_model.hpp index ea3dd63c..035f1b9b 100644 --- a/retrace/daemon/ui/glframe_retrace_model.hpp +++ b/retrace/daemon/ui/glframe_retrace_model.hpp @@ -100,6 +100,8 @@ class FrameRetraceModel : public QObject, Q_PROPERTY(QString vsVec4 READ vsVec4 NOTIFY onShaders) Q_PROPERTY(QString fsSimd8 READ fsSimd8 NOTIFY onShaders) Q_PROPERTY(QString fsSimd16 READ fsSimd16 NOTIFY onShaders) + Q_PROPERTY(QString fsNIR READ fsNIR NOTIFY onShaders) + Q_PROPERTY(QString fsSSA READ fsSSA NOTIFY onShaders) Q_PROPERTY(QString renderTargetImage READ renderTargetImage NOTIFY onRenderTarget) Q_PROPERTY(int openPercent READ openPercent NOTIFY onOpenPercent) @@ -126,7 +128,9 @@ class FrameRetraceModel : public QObject, const std::string &fragment_shader, const std::string &fragment_ir, const std::string &fragment_simd8, - const std::string &fragment_simd16); + const std::string &fragment_simd16, + const std::string &fragment_nir_ssa, + const std::string &fragment_nir_final); void onRenderTarget(RenderId renderId, RenderTargetType type, const std::vector<unsigned char> &data); void onShaderCompile(RenderId renderId, int status, @@ -142,6 +146,8 @@ class FrameRetraceModel : public QObject, QString vsVec4() const { ScopedLock s(m_protect); return m_vs_vec4; } QString fsSimd8() const { ScopedLock s(m_protect); return m_fs_simd8; } QString fsSimd16() const { ScopedLock s(m_protect); return m_fs_simd16; } + QString fsSSA() const { ScopedLock s(m_protect); return m_fs_ssa; } + QString fsNIR() const { ScopedLock s(m_protect); return m_fs_nir; } QString renderTargetImage() const; int openPercent() const { ScopedLock s(m_protect); return m_open_percent; } float maxMetric() const { ScopedLock s(m_protect); return m_max_metric; } @@ -173,7 +179,7 @@ class FrameRetraceModel : public QObject, QList<BarMetrics> m_metrics; QString m_vs_ir, m_fs_ir, m_vs_shader, m_fs_shader, - m_vs_vec4, m_fs_simd8, m_fs_simd16; + m_vs_vec4, m_fs_simd8, m_fs_simd16, m_fs_ssa, m_fs_nir; int m_open_percent; // thread-safe storage for member data updated from the retrace diff --git a/retrace/daemon/ui/qml/mainwin.qml b/retrace/daemon/ui/qml/mainwin.qml index 30fa24f7..3042a82e 100644 --- a/retrace/daemon/ui/qml/mainwin.qml +++ b/retrace/daemon/ui/qml/mainwin.qml @@ -290,6 +290,28 @@ ApplicationWindow { } } } + Tab { + title: "SSA" + Flickable { + contentWidth: fsSSA.width; contentHeight: fsSSA.height + clip: true + Text { + id: fsSSA + text: frameRetrace.fsSSA + } + } + } + Tab { + title: "NIR" + Flickable { + contentWidth: fsNIR.width; contentHeight: fsNIR.height + clip: true + Text { + id: fsNIR + text: frameRetrace.fsNIR + } + } + } } } Tab { |