Blender  V2.93
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>

Inherited by blender::gpu::GLVertBuf.

Public Member Functions

 VertBuf ()
 
virtual ~VertBuf ()
 
void init (const GPUVertFormat *format, GPUUsageType usage)
 
void clear (void)
 
void allocate (uint vert_len)
 
void resize (uint vert_len)
 
void upload (void)
 
VertBufduplicate (void)
 
size_t size_alloc_get (void) const
 
size_t size_used_get (void) const
 
void reference_add (void)
 
void reference_remove (void)
 
virtual void update_sub (uint start, uint len, void *data)=0
 

Public Attributes

GPUVertFormat format = {}
 
uint vertex_len = 0
 
uint vertex_alloc = 0
 
GPUVertBufStatus flag = GPU_VERTBUF_INVALID
 
uchardata = NULL
 

Static Public Attributes

static size_t memory_usage = 0
 

Protected Member Functions

virtual void acquire_data (void)=0
 
virtual void resize_data (void)=0
 
virtual void release_data (void)=0
 
virtual void upload_data (void)=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 36 of file gpu_vertex_buffer_private.hh.

Constructor & Destructor Documentation

◆ VertBuf()

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

Definition at line 46 of file gpu_vertex_buffer.cc.

◆ ~VertBuf()

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

Definition at line 52 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 ( void  )
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by allocate().

◆ allocate()

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

◆ clear()

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

Definition at line 69 of file gpu_vertex_buffer.cc.

References flag, GPU_VERTBUF_INVALID, and release_data().

◆ duplicate()

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

◆ 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 
)

◆ reference_add()

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

Definition at line 85 of file gpu_vertex_buffer_private.hh.

◆ reference_remove()

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

Definition at line 89 of file gpu_vertex_buffer_private.hh.

References BLI_assert.

◆ release_data()

virtual void blender::gpu::VertBuf::release_data ( void  )
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 ( void  )
protectedpure virtual

Implemented in blender::gpu::GLVertBuf.

Referenced by resize().

◆ size_alloc_get()

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

◆ size_used_get()

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

◆ update_sub()

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

Implemented in blender::gpu::GLVertBuf.

◆ upload()

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

Definition at line 110 of file gpu_vertex_buffer.cc.

References upload_data().

◆ upload_data()

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

Implemented in blender::gpu::GLVertBuf.

Referenced by upload().

Member Data Documentation

◆ data

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

◆ flag

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

Status flag.

Definition at line 46 of file gpu_vertex_buffer_private.hh.

Referenced by allocate(), blender::gpu::GLVertBuf::bind(), clear(), init(), resize(), and ~VertBuf().

◆ 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

Usage hint for GL optimization.

Definition at line 52 of file gpu_vertex_buffer_private.hh.

Referenced by blender::gpu::GLVertBuf::bind(), blender::gpu::GLVertBuf::duplicate_data(), and init().

◆ vertex_alloc

uint blender::gpu::VertBuf::vertex_alloc = 0

Number of verts data.

Definition at line 44 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 42 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: