87 int handle_refcount_ = 1;
111 return size_t(this->vertex_alloc) * this->format.
stride;
117 return size_t(this->vertex_len) * this->format.
stride;
128 if (handle_refcount_ == 0) {
148 virtual void read(
void *data)
const = 0;
164#define GPU_vertbuf_create_with_format(format) \
165 GPU_vertbuf_create_with_format_ex(format, GPU_USAGE_STATIC)
190#define GPU_vertbuf_init_with_format(verts, format) \
191 GPU_vertbuf_init_with_format_ex(verts, format, GPU_USAGE_STATIC)
249 unsigned char *data = a->data;
250 a->data += a->stride;
259 return ((a->data - a->data_init) / a->stride);
290#define GPU_VERTBUF_DISCARD_SAFE(verts) \
292 if (verts != nullptr) { \
293 GPU_vertbuf_discard(verts); \
#define ENUM_OPERATORS(_type, _max)
void GPU_vertbuf_attr_get_raw_data(blender::gpu::VertBuf *, uint a_idx, GPUVertBufRaw *access)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
void GPU_vertbuf_attr_fill_stride(blender::gpu::VertBuf *, uint a_idx, uint stride, const void *data)
void GPU_vertbuf_init_build_on_device(blender::gpu::VertBuf &verts, const GPUVertFormat &format, uint v_len)
blender::gpu::VertBuf * GPU_vertbuf_duplicate(blender::gpu::VertBuf *verts)
void GPU_vertbuf_vert_set(blender::gpu::VertBuf *verts, uint v_idx, const void *data)
void GPU_vertbuf_handle_ref_remove(blender::gpu::VertBuf *verts)
void GPU_vertbuf_use(blender::gpu::VertBuf *)
void GPU_vertbuf_data_resize(blender::gpu::VertBuf &verts, uint v_len)
void GPU_vertbuf_attr_fill(blender::gpu::VertBuf *, uint a_idx, const void *data)
blender::gpu::VertBuf * GPU_vertbuf_create_with_format_ex(const GPUVertFormat &format, GPUUsageType usage)
void GPU_vertbuf_tag_dirty(blender::gpu::VertBuf *verts)
void GPU_vertbuf_handle_ref_add(blender::gpu::VertBuf *verts)
void GPU_vertbuf_data_len_set(blender::gpu::VertBuf &verts, uint v_len)
void GPU_vertbuf_attr_set(blender::gpu::VertBuf *, uint a_idx, uint v_idx, const void *data)
@ GPU_VERTBUF_DATA_UPLOADED
void GPU_vertbuf_wrap_handle(blender::gpu::VertBuf *verts, uint64_t handle)
void GPU_vertbuf_read(const blender::gpu::VertBuf *verts, void *data)
uint GPU_vertbuf_get_memory_usage()
GPUVertBufStatus GPU_vertbuf_get_status(const blender::gpu::VertBuf *verts)
blender::gpu::VertBuf * GPU_vertbuf_calloc()
void GPU_vertbuf_clear(blender::gpu::VertBuf *verts)
const GPUVertFormat * GPU_vertbuf_get_format(const blender::gpu::VertBuf *verts)
GPU_INLINE uint GPU_vertbuf_raw_used(const GPUVertBufRaw *a)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
void GPU_vertbuf_bind_as_ssbo(blender::gpu::VertBuf *verts, int binding)
void GPU_vertbuf_update_sub(blender::gpu::VertBuf *verts, uint start, uint len, const void *data)
void GPU_vertbuf_init_with_format_ex(blender::gpu::VertBuf &verts, const GPUVertFormat &format, GPUUsageType)
void GPU_vertbuf_bind_as_texture(blender::gpu::VertBuf *verts, int binding)
uint GPU_vertbuf_get_vertex_len(const blender::gpu::VertBuf *verts)
void GPU_vertbuf_discard(blender::gpu::VertBuf *)
@ GPU_USAGE_FLAG_BUFFER_TEXTURE_ONLY
uint GPU_vertbuf_get_vertex_alloc(const blender::gpu::VertBuf *verts)
constexpr MutableSpan< NewT > cast() const
virtual void read(void *data) const =0
virtual void wrap_handle(uint64_t handle)=0
size_t size_used_get() const
size_t size_alloc_get() const
virtual void bind_as_ssbo(uint binding)=0
static size_t memory_usage
GPUUsageType extended_usage_
void resize(uint vert_len)
virtual void upload_data()=0
void allocate(uint vert_len)
GPUUsageType get_usage_type() const
virtual void duplicate_data(VertBuf *dst)=0
virtual void resize_data()=0
virtual void bind_as_texture(uint binding)=0
virtual void release_data()=0
virtual void acquire_data()=0
virtual void update_sub(uint start, uint len, const void *data)=0
unsigned __int64 uint64_t
unsigned char * data_init
unsigned char * _data_end