24 static void copyBuffer(
const VkBuffer *src, VkBuffer *dst, VkDeviceSize size)
29 VkBufferCopy copyRegion = {
34 vkCmdCopyBuffer(commandBuffer, *src, *dst, 1, ©Region);
48 VK_VERIFY(
QVk_CreateStagingBuffer(size, stgBuffer, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, VK_MEMORY_PROPERTY_HOST_CACHED_BIT));
56 memcpy(dst, data, (
size_t)size);
72 VkBufferCreateInfo bcInfo = {
73 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
77 .usage = options.
usage,
78 .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
79 .queueFamilyIndexCount = 0,
80 .pQueueFamilyIndices =
NULL,
87 bcInfo.sharingMode = VK_SHARING_MODE_CONCURRENT;
88 bcInfo.queueFamilyIndexCount = 2;
89 bcInfo.pQueueFamilyIndices = queueFamilies;
98 .pool = VK_NULL_HANDLE,
109 buffer->buffer = VK_NULL_HANDLE;
110 buffer->allocation = VK_NULL_HANDLE;
111 buffer->currentOffset = 0;
117 .
usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
118 .reqMemFlags = reqMemFlags,
119 .prefMemFlags = prefMemFlags,
130 .
usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
131 .reqMemFlags = reqMemFlags,
132 .prefMemFlags = prefMemFlags,
148 .
usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
149 .reqMemFlags = reqMemFlags,
150 .prefMemFlags = prefMemFlags,
161 .
usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
162 .reqMemFlags = reqMemFlags,
163 .prefMemFlags = prefMemFlags,