Blender V5.0
blender::gpu::StorageBuf Class Referenceabstract

#include <gpu_storage_buffer_private.hh>

Inherited by blender::gpu::GLStorageBuf, blender::gpu::MTLStorageBuf, and blender::gpu::VKStorageBuffer.

Public Member Functions

 StorageBuf (size_t size, const char *name)
virtual ~StorageBuf ()
void usage_size_set (size_t size)
size_t usage_size_get () const
virtual void update (const void *data)=0
virtual void bind (int slot)=0
virtual void unbind ()=0
virtual void clear (uint32_t clear_value)=0
virtual void copy_sub (VertBuf *src, uint dst_offset, uint src_offset, uint copy_size)=0
virtual void read (void *data)=0
virtual void async_flush_to_host ()=0
virtual void sync_as_indirect_buffer ()=0

Protected Attributes

size_t size_in_bytes_ = -1
size_t usage_size_in_bytes_ = -1
void * data_ = nullptr
char name_ [DEBUG_NAME_LEN] = {}

Detailed Description

Implementation of Storage Buffers. Base class which is then specialized for each implementation (GL, VK, ...).

Definition at line 28 of file gpu_storage_buffer_private.hh.

Constructor & Destructor Documentation

◆ StorageBuf()

◆ ~StorageBuf()

blender::gpu::StorageBuf::~StorageBuf ( )
virtual

Definition at line 36 of file gpu_storage_buffer.cc.

References data_, and MEM_SAFE_FREE.

Member Function Documentation

◆ async_flush_to_host()

virtual void blender::gpu::StorageBuf::async_flush_to_host ( )
pure virtual

◆ bind()

virtual void blender::gpu::StorageBuf::bind ( int slot)
pure virtual

◆ clear()

virtual void blender::gpu::StorageBuf::clear ( uint32_t clear_value)
pure virtual

◆ copy_sub()

virtual void blender::gpu::StorageBuf::copy_sub ( VertBuf * src,
uint dst_offset,
uint src_offset,
uint copy_size )
pure virtual

◆ read()

virtual void blender::gpu::StorageBuf::read ( void * data)
pure virtual

◆ sync_as_indirect_buffer()

virtual void blender::gpu::StorageBuf::sync_as_indirect_buffer ( )
pure virtual

◆ unbind()

virtual void blender::gpu::StorageBuf::unbind ( )
pure virtual

◆ update()

virtual void blender::gpu::StorageBuf::update ( const void * data)
pure virtual

◆ usage_size_get()

size_t blender::gpu::StorageBuf::usage_size_get ( ) const
inline

Definition at line 42 of file gpu_storage_buffer_private.hh.

References usage_size_in_bytes_.

◆ usage_size_set()

void blender::gpu::StorageBuf::usage_size_set ( size_t size)

Definition at line 41 of file gpu_storage_buffer.cc.

References BLI_assert, size_in_bytes_, and usage_size_in_bytes_.

Referenced by GPU_storagebuf_usage_size_set().

Member Data Documentation

◆ data_

void* blender::gpu::StorageBuf::data_ = nullptr
protected

Continuous memory block to copy to GPU. This data is owned by the StorageBuf.

Definition at line 34 of file gpu_storage_buffer_private.hh.

Referenced by blender::gpu::GLStorageBuf::bind(), blender::gpu::MTLStorageBuf::bind(), blender::gpu::MTLStorageBuf::get_metal_buffer(), and ~StorageBuf().

◆ name_

◆ size_in_bytes_

size_t blender::gpu::StorageBuf::size_in_bytes_ = -1
protected

◆ usage_size_in_bytes_

size_t blender::gpu::StorageBuf::usage_size_in_bytes_ = -1
protected

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