|
Blender V5.3
|
#include <GPU_index_buffer.hh>
Inherited by blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Public Member Functions | |
| IndexBuf () | |
| virtual | ~IndexBuf () |
| void | init (uint indices_len, uint32_t *indices, uint min_index, uint max_index, GPUPrimType prim_type, bool uses_restart_indices) |
| void | init_subrange (IndexBuf *elem_src, uint start, uint length) |
| void | init_build_on_device (uint index_len) |
| uint32_t | index_len_get () const |
| uint32_t | index_start_get () const |
| uint32_t | index_base_get () const |
| bool | is_32bit () const |
| GPUIndexBufType | index_type () const |
| size_t | size_get () const |
| bool | is_init () const |
| virtual void | upload_data ()=0 |
| virtual void | bind_as_ssbo (uint binding)=0 |
| virtual void | read (uint32_t *data) const =0 |
| virtual void | update_sub (uint start, uint len, const void *data)=0 |
| virtual void | copy_sub (IndexBuf &source_buf, uint source_first_index, uint dest_first_index, uint index_len)=0 |
| Copy part of source index buffer into this index buffer. | |
Protected Attributes | |
| GPUIndexBufType | index_type_ = GPU_INDEX_U32 |
| uint32_t | index_start_ = 0 |
| uint32_t | index_len_ = 0 |
| uint32_t | index_base_ = 0 |
| bool | is_init_ = false |
| bool | is_subrange_ = false |
| bool | is_empty_ = false |
| union blender::gpu::IndexBuf:: { ... } | |
Base class which is then specialized for each implementation (GL, VK, ...).
Definition at line 42 of file GPU_index_buffer.hh.
|
inline |
Definition at line 67 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::copy_sub(), copy_sub(), blender::gpu::MTLIndexBuf::copy_sub(), blender::gpu::VKIndexBuffer::copy_sub(), init_subrange(), and blender::gpu::MTLIndexBuf::MTLStorageBuf.
|
virtual |
Definition at line 292 of file gpu_index_buffer.cc.
References is_subrange_.
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Referenced by blender::GPU_indexbuf_bind_as_ssbo().
|
pure virtual |
Copy part of source index buffer into this index buffer.
| source_buf | source index buffer to copy data from. |
| source_first_index | starting index to start copying the data from. |
| dest_first_index | starting index to copy the data to. |
| index_len | the number of indices to copy. |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
References IndexBuf().
Referenced by blender::GPU_indexbuf_copy_sub().
|
inline |
Definition at line 90 of file GPU_index_buffer.hh.
References index_base_.
Referenced by blender::gpu::MTLBottomLevelAS::add_geometry(), blender::gpu::VKBottomLevelAS::add_geometry(), and blender::gpu::VKBatch::draw().
|
inline |
Definition at line 80 of file GPU_index_buffer.hh.
References index_len_, and is_empty_.
Referenced by blender::gpu::MTLBottomLevelAS::add_geometry(), and blender::gpu::VKBottomLevelAS::add_geometry().
|
inline |
Definition at line 86 of file GPU_index_buffer.hh.
References index_start_.
Referenced by blender::gpu::MTLBottomLevelAS::add_geometry(), blender::gpu::VKBottomLevelAS::add_geometry(), and blender::gpu::VKBatch::draw().
|
inline |
Definition at line 98 of file GPU_index_buffer.hh.
References index_type_.
Referenced by blender::gpu::MTLBottomLevelAS::add_geometry().
| void blender::gpu::IndexBuf::init | ( | uint | indices_len, |
| uint32_t * | indices, | ||
| uint | min_index, | ||
| uint | max_index, | ||
| GPUPrimType | prim_type, | ||
| bool | uses_restart_indices ) |
Definition at line 299 of file gpu_index_buffer.cc.
References blender::GPU_BACKEND_METAL, blender::GPU_DEVICE_ANY, blender::GPU_DRIVER_ANY, blender::gpu::GPU_INDEX_U16, blender::GPU_OS_MAC, blender::GPU_PRIM_POINTS, blender::GPU_type_matches_ex(), index_len_, index_start_, index_type_, is_empty_, and is_init_.
Referenced by blender::GPU_indexbuf_build_in_place(), and blender::GPU_indexbuf_build_in_place_ex().
| void blender::gpu::IndexBuf::init_build_on_device | ( | uint | index_len | ) |
Definition at line 352 of file gpu_index_buffer.cc.
References blender::gpu::GPU_INDEX_U32, index_len_, index_start_, index_type_, and is_init_.
Referenced by blender::GPU_indexbuf_init_build_on_device().
Definition at line 361 of file gpu_index_buffer.cc.
References blender::BLI_assert(), index_base_, index_len_, index_start_, index_type_, IndexBuf(), is_init_, is_subrange_, length(), and length().
Referenced by blender::GPU_indexbuf_create_subrange_in_place().
|
inline |
Definition at line 94 of file GPU_index_buffer.hh.
References blender::gpu::GPU_INDEX_U32, and index_type_.
Referenced by blender::gpu::MTLBottomLevelAS::add_geometry(), and blender::gpu::VKBottomLevelAS::add_geometry().
|
inline |
Definition at line 108 of file GPU_index_buffer.hh.
References is_init_.
Referenced by blender::GPU_indexbuf_is_init().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
References blender::data.
Referenced by blender::GPU_indexbuf_read().
|
inline |
Definition at line 103 of file GPU_index_buffer.hh.
References index_len_, index_type_, and blender::gpu::to_bytesize().
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::GLIndexBuf::read(), blender::gpu::MTLIndexBuf::read(), blender::gpu::MTLIndexBuf::update_sub(), and blender::gpu::MTLIndexBuf::upload_data().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
References blender::data, and len().
Referenced by blender::GPU_indexbuf_update_sub().
|
pure virtual |
Implemented in blender::gpu::GLIndexBuf, blender::gpu::MTLIndexBuf, and blender::gpu::VKIndexBuffer.
Referenced by blender::GPU_indexbuf_use().
| union { ... } blender::gpu::IndexBuf |
|
protected |
Base index: Added to all indices after fetching. Allows index compression.
Definition at line 51 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLBatch::draw(), index_base_get(), and init_subrange().
|
protected |
Number of indices to render.
Definition at line 49 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::copy_sub(), blender::gpu::MTLIndexBuf::copy_sub(), blender::gpu::VKIndexBuffer::copy_sub(), blender::gpu::MTLIndexBuf::get_index_buffer(), index_len_get(), init(), init_build_on_device(), init_subrange(), and size_get().
|
protected |
Offset in this buffer to the first index to render. Is 0 if not a subrange.
Definition at line 47 of file GPU_index_buffer.hh.
Referenced by index_start_get(), init(), init_build_on_device(), init_subrange(), and blender::gpu::GLIndexBuf::offset_ptr().
|
protected |
Type of indices used inside this buffer.
Definition at line 45 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::copy_sub(), blender::gpu::MTLIndexBuf::copy_sub(), blender::gpu::VKIndexBuffer::copy_sub(), blender::gpu::GLBatch::draw(), blender::gpu::GLBatch::draw_indirect(), blender::gpu::MTLIndexBuf::get_index_buffer(), index_type(), init(), init_build_on_device(), init_subrange(), is_32bit(), blender::gpu::GLBatch::multi_draw_indirect(), blender::gpu::GLIndexBuf::offset_ptr(), blender::gpu::GLIndexBuf::restart_index(), size_get(), and blender::gpu::VKIndexBuffer::vk_index_type().
|
protected |
True if buffer only contains restart indices.
Definition at line 57 of file GPU_index_buffer.hh.
Referenced by index_len_get(), and init().
|
protected |
Bookkeeping.
Definition at line 53 of file GPU_index_buffer.hh.
Referenced by init(), init_build_on_device(), init_subrange(), and is_init().
|
protected |
Is this object only a reference to a subrange of another IndexBuf.
Definition at line 55 of file GPU_index_buffer.hh.
Referenced by blender::gpu::GLIndexBuf::bind(), blender::gpu::GLIndexBuf::bind_as_ssbo(), blender::gpu::VKIndexBuffer::bind_as_ssbo(), blender::gpu::GLIndexBuf::copy_sub(), blender::gpu::MTLIndexBuf::copy_sub(), blender::gpu::VKIndexBuffer::copy_sub(), blender::gpu::VKIndexBuffer::ensure_updated(), blender::gpu::MTLIndexBuf::get_index_buffer(), init_subrange(), blender::gpu::MTLIndexBuf::update_sub(), blender::gpu::MTLIndexBuf::upload_data(), ~IndexBuf(), and blender::gpu::MTLIndexBuf::~MTLIndexBuf().