#include <device_buffer.h>
Public Member Functions | |
virtual | ~DeviceBuffer () |
bool | CopyHostBuffer (const uint8_t *source, Range source_range, size_t offset=0u) |
virtual bool | SetLabel (std::string_view label)=0 |
virtual bool | SetLabel (std::string_view label, Range range)=0 |
const DeviceBufferDescriptor & | GetDeviceBufferDescriptor () const |
virtual uint8_t * | OnGetContents () const =0 |
virtual void | Flush (std::optional< Range > range=std::nullopt) const |
virtual void | Invalidate (std::optional< Range > range=std::nullopt) const |
Static Public Member Functions | |
static BufferView | AsBufferView (std::shared_ptr< DeviceBuffer > buffer) |
Create a buffer view of this entire buffer. More... | |
Protected Member Functions | |
DeviceBuffer (DeviceBufferDescriptor desc) | |
virtual bool | OnCopyHostBuffer (const uint8_t *source, Range source_range, size_t offset)=0 |
Protected Attributes | |
const DeviceBufferDescriptor | desc_ |
Definition at line 18 of file device_buffer.h.
|
virtualdefault |
|
explicitprotected |
Definition at line 9 of file device_buffer.cc.
|
static |
Create a buffer view of this entire buffer.
Definition at line 18 of file device_buffer.cc.
Referenced by impeller::testing::CreateTestYUVTextures(), impeller::CreateTexture(), impeller::Playground::CreateTextureCubeForFixture(), impeller::CreateTextureForDecompressedImage(), ImGui_ImplImpeller_Init(), and impeller::testing::TEST_P().
bool impeller::DeviceBuffer::CopyHostBuffer | ( | const uint8_t * | source, |
Range | source_range, | ||
size_t | offset = 0u |
||
) |
Definition at line 27 of file device_buffer.cc.
References desc_, impeller::kHostVisible, impeller::Range::length, OnCopyHostBuffer(), impeller::DeviceBufferDescriptor::size, and impeller::DeviceBufferDescriptor::storage_mode.
|
virtual |
Make any pending writes visible to the GPU.
This method must be called if the device pointer provided by [OnGetContents] is written to without using [CopyHostBuffer]. On Devices with coherent host memory, this method will not perform extra work.
If the range is not provided, the entire buffer is flushed.
Reimplemented in impeller::DeviceBufferGLES, and impeller::testing::FlushTestDeviceBuffer.
Definition at line 13 of file device_buffer.cc.
Referenced by impeller::Tessellator::TessellateConvex().
const DeviceBufferDescriptor & impeller::DeviceBuffer::GetDeviceBufferDescriptor | ( | ) | const |
|
virtual |
Definition at line 15 of file device_buffer.cc.
|
protectedpure virtual |
Implemented in impeller::testing::FlushTestDeviceBuffer.
Referenced by CopyHostBuffer().
|
pure virtual |
Implemented in impeller::testing::FlushTestDeviceBuffer.
Referenced by impeller::Tessellator::TessellateConvex(), and impeller::testing::TEST_P().
|
pure virtual |
Implemented in impeller::testing::FlushTestDeviceBuffer.
|
pure virtual |
Implemented in impeller::testing::FlushTestDeviceBuffer.
|
protected |
Definition at line 49 of file device_buffer.h.
Referenced by CopyHostBuffer(), and GetDeviceBufferDescriptor().