Skip to content

Commit

Permalink
Subtract target for not async filters
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Oct 25, 2024
1 parent 936aa05 commit 567012c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions source-profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,18 +1188,31 @@ void PerfTreeItem::update()
obs_source_t *source = obs_weak_source_get_source(m_source);
bool cleared = false;
if (source) {
source_profiler_fill_result(source, m_perf);

if (obs_source_get_type(source) == OBS_SOURCE_TYPE_FILTER) {
rendered = m_parentItem->rendered && obs_source_enabled(source);
active = m_parentItem->active && obs_source_enabled(source);
if ((obs_source_get_output_flags(source) & OBS_SOURCE_ASYNC_VIDEO) != OBS_SOURCE_ASYNC_VIDEO) {
obs_source_t *target = obs_filter_get_target(source);
if (target) {
profiler_result_t diff;
source_profiler_fill_result(target, &diff);
m_perf->render_avg -= diff.render_avg;
m_perf->render_max -= diff.render_max;
m_perf->render_gpu_avg -= diff.render_gpu_avg;
m_perf->render_gpu_max -= diff.render_gpu_max;
m_perf->render_sum -= diff.render_sum;
m_perf->render_gpu_sum -= diff.render_gpu_sum;
}
}
} else {
rendered = obs_source_showing(source);
active = obs_source_active(source);
}

enabled = m_sceneitem ? obs_sceneitem_visible(m_sceneitem) : obs_source_enabled(source);

source_profiler_fill_result(source, m_perf);

obs_source_release(source);
} else if (m_source) {
enabled = false;
Expand Down

0 comments on commit 567012c

Please sign in to comment.