Blender V5.0
blender::opensubdiv::GPUVertexBuffer Class Reference

#include <gpu_vertex_buffer_wrapper.hh>

Public Member Functions

 GPUVertexBuffer (gpu::VertBuf &gpu_vertex_buffer, int element_count, bool use_update_sub)
 ~GPUVertexBuffer ()
 Destructor.
void UpdateData (const float *src, int start_vertex, int num_vertices, void *device_context=NULL)
int GetNumVertices () const
 Returns how many vertices allocated in this vertex buffer.
gpu::VertBufget_vertex_buffer ()

Static Public Member Functions

static GPUVertexBufferCreate (int element_count, int vertex_len, void *device_context=nullptr)

Detailed Description

GLVertexBuffer compatible API wrapped around a blender::gpu::VertBuf

The blender::gpu::VertBuf is owned by the wrapper. Vertex buffer is used as its API is able to wrap around SSBOs as well.

Definition at line 18 of file gpu_vertex_buffer_wrapper.hh.

Constructor & Destructor Documentation

◆ GPUVertexBuffer()

blender::opensubdiv::GPUVertexBuffer::GPUVertexBuffer ( gpu::VertBuf & gpu_vertex_buffer,
int element_count,
bool use_update_sub )
inline

Definition at line 28 of file gpu_vertex_buffer_wrapper.hh.

Referenced by Create().

◆ ~GPUVertexBuffer()

blender::opensubdiv::GPUVertexBuffer::~GPUVertexBuffer ( )
inline

Destructor.

Definition at line 80 of file gpu_vertex_buffer_wrapper.hh.

References GPU_vertbuf_discard().

Member Function Documentation

◆ Create()

GPUVertexBuffer * blender::opensubdiv::GPUVertexBuffer::Create ( int element_count,
int vertex_len,
void * device_context = nullptr )
inlinestatic

Create a new gpu::VertBuf wrapped in a GPUVertexBuffer.

Parameters
element_countNumber of elements per vertex
vertex_lenNumber of vertices
device_contextUnused.

Definition at line 43 of file gpu_vertex_buffer_wrapper.hh.

References assert, GPU_backend_get_type(), GPU_BACKEND_VULKAN, GPU_USAGE_DYNAMIC, GPU_vertbuf_calloc(), GPU_vertbuf_create_with_format_ex(), GPU_vertbuf_data_alloc(), GPU_vertbuf_init_build_on_device(), GPU_vertformat_attr_add(), GPU_vertformat_clear(), and GPUVertexBuffer().

◆ get_vertex_buffer()

◆ GetNumVertices()

int blender::opensubdiv::GPUVertexBuffer::GetNumVertices ( ) const
inline

Returns how many vertices allocated in this vertex buffer.

Definition at line 108 of file gpu_vertex_buffer_wrapper.hh.

References GPU_vertbuf_get_vertex_len().

◆ UpdateData()

void blender::opensubdiv::GPUVertexBuffer::UpdateData ( const float * src,
int start_vertex,
int num_vertices,
void * device_context = NULL )
inline

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

Definition at line 87 of file gpu_vertex_buffer_wrapper.hh.

References blender::MutableSpan< T >::data(), blender::MutableSpan< T >::drop_front(), float, GPU_vertbuf_tag_dirty(), GPU_vertbuf_update_sub(), and GPU_vertbuf_use().


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