|
| virtual | ~BlitPass () |
| |
| virtual bool | IsValid () const =0 |
| |
| void | SetLabel (std::string label) |
| |
| 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. No work is encoded into the command buffer at this time. 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. No work is encoded into the command buffer at this time. More...
|
| |
| bool | AddCopy (BufferView source, std::shared_ptr< Texture > destination, IPoint destination_origin={}, std::string label="") |
| | Record a command to copy the contents of the buffer to the texture. No work is encoded into the command buffer at this time. More...
|
| |
| bool | GenerateMipmap (std::shared_ptr< Texture > texture, std::string label="") |
| | Record a command to generate all mip levels for a texture. No work is encoded into the command buffer at this time. More...
|
| |
| virtual bool | EncodeCommands (const std::shared_ptr< Allocator > &transients_allocator) const =0 |
| | Encode the recorded commands to the underlying command buffer. More...
|
| |
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.
- See also
CommandBuffer
Definition at line 26 of file blit_pass.h.
| 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. No work is encoded into the command buffer at this time.
- Parameters
-
| [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. |
- Returns
- If the command was valid for subsequent commitment.
Definition at line 26 of file blit_pass.cc.
32 VALIDATION_LOG <<
"Attempted to add a texture blit with no source.";
36 VALIDATION_LOG <<
"Attempted to add a texture blit with no destination.";
40 if (source->GetTextureDescriptor().sample_count !=
41 destination->GetTextureDescriptor().sample_count) {
43 "The source sample count (%d) must match the destination sample count "
45 static_cast<int>(source->GetTextureDescriptor().sample_count),
46 static_cast<int>(destination->GetTextureDescriptor().sample_count));
49 if (source->GetTextureDescriptor().format !=
50 destination->GetTextureDescriptor().format) {
52 "The source pixel format (%s) must match the destination pixel format "
60 if (!source_region.has_value()) {
67 if (!source_region.has_value()) {
72 source_region = source_region->Intersection(
74 if (!source_region.has_value()) {
79 std::move(source), std::move(destination), source_region.value(),
80 destination_origin, std::move(label));
References impeller::TRect< int64_t >::MakeOriginSize(), impeller::TRect< int64_t >::MakeSize(), OnCopyTextureToTextureCommand(), impeller::PixelFormatToString(), impeller::SPrintF(), and VALIDATION_LOG.