#[SOLVED] Will changing the memory binding of a VkBuffer or VkImage invalidate command buffers?

9 messages · Page 1 of 1 (latest)

fading sparrow
#

It is clear that destroying either of these objects will invalidate a Command Buffer in the pending state, per 3.3.1. Object Lifetime.

However, it's not clear to me the relationship of VkDeviceMemory binds to these objects. Are there any restrictions on memory binding with recording, executable or pending command buffers?

Context: I want to use a persistent (named) VkBuffer but double-buffer its memory binding every frame for streaming data.

compact nymph
#

you are describing an impossible situation

VUID-vkBindBufferMemory-buffer-07459
buffer must not have been bound to a memory object

VUID-VkWriteDescriptorSet-descriptorType-00329
If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, and the buffer member of any element of pBufferInfo is the handle of a non-sparse buffer, then that buffer must be bound completely and contiguously to a single VkDeviceMemory object

VUID-vkCmdCopyBuffer-srcBuffer-00119
If srcBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

VUID-vkCmdCopyBuffer-dstBuffer-00121
If dstBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

fading sparrow
#

So, for example if I write a uniform buffer descriptor in recording frame 1 using VkBuffer A bound to memory B, then during recording frame 2, unbind and bind VkBuffer A to memory C while frame 1's command buffer is still pending, this is not an error?

compact nymph
#

and you can only bind if it's not already bound

#

so your situation is impossible

fading sparrow
#

ohh. so I have to create a whole different buffer object

compact nymph
#

yes

fading sparrow
#

gotcha, thanks