Flutter Engine
The Flutter Engine
|
#include <host_buffer.h>
Classes | |
struct | TestStateQuery |
Test only internal state. More... | |
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, size_t alignment=0) |
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... | |
TestStateQuery | GetStateForTest () |
Retrieve internal buffer state for test expectations. More... | |
Static Public Member Functions | |
static std::shared_ptr< HostBuffer > | Create (const std::shared_ptr< Allocator > &allocator) |
The host buffer class manages one more 1024 Kb blocks of device buffer allocations.
These are reset per-frame.
Definition at line 28 of file host_buffer.h.
using impeller::HostBuffer::EmplaceProc = std::function<void(uint8_t* buffer)> |
Definition at line 107 of file host_buffer.h.
|
virtualdefault |
|
static |
Definition at line 20 of file host_buffer.cc.
|
inline |
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
[in] | buffer | The buffer data. |
[in] | alignment | Minimum alignment of the data being emplaced. |
BufferType | The type of the buffer data. |
Definition at line 95 of file host_buffer.h.
BufferView impeller::HostBuffer::Emplace | ( | const void * | buffer, |
size_t | length, | ||
size_t | align | ||
) |
Definition at line 41 of file host_buffer.cc.
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.
|
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 72 of file host_buffer.h.
|
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 50 of file host_buffer.h.
HostBuffer::TestStateQuery impeller::HostBuffer::GetStateForTest | ( | ) |
Retrieve internal buffer state for test expectations.
Definition at line 69 of file host_buffer.cc.
void impeller::HostBuffer::Reset | ( | ) |
Resets the contents of the HostBuffer to nothing so it can be reused.
Definition at line 195 of file host_buffer.cc.
void impeller::HostBuffer::SetLabel | ( | std::string | label | ) |
Definition at line 37 of file host_buffer.cc.