Currently when loading a scene, the size of things necessary to upload to the GPU can be quite large. Also, currently all stuff that needs uploading will just loop through and execute in 1 single frame. Especially materials will be very big.
This causes the staging buffer to currently be way too big to be able to handle this.
A better way would be to have an upload queue similar to the deletion queue, which can then upload a maximum number of bytes per frame. This should allow us to drastically reduce the staging buffer size.
Care has to be taken that e.g. renderables that use a specific material are not added/used until the material actually has been uploaded.
Added an upload queue that deals with models (meshes) and textures for now. Could and probably should be expanded to deal with materials and other things aswell.
Currently when loading a scene, the size of things necessary to upload to the GPU can be quite large. Also, currently all stuff that needs uploading will just loop through and execute in 1 single frame. Especially materials will be very big. This causes the staging buffer to currently be way too big to be able to handle this.
A better way would be to have an upload queue similar to the deletion queue, which can then upload a maximum number of bytes per frame. This should allow us to drastically reduce the staging buffer size.
Care has to be taken that e.g. renderables that use a specific material are not added/used until the material actually has been uploaded.