Skip to content

libobs: skip redundant scene renders when no source is output-filtered - #14

Draft
BlueCheeseburger wants to merge 10000 commits into
masterfrom
fix/video-output-filter-perf-v2
Draft

BlueCheeseburger wants to merge 10000 commits into
masterfrom
fix/video-output-filter-perf-v2

Conversation

@BlueCheeseburger

Copy link
Copy Markdown
Owner

Replaces #12 (re-authored commits so they show as Verified on GitHub).

Summary

  • Adds output_filtered_count atomic counter to obs_core_video that tracks how many sources currently have a non-zero output_filter set
  • When the counter is zero (no sources are stream/record filtered), can_reuse_mix_texture() allows the stream and record mixes to reuse the main mix's rendered texture — eliminating the 3× render cost regression
  • Counter is maintained at all lifecycle sites: obs_source_set_output_filter, obs_source_destroy, obs_source_duplicate, and the scene-collection load path in obs.c

Test plan

  • With no sources filtered: confirm stream/record mixes reuse main mix texture (GPU render stays ~1×)
  • With at least one source set to Stream Only or Record Only: confirm stream and record mixes render independently
  • Source set to Record Only should be invisible in stream output and visible in recording
  • Source set to Stream Only should be invisible in recording and visible in stream output
  • Toggling a source filter off (back to All) decrements counter; when last filtered source cleared, reuse kicks back in

https://claude.ai/code/session_01RLn9mhsc56Y5D3esVH9WWN


Generated by Claude Code

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.