|
Blender V5.3
|
#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 |
Definition at line 18 of file vk_vertex_buffer.hh.
| blender::gpu::VKVertexBuffer::~VKVertexBuffer | ( | ) |
Definition at line 29 of file vk_vertex_buffer.cc.
References release_data().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 158 of file vk_vertex_buffer.cc.
References blender::gpu::VertBuf::data_, blender::GPU_USAGE_DEVICE_ONLY, blender::MEM_new_array_uninitialized(), blender::gpu::VertBuf::size_alloc_get(), and blender::gpu::VertBuf::usage_.
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 34 of file vk_vertex_buffer.cc.
References blender::gpu::VKContext::get(), blender::gpu::VKStateManager::storage_buffer_bind(), and blender::gpu::BindSpaceStorageBuffers::VertexBuffer.
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 41 of file vk_vertex_buffer.cc.
References blender::gpu::VKContext::get(), and blender::gpu::VKStateManager::texel_buffer_bind().
|
overridevirtual |
Copy from part of source vertex buffer into the vertex buffer.
| source_buf | source vertex buffer to copy data from. |
| source_first_vertex | starting vertex index to start copying the data from. |
| dest_first_vertex | starting vertex index to copy the data to. |
| vertex_len | the 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.
|
inline |
Definition at line 54 of file vk_vertex_buffer.hh.
Referenced by blender::gpu::VKBottomLevelAS::add_geometry().
| void blender::gpu::VKVertexBuffer::ensure_buffer_view | ( | ) |
Definition at line 53 of file vk_vertex_buffer.cc.
References blender::BLI_assert(), blender::gpu::VKBackend::device, blender::gpu::VKDevice::functions, blender::gpu::VKBackend::get(), blender::gpu::debug::object_label(), blender::gpu::render_graph::VKResourceStateTracker::register_view(), blender::gpu::VKDevice::resources, to_vk_format(), and blender::gpu::VKDevice::vk_handle().
Referenced by blender::gpu::VKDescriptorSetPoolUpdator::bind_texel_buffer().
| 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().
|
inline |
Definition at line 49 of file vk_vertex_buffer.hh.
Referenced by blender::gpu::VKBottomLevelAS::add_geometry().
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 133 of file vk_vertex_buffer.cc.
References CLOG_ERROR, blender::gpu::VKStagingBuffer::copy_from_device(), blender::gpu::VertBuf::data(), blender::gpu::VKStagingBuffer::DeviceToHost, blender::gpu::VKContext::get(), blender::gpu::VKStagingBuffer::host_buffer_get(), blender::gpu::VKBuffer::is_mapped(), blender::LOG, and blender::gpu::VKBuffer::read().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 180 of file vk_vertex_buffer.cc.
References blender::gpu::VertBuf::data_.
Referenced by ~VKVertexBuffer().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 170 of file vk_vertex_buffer.cc.
References blender::gpu::VertBuf::data_, blender::GPU_USAGE_DEVICE_ONLY, MEM_realloc_uninitialized, blender::gpu::VertBuf::size_alloc_get(), and blender::gpu::VertBuf::usage_.
|
inline |
Definition at line 44 of file vk_vertex_buffer.hh.
Referenced by blender::gpu::VKBottomLevelAS::add_geometry(), and blender::gpu::VKStorageBuffer::copy_sub().
|
inline |
Definition at line 68 of file vk_vertex_buffer.hh.
References blender::gpu::VertBuf::format, blender::gpu::to_texture_format(), and blender::gpu::to_vk_format().
Referenced by blender::gpu::VKBottomLevelAS::add_geometry(), and ensure_buffer_view().
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 79 of file vk_vertex_buffer.cc.
References BLI_assert_msg, blender::gpu::VKStagingBuffer::copy_to_device(), blender::gpu::VertBuf::data(), blender::gpu::VKContext::get(), blender::gpu::VKStagingBuffer::host_buffer_get(), blender::gpu::VKStagingBuffer::HostToDevice, and blender::gpu::VKBuffer::mapped_memory_get().
|
overrideprotectedvirtual |
Implements blender::gpu::VertBuf.
Definition at line 208 of file vk_vertex_buffer.cc.
References CLOG_ERROR, blender::gpu::VertBuf::data_, ELEM, blender::gpu::VertBuf::flag, blender::gpu::VKContext::get(), blender::GPU_USAGE_DYNAMIC, blender::GPU_USAGE_STATIC, blender::GPU_USAGE_STREAM, blender::GPU_VERTBUF_DATA_DIRTY, blender::GPU_VERTBUF_DATA_UPLOADED, blender::LOG, and blender::gpu::VertBuf::usage_.
Referenced by ensure_updated().
|
inline |
Definition at line 59 of file vk_vertex_buffer.hh.
References blender::BLI_assert().
Referenced by blender::gpu::VKDescriptorSetPoolUpdator::bind_texel_buffer().
|
inline |
Definition at line 40 of file vk_vertex_buffer.hh.
|
overridevirtual |
Implements blender::gpu::VertBuf.
Definition at line 74 of file vk_vertex_buffer.cc.
References NOT_YET_IMPLEMENTED.
|
friend |