xrtl
xrtl copied to clipboard
ES3: delay-create resources to avoid thread-locked contexts
Only need objects created when mapping, otherwise can be deferred until first use on the queue thread. Thinking:
- context has a single platform context for resource stuff (this is the 'root' share group context)
- queues have a context of their own
- swap chains have a context of their own
The context could then have a small thread that listens for requests to map/unmap buffers and delete objects, and creations happen delayed on first execution.
Pull #81 gets most of this done. Swiftshader has issues with multithreading (like, it has no thread safety at all >_>) so a mode that disables the present queue and does all GL actions on the primary queue would be a good workaround.