Anecoz / AneRend

Prototyping Vulkan engine
16 stars 1 forks source link

Put VulkanRenderer-internal things into fixed size arrays #23

Open Anecoz opened 1 year ago

Anecoz commented 1 year ago

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.