diff options
Diffstat (limited to 'retrace')
-rw-r--r-- | retrace/daemon/glframe_retrace.cpp | 2 | ||||
-rw-r--r-- | retrace/daemon/glframe_retrace_render.cpp | 21 | ||||
-rw-r--r-- | retrace/daemon/glframe_retrace_render.hpp | 1 | ||||
-rw-r--r-- | retrace/daemon/ui/glframe_metrics_model.cpp | 1 |
4 files changed, 19 insertions, 6 deletions
diff --git a/retrace/daemon/glframe_retrace.cpp b/retrace/daemon/glframe_retrace.cpp index 58929bb7..6b0a156d 100644 --- a/retrace/daemon/glframe_retrace.cpp +++ b/retrace/daemon/glframe_retrace.cpp @@ -317,7 +317,7 @@ FrameState::FrameState(const std::string &filename, } while ((call = p->scan_call())) { - if (call->flags & trace::CALL_FLAG_RENDER) { + if (RetraceRender::isRender(*call)) { ++render_count; } diff --git a/retrace/daemon/glframe_retrace_render.cpp b/retrace/daemon/glframe_retrace_render.cpp index 8a5cf734..fdceefb6 100644 --- a/retrace/daemon/glframe_retrace_render.cpp +++ b/retrace/daemon/glframe_retrace_render.cpp @@ -57,6 +57,20 @@ static const std::string simple_fs = " gl_FragColor = vec4(1,0,1,1);\n" "}"; +bool +RetraceRender::isRender(const trace::Call &call) { + return (call.flags & trace::CALL_FLAG_RENDER) || + (strcmp("glDispatchCompute", call.name()) == 0) || + (strcmp("glDispatchComputeIndirect", + call.name()) == 0); +} + +bool +isCompute(const trace::Call &call) { + return (RetraceRender::isRender(call) && + (!(call.flags & trace::CALL_FLAG_RENDER))); +} + RetraceRender::RetraceRender(trace::AbstractParser *parser, retrace::Retracer *retracer, StateTrack *tracker) : m_parser(parser), @@ -79,11 +93,8 @@ RetraceRender::RetraceRender(trace::AbstractParser *parser, m_retracer->retrace(*call); tracker->track(*call); m_end_of_frame = call->flags & trace::CALL_FLAG_END_FRAME; - const bool render = (call->flags & trace::CALL_FLAG_RENDER) || - (strcmp("glDispatchCompute", call->name()) == 0) || - (strcmp("glDispatchComputeIndirect", - call->name()) == 0); - compute = render && (!(call->flags & trace::CALL_FLAG_RENDER)); + const bool render = isRender(*call); + compute = isCompute(*call); assert(!changesContext(call)); delete call; diff --git a/retrace/daemon/glframe_retrace_render.hpp b/retrace/daemon/glframe_retrace_render.hpp index a0f32f2f..64908487 100644 --- a/retrace/daemon/glframe_retrace_render.hpp +++ b/retrace/daemon/glframe_retrace_render.hpp @@ -74,6 +74,7 @@ class RetraceRender { void onApi(SelectionId selId, RenderId renderId, OnFrameRetrace *callback); + static bool isRender(const trace::Call &c); private: trace::AbstractParser *m_parser; diff --git a/retrace/daemon/ui/glframe_metrics_model.cpp b/retrace/daemon/ui/glframe_metrics_model.cpp index b220358a..2ccbec84 100644 --- a/retrace/daemon/ui/glframe_metrics_model.cpp +++ b/retrace/daemon/ui/glframe_metrics_model.cpp @@ -162,6 +162,7 @@ QMetricsModel::refresh() { // no metrics available return; + // retrace the metrics for the frame RenderSelection s; s.id = SelectionId(0); s.series.push_back(RenderSequence(RenderId(0), RenderId(m_render_count))); |