To clear buffer data, call:
// Provided by VK_VERSION_1_0 void vkCmdFillBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data);
commandBufferis the command buffer into which the command will be recorded.
dstBufferis the buffer to be filled.
dstOffsetis the byte offset into the buffer at which to start filling, and must be a multiple of 4.
sizeis the number of bytes to fill, and must be either a multiple of 4, or
VK_WHOLE_SIZEto fill the range from
offsetto the end of the buffer. If
VK_WHOLE_SIZEis used and the remaining size of the buffer is not a multiple of 4, then the nearest smaller multiple is used.
datais the 4-byte word written repeatedly to the buffer to fill
sizebytes of data. The data word is written to memory according to the host endianness.
vkCmdFillBuffer is treated as “transfer” operation for the purposes
of synchronization barriers.
VK_BUFFER_USAGE_TRANSFER_DST_BIT must be specified in
of VkBufferCreateInfo in order for the buffer to be compatible with
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.