Thread-safety
We're slowly hitting that point where:
- The majority of the codebase is stable enough to avoid rampant refactors
- We're hitting use cases that could benefit from thread safety (e.g. allocating GPU buffers cross-thread)
It might be time to think about making some objects in libplacebo explicitly thread safe. We don't need to go all the way straight away, we can do it in increments. Analogous to e.g. the way thread safety handles in vulkan, we'll presumably have objects that are marked as thread safe and objects that are not marked as such.
The major goal would be to make pl_gpu
thread-safe, since then we could do cross-thread pl_gpu
operations, as long as they don't violate thread safety on other objects (e.g. pl_tex
or pl_buf
). Ideally, pl_swapchain
should also be thread-safe. Other candidates for thread safety could be added as we find them, but for now, that would be the most major benefit.