#include <host_buffer.h>
Public Types | |
| using | EmplaceProc = std::function< void(uint8_t *buffer)> |
Public Member Functions | |
| 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 size of the HostBuffer in memory in bytes. More... | |
Public Member Functions inherited from impeller::Allocation | |
| Allocation () | |
| ~Allocation () | |
| uint8_t * | GetBuffer () const |
| size_t | GetLength () const |
| size_t | GetReservedLength () const |
| bool | Truncate (size_t length, bool npot=true) |
Public Member Functions inherited from impeller::Buffer | |
| virtual | ~Buffer () |
Static Public Member Functions | |
| static std::shared_ptr< HostBuffer > | Create () |
Static Public Member Functions inherited from impeller::Allocation | |
| static uint32_t | NextPowerOfTwoSize (uint32_t x) |
Definition at line 20 of file host_buffer.h.
| using impeller::HostBuffer::EmplaceProc = std::function<void(uint8_t* buffer)> |
Definition at line 98 of file host_buffer.h.
|
virtualdefault |
|
static |
Definition at line 18 of file host_buffer.cc.
Referenced by impeller::testing::TEST().
|
inline |
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
| [in] | buffer | The buffer data. |
| BufferType | The type of the buffer data. |
Definition at line 87 of file host_buffer.h.
Referenced by Emplace(), EmplaceStorageBuffer(), EmplaceUniform(), impeller::RuntimeEffectContents::Render(), and impeller::TextContents::Render().
| BufferView impeller::HostBuffer::Emplace | ( | const void * | buffer, |
| size_t | length, | ||
| size_t | align | ||
| ) |
Definition at line 30 of file host_buffer.cc.
References Emplace(), and impeller::Allocation::GetLength().
| BufferView impeller::HostBuffer::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.
| [in] | cb | A callback that will be passed a ptr to the underlying host buffer. |
Definition at line 59 of file host_buffer.cc.
References impeller::Allocation::GetBuffer(), impeller::Allocation::GetLength(), and impeller::Allocation::Truncate().
|
inline |
Emplace storage buffer data onto the host buffer. Ensure that backend specific uniform alignment requirements are respected.
| [in] | uniform | The storage buffer to emplace onto the buffer. |
| StorageBufferType | The type of the shader storage buffer. |
Definition at line 65 of file host_buffer.h.
References impeller::DefaultUniformAlignment(), and Emplace().
Referenced by impeller::testing::TEST_P().
|
inline |
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirements are respected.
| [in] | uniform | The uniform struct to emplace onto the buffer. |
| UniformType | The type of the uniform struct. |
Definition at line 43 of file host_buffer.h.
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().
| size_t impeller::HostBuffer::GetSize | ( | ) | const |
Returns the size of the HostBuffer in memory in bytes.
Definition at line 97 of file host_buffer.cc.
References impeller::Allocation::GetReservedLength().
| void impeller::HostBuffer::Reset | ( | ) |
Resets the contents of the HostBuffer to nothing so it can be reused.
Definition at line 90 of file host_buffer.cc.
References impeller::Allocation::Truncate().
| void impeller::HostBuffer::SetLabel | ( | std::string | label | ) |
Definition at line 26 of file host_buffer.cc.