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

#include <gpu_uniform_buffer_private.hh>

Inheritance diagram for blender::gpu::UniformBuf:
blender::gpu::GLUniformBuf blender::gpu::MTLUniformBuf

Public Member Functions

 UniformBuf (size_t size, const char *name)
 
virtual ~UniformBuf ()
 
virtual void update (const void *data)=0
 
virtual void bind (int slot)=0
 
virtual void unbind ()=0
 
void attach_data (void *data)
 

Protected Attributes

size_t size_in_bytes_
 
voiddata_ = nullptr
 
char name_ [DEBUG_NAME_LEN]
 

Detailed Description

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

Definition at line 27 of file gpu_uniform_buffer_private.hh.

Constructor & Destructor Documentation

◆ UniformBuf()

blender::gpu::UniformBuf::UniformBuf ( size_t  size,
const char *  name 
)

Definition at line 28 of file gpu_uniform_buffer.cc.

References BLI_assert, BLI_strncpy(), name_, size(), and size_in_bytes_.

◆ ~UniformBuf()

blender::gpu::UniformBuf::~UniformBuf ( )
virtual

Definition at line 38 of file gpu_uniform_buffer.cc.

References data_, and MEM_SAFE_FREE.

Member Function Documentation

◆ attach_data()

void blender::gpu::UniformBuf::attach_data ( void data)
inline

Used to defer data upload at drawing time. This is useful if the thread has no context bound. This transfers ownership to this UniformBuf.

Definition at line 47 of file gpu_uniform_buffer_private.hh.

References data, and data_.

Referenced by GPU_uniformbuf_create_from_list().

◆ bind()

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

◆ unbind()

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

◆ update()

virtual void blender::gpu::UniformBuf::update ( const void data)
pure virtual

Member Data Documentation

◆ data_

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

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

Definition at line 32 of file gpu_uniform_buffer_private.hh.

Referenced by attach_data(), blender::gpu::MTLUniformBuf::bind(), blender::gpu::GLUniformBuf::bind(), and ~UniformBuf().

◆ name_

char blender::gpu::UniformBuf::name_[DEBUG_NAME_LEN]
protected

◆ size_in_bytes_

size_t blender::gpu::UniformBuf::size_in_bytes_
protected

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