26 size_t size_in_bytes_ = 0;
27 size_t alloc_size_in_bytes_ = 0;
29 VmaAllocation allocation_ = VK_NULL_HANDLE;
32 bool allocation_failed_ =
false;
35 void *mapped_memory_ =
nullptr;
37 VkDeviceAddress vk_device_address = 0;
50 VkBufferUsageFlags buffer_usage,
51 VmaMemoryUsage vma_memory_usage,
52 VmaAllocationCreateFlags vma_allocation_flags,
54 bool export_memory =
false,
55 const char *debug_name =
"VKBuffer",
56 size_t alignment = 0);
96 return size_in_bytes_;
101 return alloc_size_in_bytes_;
110 return resource_.vk_handle;
122 return vk_device_address;
127 return vk_device_address != 0;
161 return mapped_memory_;
166 return mapped_memory_ !=
nullptr;
171 return allocation_ != VK_NULL_HANDLE;
#define BLI_assert_msg(a, msg)
NonCopyable(const NonCopyable &other)=delete
void update_immediately(const void *data) const
bool is_allocated() const
VkDeviceAddress device_address_get() const
void read(VKContext &context, void *data) const
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, const char *debug_name="VKBuffer", size_t alignment=0)
const VKResourceWithHandle< VkBuffer > & resource() const
void read_async(VKContext &context, void *data)
int64_t allocated_size_in_bytes() const
void flush_mapped_memory()
VkDeviceMemory export_memory_get(size_t &memory_size)
void clear(VKContext &context, uint32_t clear_value)
void update_sub_immediately(size_t start_offset, size_t data_size, const void *data) const
void invalidate_mapped_memory()
void update_render_graph(VKContext &context, void *data) const
bool has_device_address() const
void async_flush_to_host(VKContext &context)
void * mapped_memory_get() const
int64_t size_in_bytes() const
BMesh const char void * data
VKResourceWithHandle< VkBuffer > buffer