Off-World-Live / obs-spout2-plugin

A Plugin for OBS Studio to enable Spout2 (https://github.com/leadedge/Spout2) input / output
https://knowledge.offworld.live/en/spout-plugin-for-obs-studio
GNU General Public License v2.0
569 stars 54 forks source link

Use SendTexture to lower the overhead of the spout filter #46

Closed y2kcyborg closed 2 years ago

y2kcyborg commented 2 years ago

These changes replace some GPU->CPU and CPU->GPU copies with on-GPU copies and conversions, lowering the overhead of the spout filter and hopefully addressing #42 . In my test setup the render time went from around 5.5ms to 0.3ms with two spout filters active.

I've fixed the issues I found in my own limited testing, but others may remain. There may also be further improvements possible to the rendering.

Anecdotally, this might also resolve a crash on exit when using the spout filter, although I can't reproduce it 100% on master.

y2kcyborg commented 2 years ago

Thanks for taking a look! I've tidied up and rebased as you asked.