diff options
author | Mark Janes <mark.a.janes@intel.com> | 2017-01-10 16:30:07 -0800 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2017-06-19 14:04:49 -0700 |
commit | d20ffb3c9f9fea992c141f55f65f459276f046cd (patch) | |
tree | 4611c77f230b6e7660e6d2f9666947614f65cab1 | |
parent | 7d7be6a5175936067b0e9959b74ddf8f3c9a5992 (diff) |
rendertarget: eliminate redundant rt callbacks
retraceRenderTarget provides exactly one image after all selected
renders have been retraced. An implementation bug called back after
each linear selection series.
-rw-r--r-- | retrace/daemon/glframe_retrace.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/retrace/daemon/glframe_retrace.cpp b/retrace/daemon/glframe_retrace.cpp index 9aeb16eb..fb53796c 100644 --- a/retrace/daemon/glframe_retrace.cpp +++ b/retrace/daemon/glframe_retrace.cpp @@ -227,25 +227,26 @@ FrameRetrace::retraceRenderTarget(ExperimentId experimentCount, ++current_render_id; } } + } - Image *i = glstate::getDrawBufferImage(0); - if (!i) { - GRLOGF(WARN, "Failed to obtain draw buffer image for render id: %d", - current_render_id()); - if (callback) - callback->onError("Failed to obtain draw buffer image"); - } else { - std::stringstream png; - i->writePNG(png); - - std::vector<unsigned char> d; - const int bytes = png.str().size(); - d.resize(bytes); - memcpy(d.data(), png.str().c_str(), bytes); - if (callback) - callback->onRenderTarget(selection.id, experimentCount, d); - } + Image *i = glstate::getDrawBufferImage(0); + if (!i) { + GRLOGF(WARN, "Failed to obtain draw buffer image for render id: %d", + current_render_id()); + if (callback) + callback->onError("Failed to obtain draw buffer image"); + } else { + std::stringstream png; + i->writePNG(png); + + std::vector<unsigned char> d; + const int bytes = png.str().size(); + d.resize(bytes); + memcpy(d.data(), png.str().c_str(), bytes); + if (callback) + callback->onRenderTarget(selection.id, experimentCount, d); } + // play to the rest of the frame while (current_render_id.index() < m_renders.size()) { m_renders[current_render_id.index()]->retraceRenderTarget(m_tracker, |