#include <host_buffer.h>
|
| using | EmplaceProc = std::function< void(uint8_t *buffer)> |
| |
|
| virtual | ~HostBuffer () |
| |
| void | SetLabel (std::string label) |
| |
| template<class UniformType , class = std::enable_if_t<std::is_standard_layout_v<UniformType>>> |
| BufferView | EmplaceUniform (const UniformType &uniform) |
| | Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirements are respected. More...
|
| |
| template<class StorageBufferType , class = std::enable_if_t<std::is_standard_layout_v<StorageBufferType>>> |
| BufferView | EmplaceStorageBuffer (const StorageBufferType &buffer) |
| | Emplace storage buffer data onto the host buffer. Ensure that backend specific uniform alignment requirements are respected. More...
|
| |
| template<class BufferType , class = std::enable_if_t<std::is_standard_layout_v<BufferType>>> |
| BufferView | Emplace (const BufferType &buffer) |
| | Emplace non-uniform data (like contiguous vertices) onto the host buffer. More...
|
| |
| BufferView | Emplace (const void *buffer, size_t length, size_t align) |
| |
| BufferView | Emplace (size_t length, size_t align, const EmplaceProc &cb) |
| | Emplaces undefined data onto the managed buffer and gives the caller a chance to update it using the specified callback. The buffer is guaranteed to have enough space for length bytes. It is the responsibility of the caller to not exceed the bounds of the buffer returned in the EmplaceProc. More...
|
| |
| void | Reset () |
| | Resets the contents of the HostBuffer to nothing so it can be reused. More...
|
| |
| size_t | GetSize () const |
| | Returns the capacity of the HostBuffer in memory in bytes. More...
|
| |
| size_t | GetLength () const |
| | Returns the size of the currently allocated HostBuffer memory in bytes. More...
|
| |
| virtual | ~Buffer () |
| |
Definition at line 20 of file host_buffer.h.
◆ EmplaceProc
◆ ~HostBuffer()
| impeller::HostBuffer::~HostBuffer |
( |
| ) |
|
|
virtualdefault |
◆ Create()
| std::shared_ptr< HostBuffer > impeller::HostBuffer::Create |
( |
| ) |
|
|
static |
◆ Emplace() [1/3]
template<class BufferType , class = std::enable_if_t<std::is_standard_layout_v<BufferType>>>
| BufferView impeller::HostBuffer::Emplace |
( |
const BufferType & |
buffer | ) |
|
|
inline |
◆ Emplace() [2/3]
| BufferView impeller::HostBuffer::Emplace |
( |
const void * |
buffer, |
|
|
size_t |
length, |
|
|
size_t |
align |
|
) |
| |
Definition at line 30 of file host_buffer.cc.
33 auto [device_buffer, range] = state_->Emplace(buffer, length, align);
37 return BufferView{state_, device_buffer, range};
◆ Emplace() [3/3]
Emplaces undefined data onto the managed buffer and gives the caller a chance to update it using the specified callback. The buffer is guaranteed to have enough space for length bytes. It is the responsibility of the caller to not exceed the bounds of the buffer returned in the EmplaceProc.
- Parameters
-
| [in] | cb | A callback that will be passed a ptr to the underlying host buffer. |
- Returns
- The buffer view.
Definition at line 48 of file host_buffer.cc.
51 auto [buffer, range] = state_->Emplace(length, align, cb);
55 return BufferView{state_, buffer, range};
◆ EmplaceStorageBuffer()
template<class StorageBufferType , class = std::enable_if_t<std::is_standard_layout_v<StorageBufferType>>>
| BufferView impeller::HostBuffer::EmplaceStorageBuffer |
( |
const StorageBufferType & |
buffer | ) |
|
|
inline |
Emplace storage buffer data onto the host buffer. Ensure that backend specific uniform alignment requirements are respected.
- Parameters
-
| [in] | uniform | The storage buffer to emplace onto the buffer. |
- Template Parameters
-
| StorageBufferType | The type of the shader storage buffer. |
- Returns
- The buffer view.
Definition at line 63 of file host_buffer.h.
65 const auto alignment =
68 sizeof(StorageBufferType),
References impeller::DefaultUniformAlignment(), and Emplace().
Referenced by impeller::testing::TEST_P().
◆ EmplaceUniform()
template<class UniformType , class = std::enable_if_t<std::is_standard_layout_v<UniformType>>>
| BufferView impeller::HostBuffer::EmplaceUniform |
( |
const UniformType & |
uniform | ) |
|
|
inline |
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirements are respected.
- Parameters
-
| [in] | uniform | The uniform struct to emplace onto the buffer. |
- Template Parameters
-
| UniformType | The type of the uniform struct. |
- Returns
- The buffer view.
Definition at line 41 of file host_buffer.h.
42 const auto alignment =
44 return Emplace(
reinterpret_cast<const void*
>(&uniform),
References impeller::DefaultUniformAlignment(), and Emplace().
Referenced by impeller::scene::CuboidGeometry::BindToCommand(), impeller::scene::UnlitMaterial::BindToCommand(), impeller::scene::UnskinnedVertexBufferGeometry::BindToCommand(), impeller::scene::SkinnedVertexBufferGeometry::BindToCommand(), ImGui_ImplImpeller_RenderDrawData(), impeller::RuntimeEffectContents::Render(), impeller::ClipContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::SolidColorContents::Render(), impeller::TextContents::Render(), impeller::ClipRestoreContents::Render(), and impeller::testing::TEST_P().
◆ GetLength()
| size_t impeller::HostBuffer::GetLength |
( |
| ) |
const |
Returns the size of the currently allocated HostBuffer memory in bytes.
Definition at line 71 of file host_buffer.cc.
72 return state_->GetLength();
◆ GetSize()
| size_t impeller::HostBuffer::GetSize |
( |
| ) |
const |
Returns the capacity of the HostBuffer in memory in bytes.
Definition at line 67 of file host_buffer.cc.
68 return state_->GetReservedLength();
◆ Reset()
| void impeller::HostBuffer::Reset |
( |
| ) |
|
◆ SetLabel()
| void impeller::HostBuffer::SetLabel |
( |
std::string |
label | ) |
|
Definition at line 26 of file host_buffer.cc.
27 state_->label = std::move(label);
The documentation for this class was generated from the following files: