'How to resize a device local VkBuffer?

Assume a host visible AND also device local VkDeviceMemory that is bound to a VkBuffer, acting as a vertex buffer. The bidirectional access properties of the memory makes it possible to "manipulate" the initial set of associated vertices post-initilization by simply memcpy'ing over the memory - that's fine. I like that.

But I am really confused on what would be "the flow" of practically resizing the vertex buffer? Let's apply it to a chunk of voxel terrain - to give a context: You destroy some terrain, resulting in less vertices than before. So what then?

Do you have to recreate the VkBuffer with a new size? That would screw up the binding in the render pass, wouldn't it? Do you have to re-record the whole command buffer then? Can you still use the same VkDeviceMemory? Do you have to reallocate the memory? It's... idk. I just need some direction of the broader concept.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source