Today, internal assets/renderables etc. are kept in std::vectors in VulkanRenderer. These objects then need to be synced to the GPU. The index in the vector is important because it is used on the GPU.
When for instancing removing a material, all renderables that reference a material need to re-do their index list since the vector is resized.
Avoid this by keeping everything in fixed-size std::arrays and use a BufferMemoryInterface to find empty indices. The index should then be persistent even when removing items from the arrays.
Today, internal assets/renderables etc. are kept in std::vectors in VulkanRenderer. These objects then need to be synced to the GPU. The index in the vector is important because it is used on the GPU.
When for instancing removing a material, all renderables that reference a material need to re-do their index list since the vector is resized.
Avoid this by keeping everything in fixed-size std::arrays and use a BufferMemoryInterface to find empty indices. The index should then be persistent even when removing items from the arrays.