Blender V5.3
blender::gpu::VKVertexBuffer Class Reference

#include <vk_vertex_buffer.hh>

Inherits blender::gpu::VertBuf.

Public Member Functions

 ~VKVertexBuffer ()
void bind_as_ssbo (uint binding) override
void bind_as_texture (uint binding) override
void wrap_handle (uint64_t handle) override
void update_sub (uint start_offset, uint data_size_in_bytes, const void *data) override
void copy_sub (VertBuf &source_buf, uint source_first_vertex, uint dest_first_vertex, uint vertex_len) override
 Copy from part of source vertex buffer into the vertex buffer.
void read (void *data) const override
VkBuffer vk_handle () const
const VKResourceWithHandle< VkBuffer > & resource () const
bool has_device_address () const
VkDeviceAddress device_address_get () const
VkBufferView vk_buffer_view_get () const
void ensure_updated ()
void ensure_buffer_view ()
VkFormat to_vk_format ()
Public Member Functions inherited from blender::gpu::VertBuf
 VertBuf ()
virtual ~VertBuf ()
void init (const GPUVertFormat &format, GPUUsageType usage)
void clear ()
void allocate (uint vert_len)
void resize (uint vert_len)
void upload ()
size_t size_alloc_get () const
size_t size_used_get () const
void reference_add ()
void reference_remove ()
GPUUsageType get_usage_type () const
template<typename T>
MutableSpan< T > data ()

Protected Member Functions

void acquire_data () override
void resize_data () override
void release_data () override
void upload_data () override

Friends

class VKTexture

Additional Inherited Members

Static Public Member Functions inherited from blender::gpu::VertBuf
template<typename FormatT>
static VertBufPtr from_size_with_format (const int size, GPUUsageType usage=GPU_USAGE_STATIC)
template<typename T>
static VertBufPtr from_size (const int size, GPUUsageType usage=GPU_USAGE_STATIC)
template<typename T>
static VertBufPtr from_span (const Span< T > data)
template<typename T>
static VertBufPtr from_varray (const VArray< T > &array)
template<typename T>
static VertBufPtr device_only (uint size)
Public Attributes inherited from blender::gpu::VertBuf
GPUVertFormat format = {}
uint vertex_len = 0
uint vertex_alloc = 0
GPUVertBufStatus flag = GPU_VERTBUF_INVALID
GPUUsageType extended_usage_ = GPU_USAGE_STATIC
Static Public Attributes inherited from blender::gpu::VertBuf
static size_t memory_usage = 0
Protected Attributes inherited from blender::gpu::VertBuf
uchar * data_ = nullptr
GPUUsageType usage_ = GPU_USAGE_STATIC

Detailed Description

Definition at line 18 of file vk_vertex_buffer.hh.

Constructor & Destructor Documentation

◆ ~VKVertexBuffer()

blender::gpu::VKVertexBuffer::~VKVertexBuffer ( )

Definition at line 29 of file vk_vertex_buffer.cc.

References release_data().

Member Function Documentation

◆ acquire_data()

void blender::gpu::VKVertexBuffer::acquire_data ( )
overrideprotectedvirtual

◆ bind_as_ssbo()

void blender::gpu::VKVertexBuffer::bind_as_ssbo ( uint binding)
overridevirtual

◆ bind_as_texture()

void blender::gpu::VKVertexBuffer::bind_as_texture ( uint binding)
overridevirtual

◆ copy_sub()

void blender::gpu::VKVertexBuffer::copy_sub ( VertBuf & source_buf,
uint source_first_vertex,
uint dest_first_vertex,
uint vertex_len )
overridevirtual

Copy from part of source vertex buffer into the vertex buffer.

Note
: format of the vertex buffers should be identical.
: asserts when the copy range exceeds the used vertex range of either vertex buffer. Only that range is guaranteed to exist in the device buffer, the remainder of the allocated space is not uploaded by all backends.
: both vertex buffers must be uploaded to the GPU with GPU_vertbuf_use before calling.
Parameters
source_bufsource vertex buffer to copy data from.
source_first_vertexstarting vertex index to start copying the data from.
dest_first_vertexstarting vertex index to copy the data to.
vertex_lenthe number of vertices to copy.

Implements blender::gpu::VertBuf.

Definition at line 99 of file vk_vertex_buffer.cc.

References blender::BLI_assert(), BLI_assert_msg, blender::gpu::render_graph::VKCopyBufferData::dst_buffer, blender::gpu::VertBuf::format, blender::gpu::VKContext::get(), blender::gpu::VKBuffer::is_allocated(), blender::gpu::render_graph::VKCopyBufferData::region, blender::gpu::VKBuffer::resource(), blender::gpu::render_graph::VKCopyBufferData::src_buffer, blender::GPUVertFormat::stride, blender::gpu::unwrap(), blender::gpu::VertBuf::VertBuf(), and blender::gpu::VertBuf::vertex_len.

◆ device_address_get()

VkDeviceAddress blender::gpu::VKVertexBuffer::device_address_get ( ) const
inline

Definition at line 54 of file vk_vertex_buffer.hh.

Referenced by blender::gpu::VKBottomLevelAS::add_geometry().

◆ ensure_buffer_view()

◆ ensure_updated()

void blender::gpu::VKVertexBuffer::ensure_updated ( )

Definition at line 48 of file vk_vertex_buffer.cc.

References upload_data().

Referenced by blender::gpu::VKBottomLevelAS::add_geometry().

◆ has_device_address()

bool blender::gpu::VKVertexBuffer::has_device_address ( ) const
inline

Definition at line 49 of file vk_vertex_buffer.hh.

Referenced by blender::gpu::VKBottomLevelAS::add_geometry().

◆ read()

◆ release_data()

void blender::gpu::VKVertexBuffer::release_data ( )
overrideprotectedvirtual

Implements blender::gpu::VertBuf.

Definition at line 180 of file vk_vertex_buffer.cc.

References blender::gpu::VertBuf::data_.

Referenced by ~VKVertexBuffer().

◆ resize_data()

void blender::gpu::VKVertexBuffer::resize_data ( )
overrideprotectedvirtual

◆ resource()

const VKResourceWithHandle< VkBuffer > & blender::gpu::VKVertexBuffer::resource ( ) const
inline

◆ to_vk_format()

VkFormat blender::gpu::VKVertexBuffer::to_vk_format ( )
inline

◆ update_sub()

◆ upload_data()

◆ vk_buffer_view_get()

VkBufferView blender::gpu::VKVertexBuffer::vk_buffer_view_get ( ) const
inline

◆ vk_handle()

VkBuffer blender::gpu::VKVertexBuffer::vk_handle ( ) const
inline

Definition at line 40 of file vk_vertex_buffer.hh.

◆ wrap_handle()

void blender::gpu::VKVertexBuffer::wrap_handle ( uint64_t handle)
overridevirtual

Implements blender::gpu::VertBuf.

Definition at line 74 of file vk_vertex_buffer.cc.

References NOT_YET_IMPLEMENTED.

◆ VKTexture

friend class VKTexture
friend

Definition at line 86 of file vk_vertex_buffer.hh.

References VKTexture.

Referenced by VKTexture.


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