Flutter Engine
The Flutter Engine
|
Blit passes encode blit into the underlying command buffer. More...
#include <blit_pass.h>
Public Member Functions | |
virtual | ~BlitPass () |
virtual bool | IsValid () const =0 |
void | SetLabel (std::string label) |
virtual bool | ConvertTextureToShaderRead (const std::shared_ptr< Texture > &texture) |
If the texture is not already in a shader read internal state, then convert it to that state. More... | |
bool | AddCopy (std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, std::optional< IRect > source_region=std::nullopt, IPoint destination_origin={}, std::string label="") |
Record a command to copy the contents of one texture to another texture. The blit area is limited by the intersection of the texture coverage with respect the source region and destination origin. More... | |
bool | AddCopy (std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, std::optional< IRect > source_region=std::nullopt, size_t destination_offset=0, std::string label="") |
Record a command to copy the contents of the buffer to the texture. More... | |
bool | AddCopy (BufferView source, std::shared_ptr< Texture > destination, std::optional< IRect > destination_region=std::nullopt, std::string label="", uint32_t slice=0, bool convert_to_read=true) |
Record a command to copy the contents of the buffer to the texture. More... | |
bool | GenerateMipmap (std::shared_ptr< Texture > texture, std::string label="") |
Record a command to generate all mip levels for a texture. More... | |
virtual bool | EncodeCommands (const std::shared_ptr< Allocator > &transients_allocator) const =0 |
Encode the recorded commands to the underlying command buffer. More... | |
Protected Member Functions | |
BlitPass () | |
virtual void | OnSetLabel (std::string label)=0 |
virtual bool | OnCopyTextureToTextureCommand (std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, IRect source_region, IPoint destination_origin, std::string label)=0 |
virtual bool | OnCopyTextureToBufferCommand (std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, IRect source_region, size_t destination_offset, std::string label)=0 |
virtual bool | OnCopyBufferToTextureCommand (BufferView source, std::shared_ptr< Texture > destination, IRect destination_region, std::string label, uint32_t slice, bool convert_to_read)=0 |
virtual bool | OnGenerateMipmapCommand (std::shared_ptr< Texture > texture, std::string label)=0 |
Blit passes encode blit into the underlying command buffer.
Blit passes can be obtained from the command buffer in which the pass is meant to encode commands into.
CommandBuffer
Definition at line 26 of file blit_pass.h.
|
virtualdefault |
|
explicitprotected |
Definition at line 15 of file blit_pass.cc.
bool impeller::BlitPass::AddCopy | ( | BufferView | source, |
std::shared_ptr< Texture > | destination, | ||
std::optional< IRect > | destination_region = std::nullopt , |
||
std::string | label = "" , |
||
uint32_t | slice = 0 , |
||
bool | convert_to_read = true |
||
) |
Record a command to copy the contents of the buffer to the texture.
[in] | source | The buffer view to read for copying. |
[in] | destination | The texture to overwrite using the source contents. |
[in] | destination_region | The offset to start writing to in the destination texture. If not provided, this defaults to the entire texture. |
[in] | label | The optional debug label to give the command. |
[in] | slice | For cubemap textures, the slice to write data to. |
[in] | convert_to_read | Whether to convert the texture to a shader read state. Defaults to true. |
If a region smaller than the texture size is provided, the contents are treated as containing tightly packed pixel data of that region. Only the portion of the texture in this region is replaced and existing data is preserved.
For example, to replace the top left 10 x 10 region of a larger 100 x 100 texture, the region is {0, 0, 10, 10} and the expected buffer size in bytes is 100 x bpp.
Definition at line 123 of file blit_pass.cc.
bool impeller::BlitPass::AddCopy | ( | std::shared_ptr< Texture > | source, |
std::shared_ptr< DeviceBuffer > | destination, | ||
std::optional< IRect > | source_region = std::nullopt , |
||
size_t | destination_offset = 0 , |
||
std::string | label = "" |
||
) |
Record a command to copy the contents of the buffer to the texture.
[in] | source | The texture to read for copying. |
[in] | destination | The buffer to overwrite using the source contents. |
[in] | source_region | The optional region of the source texture to use for copying. If not specified, the full size of the source texture is used. |
[in] | destination_origin | The origin to start writing to in the destination texture. |
[in] | label | The optional debug label to give the command. |
Definition at line 83 of file blit_pass.cc.
bool impeller::BlitPass::AddCopy | ( | std::shared_ptr< Texture > | source, |
std::shared_ptr< Texture > | destination, | ||
std::optional< IRect > | source_region = std::nullopt , |
||
IPoint | destination_origin = {} , |
||
std::string | label = "" |
||
) |
Record a command to copy the contents of one texture to another texture. The blit area is limited by the intersection of the texture coverage with respect the source region and destination origin.
[in] | source | The texture to read for copying. |
[in] | destination | The texture to overwrite using the source contents. |
[in] | source_region | The optional region of the source texture to use for copying. If not specified, the full size of the source texture is used. |
[in] | destination_origin | The origin to start writing to in the destination texture. |
[in] | label | The optional debug label to give the command. |
Definition at line 26 of file blit_pass.cc.
|
virtual |
If the texture is not already in a shader read internal state, then convert it to that state.
This API is only used by Vulkan.
Definition at line 163 of file blit_pass.cc.
|
pure virtual |
Encode the recorded commands to the underlying command buffer.
transients_allocator | The transients allocator. |
bool impeller::BlitPass::GenerateMipmap | ( | std::shared_ptr< Texture > | texture, |
std::string | label = "" |
||
) |
Record a command to generate all mip levels for a texture.
[in] | texture | The texture to generate mipmaps for. |
[in] | label | The optional debug label to give the command. |
Definition at line 168 of file blit_pass.cc.
|
pure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
void impeller::BlitPass::SetLabel | ( | std::string | label | ) |
Definition at line 19 of file blit_pass.cc.