29 const bool allocate_new_buffer = !(host_buffer_.has_value() &&
31 host_buffer_.value().get()->size_in_bytes() - offset_);
32 if (allocate_new_buffer) {
33 host_buffer_.emplace(std::make_unique<VKBuffer>());
34 VKBuffer &host_buffer = *host_buffer_.value().get();
35 host_buffer.
create(vk_buffer_size_,
36 VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
37 VMA_MEMORY_USAGE_AUTO,
38 VMA_ALLOCATION_CREATE_MAPPED_BIT |
39 VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT,
45 copy_buffer_handle_ =
render_graph.add_node(copy_buffer);
47 VKBuffer &host_buffer = *host_buffer_.value().get();
49 VkDeviceSize start_offset = offset_;
53 if (min_offset_alignment_ > 1) {
58 static_cast<void *
>(
static_cast<uint8_t *
>(host_buffer.
mapped_memory_get()) + start_offset),
65 copy_buffer_data.
region.size += offset_ - start_offset;
bool create(size_t size, VkBufferUsageFlags buffer_usage, VmaMemoryUsage vma_memory_usage, VmaAllocationCreateFlags vma_allocation_flags, float priority, bool export_memory=false)