Blender  V3.3
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
blender::gpu::VertBuf Class Referenceabstract

#include <gpu_vertex_buffer_private.hh>

Inheritance diagram for blender::gpu::VertBuf:
blender::gpu::GLVertBuf

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
 
VertBufduplicate ()
 
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 voidread () const =0
 
virtual voidunmap (const void *mapped_data) const =0
 

Public Attributes

GPUVertFormat format = {}
 
uint vertex_len = 0
 
uint vertex_alloc = 0
 
GPUVertBufStatus flag = GPU_VERTBUF_INVALID
 
uchardata = 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VertBuf()

blender::gpu::VertBuf::VertBuf ( )

Definition at line 29 of file gpu_vertex_buffer.cc.

◆ ~VertBuf()

blender::gpu::VertBuf::~VertBuf ( )
virtual

Definition at line 35 of file gpu_vertex_buffer.cc.

References BLI_assert, flag, and GPU_VERTBUF_INVALID.

Member Function Documentation

◆ acquire_data()

virtual void blender::gpu::VertBuf::acquire_data ( )
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by allocate().

◆ allocate()

void blender::gpu::VertBuf::allocate ( uint  vert_len)

◆ bind_as_ssbo()

virtual void blender::gpu::VertBuf::bind_as_ssbo ( uint  binding)
pure virtual

Implemented in blender::gpu::GLVertBuf.

◆ bind_as_texture()

virtual void blender::gpu::VertBuf::bind_as_texture ( uint  binding)
pure virtual

Implemented in blender::gpu::GLVertBuf.

◆ clear()

void blender::gpu::VertBuf::clear ( )

Definition at line 52 of file gpu_vertex_buffer.cc.

References flag, GPU_VERTBUF_INVALID, and release_data().

◆ duplicate()

VertBuf * blender::gpu::VertBuf::duplicate ( )

◆ duplicate_data()

virtual void blender::gpu::VertBuf::duplicate_data ( VertBuf dst)
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by duplicate().

◆ init()

void blender::gpu::VertBuf::init ( const GPUVertFormat format,
GPUUsageType  usage 
)

◆ read()

virtual const void* blender::gpu::VertBuf::read ( ) const
pure virtual

Implemented in blender::gpu::GLVertBuf.

◆ reference_add()

void blender::gpu::VertBuf::reference_add ( )
inline

Definition at line 73 of file gpu_vertex_buffer_private.hh.

◆ reference_remove()

void blender::gpu::VertBuf::reference_remove ( )
inline

Definition at line 77 of file gpu_vertex_buffer_private.hh.

References BLI_assert.

◆ release_data()

virtual void blender::gpu::VertBuf::release_data ( )
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by clear().

◆ resize()

void blender::gpu::VertBuf::resize ( uint  vert_len)

◆ resize_data()

virtual void blender::gpu::VertBuf::resize_data ( )
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by resize().

◆ size_alloc_get()

size_t blender::gpu::VertBuf::size_alloc_get ( ) const
inline

◆ size_used_get()

size_t blender::gpu::VertBuf::size_used_get ( ) const
inline

Definition at line 67 of file gpu_vertex_buffer_private.hh.

References BLI_assert, and vertex_len.

Referenced by blender::gpu::GLVertBuf::bind().

◆ unmap()

virtual void* blender::gpu::VertBuf::unmap ( const void mapped_data) const
pure virtual

Implemented in blender::gpu::GLVertBuf.

◆ update_sub()

virtual void blender::gpu::VertBuf::update_sub ( uint  start,
uint  len,
const void data 
)
pure virtual

Implemented in blender::gpu::GLVertBuf.

◆ upload()

void blender::gpu::VertBuf::upload ( )

Definition at line 93 of file gpu_vertex_buffer.cc.

References upload_data().

◆ upload_data()

virtual void blender::gpu::VertBuf::upload_data ( )
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by upload().

◆ wrap_handle()

virtual void blender::gpu::VertBuf::wrap_handle ( uint64_t  handle)
pure virtual

Implemented in blender::gpu::GLVertBuf.

Member Data Documentation

◆ data

uchar* blender::gpu::VertBuf::data = nullptr

◆ flag

GPUVertBufStatus blender::gpu::VertBuf::flag = GPU_VERTBUF_INVALID

◆ format

GPUVertFormat blender::gpu::VertBuf::format = {}

◆ memory_usage

size_t blender::gpu::VertBuf::memory_usage = 0
static

◆ usage_

GPUUsageType blender::gpu::VertBuf::usage_ = GPU_USAGE_STATIC
protected

◆ vertex_alloc

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().

◆ vertex_len

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().


The documentation for this class was generated from the following files: