google / xrtl

Cross-platform Real-Time Rendering Library
Apache License 2.0
128 stars 26 forks source link

ES3: delay-create resources to avoid thread-locked contexts #74

Open benvanik opened 7 years ago

benvanik commented 7 years ago

Only need objects created when mapping, otherwise can be deferred until first use on the queue thread. Thinking:

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.

benvanik commented 7 years ago

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.