26 if (!buffer_.is_allocated()) {
34 buffer_.update_render_graph(context, data_copy);
35 data_uploaded_ =
true;
39void VKUniformBuffer::allocate()
42 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
43 VK_BUFFER_USAGE_TRANSFER_DST_BIT,
44 VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE,
45 VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT,
53 if (!buffer_.is_allocated()) {
57 buffer_.clear(context, 0);
58 data_uploaded_ =
true;
63 if (!buffer_.is_allocated()) {
65 if (!buffer_.is_allocated()) {
67 "Unable to allocate uniform buffer [%s]. Most likely an out of memory issue.",
75 if (!data_uploaded_ && buffer_.is_mapped()) {
76 buffer_.update_immediately(
data_);
82 buffer_.update_render_graph(context, std::move(
data_));
85 data_uploaded_ =
true;
92 context.state_manager_get().uniform_buffer_bind(
this, slot);
98 context.state_manager_get().storage_buffer_bind(
105 if (context !=
nullptr) {
#define CLOG_ERROR(clg_ref,...)
bool create(size_t size, VkBufferUsageFlags buffer_usage, VmaMemoryUsage vma_memory_usage, VmaAllocationCreateFlags vma_allocation_flags, float priority, bool export_memory=false, const char *debug_name="VKBuffer", size_t alignment=0)
void uniform_buffer_unbind(VKUniformBuffer *uniform_buffer)
void storage_buffer_unbind(void *resource)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void MEM_delete_void(void *vmemh)
BMesh const char void * data