Refactor: global dirty list
lordmauve opened this issue · comments
Daniel Pope commented
Various objects track their own dirty state. Then before drawing the engine crawls a reference tree to update all the things that need to be updated.
This is inefficient and also adds complexity. We could just maintain a global(ish) "dirty list" - probably actually a WeakSet - that objects add themselves to when they are dirty.
There needs to be some ordering involved in this: objects that are dirty in system memory need to get updated before buffers that are dirty get copied to the GPU.