Măcelaru Tiberiu
Măcelaru Tiberiu

Reputation: 345

Is it possible to change a VkBuffer's size?

How do you grow a VkBuffer's size, as in the VkBufferCreateInfo.size ? Should I destroy the buffer and make a new one or can I just bind more memory by calling vkBindBufferMemory ?

Upvotes: 1

Views: 652

Answers (1)

ratchet freak
ratchet freak

Reputation: 48196

Once a buffer is created the size is fixed for the lifetime of the vkBuffer. Once memory has been bound to a buffer that binding is set for the remaining lifetime of the vkBuffer. Even if you free the backing vkMemory, the buffer becomes unusable.

So yes you have to create a new vkBuffer to change either of these properties.

Upvotes: 5

Related Questions