summaryrefslogtreecommitdiff
path: root/retrace/daemon/glframe_state.cpp
diff options
context:
space:
mode:
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;
+}