#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 | |
~HostBuffer () | |
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... | |
size_t | GetMinimumUniformAlignment () const |
Retrieve the minimum uniform buffer alignment in bytes. 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, const std::shared_ptr< const IdleWaiter > &idle_waiter, size_t minimum_uniform_alignment) |
The host buffer class manages one more 1024 Kb blocks of device buffer allocations.
These are reset per-frame.
Definition at line 26 of file host_buffer.h.
using impeller::HostBuffer::EmplaceProc = std::function<void(uint8_t* buffer)> |
Definition at line 104 of file host_buffer.h.
impeller::HostBuffer::~HostBuffer | ( | ) |
Definition at line 45 of file host_buffer.cc.
|
static |
Definition at line 21 of file host_buffer.cc.
Referenced by impeller::testing::FlushTestContentContext::FlushTestContentContext(), impeller::Playground::OpenPlaygroundHere(), impeller::testing::RendererDartTest::RenderDartToPlayground(), and impeller::testing::TEST_P().
|
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 92 of file host_buffer.h.
Referenced by impeller::BulkUpdateAtlasBitmap(), impeller::Geometry::ComputePositionGeometry(), impeller::ContentContext::ContentContext(), impeller::DlAtlasGeometry::CreateBlendVertexBuffer(), impeller::DrawImageRectAtlasGeometry::CreateBlendVertexBuffer(), impeller::DlAtlasGeometry::CreateSimpleVertexBuffer(), impeller::DrawImageRectAtlasGeometry::CreateSimpleVertexBuffer(), impeller::CreateVertexBuffer(), EmplaceStorageBuffer(), EmplaceUniform(), impeller::RuntimeEffectContents::EmplaceVulkanUniform(), impeller::DlVerticesGeometry::GetPositionBuffer(), impeller::DlVerticesGeometry::GetPositionUVColorBuffer(), impeller::TextContents::Render(), impeller::Tessellator::TessellateConvex(), and impeller::UpdateAtlasBitmap().
BufferView impeller::HostBuffer::Emplace | ( | const void * | buffer, |
size_t | length, | ||
size_t | align | ||
) |
Definition at line 53 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 79 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 69 of file host_buffer.h.
References Emplace(), and GetMinimumUniformAlignment().
|
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 47 of file host_buffer.h.
References Emplace(), and GetMinimumUniformAlignment().
Referenced by impeller::ColorSourceContents::DrawGeometry(), ImGui_ImplImpeller_RenderDrawData(), impeller::TextContents::Render(), impeller::ClipContents::Render(), impeller::RenderClipRestore(), and impeller::testing::TEST_P().
size_t impeller::HostBuffer::GetMinimumUniformAlignment | ( | ) | const |
Retrieve the minimum uniform buffer alignment in bytes.
Definition at line 241 of file host_buffer.cc.
Referenced by impeller::BulkUpdateAtlasBitmap(), EmplaceStorageBuffer(), EmplaceUniform(), and impeller::UpdateAtlasBitmap().
HostBuffer::TestStateQuery impeller::HostBuffer::GetStateForTest | ( | ) |
Retrieve internal buffer state for test expectations.
Definition at line 93 of file host_buffer.cc.
References impeller::HostBuffer::TestStateQuery::current_frame.
void impeller::HostBuffer::Reset | ( | ) |
Resets the contents of the HostBuffer to nothing so it can be reused.
Definition at line 229 of file host_buffer.cc.
References impeller::kHostBufferArenaSize.
Referenced by ImGui_ImplImpeller_RenderDrawData(), and impeller::EntityPlayground::OpenPlaygroundHere().