Blender
V3.3
|
#include <gpu_vertex_buffer_private.hh>
Public Member Functions | |
VertBuf () | |
virtual | ~VertBuf () |
void | init (const GPUVertFormat *format, GPUUsageType usage) |
void | clear () |
void | allocate (uint vert_len) |
void | resize (uint vert_len) |
void | upload () |
virtual void | bind_as_ssbo (uint binding)=0 |
virtual void | bind_as_texture (uint binding)=0 |
virtual void | wrap_handle (uint64_t handle)=0 |
VertBuf * | duplicate () |
size_t | size_alloc_get () const |
size_t | size_used_get () const |
void | reference_add () |
void | reference_remove () |
virtual void | update_sub (uint start, uint len, const void *data)=0 |
virtual const void * | read () const =0 |
virtual void * | unmap (const void *mapped_data) const =0 |
Public Attributes | |
GPUVertFormat | format = {} |
uint | vertex_len = 0 |
uint | vertex_alloc = 0 |
GPUVertBufStatus | flag = GPU_VERTBUF_INVALID |
uchar * | data = nullptr |
Static Public Attributes | |
static size_t | memory_usage = 0 |
Protected Member Functions | |
virtual void | acquire_data ()=0 |
virtual void | resize_data ()=0 |
virtual void | release_data ()=0 |
virtual void | upload_data ()=0 |
virtual void | duplicate_data (VertBuf *dst)=0 |
Protected Attributes | |
GPUUsageType | usage_ = GPU_USAGE_STATIC |
Implementation of Vertex Buffers. Base class which is then specialized for each implementation (GL, VK, ...).
Definition at line 20 of file gpu_vertex_buffer_private.hh.
blender::gpu::VertBuf::VertBuf | ( | ) |
Definition at line 29 of file gpu_vertex_buffer.cc.
|
virtual |
Definition at line 35 of file gpu_vertex_buffer.cc.
References BLI_assert, flag, and GPU_VERTBUF_INVALID.
|
protectedpure virtual |
Implemented in blender::gpu::GLVertBuf.
Referenced by allocate().
Definition at line 70 of file gpu_vertex_buffer.cc.
References acquire_data(), BLI_assert, data, flag, GPU_VERTBUF_DATA_DIRTY, vertex_alloc, and vertex_len.
Implemented in blender::gpu::GLVertBuf.
Implemented in blender::gpu::GLVertBuf.
void blender::gpu::VertBuf::clear | ( | ) |
Definition at line 52 of file gpu_vertex_buffer.cc.
References flag, GPU_VERTBUF_INVALID, and release_data().
VertBuf * blender::gpu::VertBuf::duplicate | ( | ) |
Definition at line 58 of file gpu_vertex_buffer.cc.
References duplicate_data(), blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::vertbuf_alloc().
Implemented in blender::gpu::GLVertBuf.
Referenced by duplicate().
void blender::gpu::VertBuf::init | ( | const GPUVertFormat * | format, |
GPUUsageType | usage | ||
) |
Definition at line 41 of file gpu_vertex_buffer.cc.
References flag, GPU_VERTBUF_DATA_DIRTY, GPU_VERTBUF_INIT, GPU_vertformat_copy(), usage_, and VertexFormat_pack().
|
pure virtual |
Implemented in blender::gpu::GLVertBuf.
|
inline |
Definition at line 73 of file gpu_vertex_buffer_private.hh.
|
inline |
Definition at line 77 of file gpu_vertex_buffer_private.hh.
References BLI_assert.
|
protectedpure virtual |
Implemented in blender::gpu::GLVertBuf.
Referenced by clear().
Definition at line 82 of file gpu_vertex_buffer.cc.
References BLI_assert, flag, GPU_VERTBUF_DATA_DIRTY, resize_data(), vertex_alloc, and vertex_len.
|
protectedpure virtual |
Implemented in blender::gpu::GLVertBuf.
Referenced by resize().
|
inline |
Definition at line 61 of file gpu_vertex_buffer_private.hh.
References BLI_assert, and vertex_alloc.
Referenced by blender::gpu::GLVertBuf::acquire_data(), and blender::gpu::GLVertBuf::resize_data().
|
inline |
Definition at line 67 of file gpu_vertex_buffer_private.hh.
References BLI_assert, and vertex_len.
Referenced by blender::gpu::GLVertBuf::bind().
Implemented in blender::gpu::GLVertBuf.
|
pure virtual |
Implemented in blender::gpu::GLVertBuf.
void blender::gpu::VertBuf::upload | ( | ) |
Definition at line 93 of file gpu_vertex_buffer.cc.
References upload_data().
|
protectedpure virtual |
Implemented in blender::gpu::GLVertBuf.
Referenced by upload().
Implemented in blender::gpu::GLVertBuf.
uchar* blender::gpu::VertBuf::data = nullptr |
NULL indicates data in VRAM (unmapped)
Definition at line 32 of file gpu_vertex_buffer_private.hh.
Referenced by blender::gpu::GLVertBuf::acquire_data(), allocate(), blender::gpu::GLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), blender::gpu::GLVertBuf::release_data(), blender::gpu::GLVertBuf::resize_data(), and blender::gpu::GLVertBuf::update_sub().
GPUVertBufStatus blender::gpu::VertBuf::flag = GPU_VERTBUF_INVALID |
Status flag.
Definition at line 30 of file gpu_vertex_buffer_private.hh.
Referenced by allocate(), blender::gpu::GLVertBuf::bind(), clear(), init(), resize(), blender::gpu::GLVertBuf::wrap_handle(), and ~VertBuf().
GPUVertFormat blender::gpu::VertBuf::format = {} |
Definition at line 24 of file gpu_vertex_buffer_private.hh.
Referenced by blender::gpu::GLVertArray::update_bindings().
|
static |
Definition at line 22 of file gpu_vertex_buffer_private.hh.
Referenced by blender::gpu::GLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), GPU_vertbuf_get_memory_usage(), and blender::gpu::GLVertBuf::release_data().
|
protected |
Usage hint for GL optimization.
Definition at line 36 of file gpu_vertex_buffer_private.hh.
Referenced by blender::gpu::GLVertBuf::acquire_data(), blender::gpu::GLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), init(), and blender::gpu::GLVertBuf::resize_data().
uint blender::gpu::VertBuf::vertex_alloc = 0 |
Number of verts data.
Definition at line 28 of file gpu_vertex_buffer_private.hh.
Referenced by allocate(), resize(), and size_alloc_get().
uint blender::gpu::VertBuf::vertex_len = 0 |
Number of verts we want to draw.
Definition at line 26 of file gpu_vertex_buffer_private.hh.
Referenced by allocate(), resize(), size_used_get(), and blender::gpu::GLVertArray::update_bindings().