diff options
author | Mark Janes <mark.a.janes@intel.com> | 2015-11-13 13:23:51 -0800 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2017-06-19 14:04:45 -0700 |
commit | ff1bb0860cf137ee9d3623154eccf29d63ff00c6 (patch) | |
tree | 0b6f2e7e10c230eef588c69a3e4ca8b939957c38 /retrace/daemon/glframe_state.hpp | |
parent | be23e153907eefa8df576077fef19a001a0b821d (diff) |
refactor retracing into Render-specific delegate
When replacing shaders and changing state, each render will have a set
of overrides that apply to its retrace implementation. This commit
splits calls into renders, and delegates retracing to those renders.
This refactor has the nice side effect of breaking up what was a
monolithic retrace implementation.
Diffstat (limited to 'retrace/daemon/glframe_state.hpp')
-rw-r--r-- | retrace/daemon/glframe_state.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/retrace/daemon/glframe_state.hpp b/retrace/daemon/glframe_state.hpp index aae2b743..24e70340 100644 --- a/retrace/daemon/glframe_state.hpp +++ b/retrace/daemon/glframe_state.hpp @@ -36,13 +36,19 @@ class Call; namespace glretrace { +class OutputPoller { + public: + virtual std::string poll() = 0; + virtual ~OutputPoller() {} +}; + // tracks subset of gl state for frameretrace purposes class StateTrack { public: - StateTrack() {} + explicit StateTrack(OutputPoller *p) : m_poller(p) {} ~StateTrack() {} void track(const trace::Call &call); - void parse(const std::string &output); + void flush(); void reset() { current_program = 0; } std::string currentVertexShader() const; std::string currentVertexIr() const; @@ -53,6 +59,7 @@ class StateTrack { std::string currentFragmentSimd16() const; std::string currentFragmentSSA() const; std::string currentFragmentNIR() const; + uint64_t currentContext() const { return current_context; } private: class TrackMap { @@ -69,8 +76,11 @@ class StateTrack { void trackShaderSource(const trace::Call &); void trackLinkProgram(const trace::Call &); void trackUseProgram(const trace::Call &); + void parse(); + OutputPoller *m_poller; int current_program; + uint64_t current_context; std::map<int, std::string> shader_to_source; std::map<int, int> shader_to_type; |