28 if (!buffer_.is_allocated()) {
30 if (!buffer_.is_allocated()) {
31 CLOG_ERROR(&
LOG,
"Unable to allocate index buffer. Most likely an out of memory issue.");
36 if (
data_ ==
nullptr) {
40 if (!data_uploaded_ && buffer_.is_mapped()) {
41 buffer_.update_immediately(
data_);
53 buffer_.clear(context, 0u);
56 "Unable to upload data to index buffer via a staging buffer as the staging buffer "
57 "could not be allocated. Index buffer will be filled with on zeros to reduce "
58 "drawing artifacts due to read from uninitialized memory.");
59 buffer_.clear(context, 0u);
64 data_uploaded_ =
true;
75 src_->bind_as_ssbo(binding);
94 "Unable to read data from index buffer via a staging buffer as the staging buffer "
95 "could not be allocated. ");
104void VKIndexBuffer::strip_restart_indices()
109void VKIndexBuffer::allocate()
112 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT |
113 VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
114 VMA_MEMORY_USAGE_AUTO,
115 VmaAllocationCreateFlags(0),
120const VKBuffer &VKIndexBuffer::buffer_get()
const
124VKBuffer &VKIndexBuffer::buffer_get()
#define CLOG_ERROR(clg_ref,...)
BMesh const char void * data
void update_immediately(const void *data) const
bool is_allocated() 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)
VKStateManager & state_manager_get() const
void read(uint32_t *data) const override
void update_sub(uint start, uint len, const void *data) override
void upload_data() override
void bind_as_ssbo(uint binding) override
void copy_from_device(VKContext &context)
VKBuffer & host_buffer_get()
void copy_to_device(VKContext &context)
void storage_buffer_bind(BindSpaceStorageBuffers::Type resource_type, void *resource, int binding)
void object_label(GLenum type, GLuint object, const char *name)
static Context * unwrap(GPUContext *ctx)
#define NOT_YET_IMPLEMENTED