summaryrefslogtreecommitdiff
path: root/retrace/daemon/glframe_state.cpp
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2015-11-09 14:53:14 -0800
committerMark Janes <mark.a.janes@intel.com>2017-06-19 14:04:45 -0700
commit71047fabf025b813881969a68cf9a9c77a3c5c1d (patch)
treec3f0c6ebec6f51e4c6599d7dc035e670cb75e224 /retrace/daemon/glframe_state.cpp
parent8532772a0150f6814b651dddff53f80a67ac9618 (diff)
add NIR/SSA form to fragment shader assembly display
Diffstat (limited to 'retrace/daemon/glframe_state.cpp')
-rw-r--r--retrace/daemon/glframe_state.cpp32
1 files changed, 20 insertions, 12 deletions
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;
+}