24 if (!buffer_.is_allocated()) {
32 buffer_.update_render_graph(context, data_copy);
33 data_uploaded_ =
true;
37void VKUniformBuffer::allocate()
40 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
41 VK_BUFFER_USAGE_TRANSFER_DST_BIT,
42 VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE,
43 VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT,
50 if (!buffer_.is_allocated()) {
54 buffer_.clear(context, 0);
55 data_uploaded_ =
true;
60 if (!buffer_.is_allocated()) {
62 if (!buffer_.is_allocated()) {
64 "Unable to allocate uniform buffer [%s]. Most likely an out of memory issue.",
72 if (!data_uploaded_ && buffer_.is_mapped()) {
73 buffer_.update_immediately(
data_);
79 buffer_.update_render_graph(context, std::move(
data_));
82 data_uploaded_ =
true;
89 context.state_manager_get().uniform_buffer_bind(
this, slot);
95 context.state_manager_get().storage_buffer_bind(
102 if (context !=
nullptr) {
#define CLOG_ERROR(clg_ref,...)
BMesh const char void * data
VkBuffer vk_handle() const
bool create(size_t size, VkBufferUsageFlags buffer_usage, VmaMemoryUsage vma_memory_usage, VmaAllocationCreateFlags vma_allocation_flags, float priority, bool export_memory=false)
void uniform_buffer_unbind(VKUniformBuffer *uniform_buffer)
void storage_buffer_unbind(void *resource)
void * MEM_mallocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void object_label(GLenum type, GLuint object, const char *name)