#include <blit_pass_mtl.h>
|
| ~BlitPassMTL () override |
|
virtual | ~BlitPass () |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
bool | IsValid () const override |
|
void | OnSetLabel (std::string label) override |
|
bool | EncodeCommands (const std::shared_ptr< Allocator > &transients_allocator) const override |
| Encode the recorded commands to the underlying command buffer.
|
|
bool | OnCopyTextureToTextureCommand (std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, IRect source_region, IPoint destination_origin, std::string label) override |
|
bool | OnCopyTextureToBufferCommand (std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, IRect source_region, size_t destination_offset, std::string label) override |
|
bool | OnCopyBufferToTextureCommand (BufferView source, std::shared_ptr< Texture > destination, IPoint destination_origin, std::string label) override |
|
bool | OnGenerateMipmapCommand (std::shared_ptr< Texture > texture, std::string label) override |
|
Definition at line 16 of file blit_pass_mtl.h.
◆ ~BlitPassMTL()
impeller::BlitPassMTL::~BlitPassMTL |
( |
| ) |
|
|
overridedefault |
◆ EncodeCommands()
bool impeller::BlitPassMTL::EncodeCommands |
( |
const std::shared_ptr< Allocator > & |
transients_allocator | ) |
const |
|
overrideprivatevirtual |
Encode the recorded commands to the underlying command buffer.
- Parameters
-
transients_allocator | The transients allocator. |
- Returns
- If the commands were encoded to the underlying command buffer.
Implements impeller::BlitPass.
Definition at line 47 of file blit_pass_mtl.mm.
48 {
51 return false;
52 }
53
54 auto blit_command_encoder = [buffer_ blitCommandEncoder];
55
56 if (!blit_command_encoder) {
57 return false;
58 }
59
60 if (!label_.empty()) {
61 [blit_command_encoder setLabel:@(label_.c_str())];
62 }
63
64
65
67 [blit_command_encoder]() { [blit_command_encoder endEncoding]; });
68
70}
Wraps a closure that is invoked in the destructor unless released by the caller.
bool EncodeCommands(const std::shared_ptr< Allocator > &transients_allocator) const override
Encode the recorded commands to the underlying command buffer.
bool IsValid() const override
#define TRACE_EVENT0(category_group, name)
◆ IsValid()
bool impeller::BlitPassMTL::IsValid |
( |
| ) |
const |
|
overrideprivatevirtual |
◆ OnCopyBufferToTextureCommand()
bool impeller::BlitPassMTL::OnCopyBufferToTextureCommand |
( |
BufferView |
source, |
|
|
std::shared_ptr< Texture > |
destination, |
|
|
IPoint |
destination_origin, |
|
|
std::string |
label |
|
) |
| |
|
overrideprivatevirtual |
Implements impeller::BlitPass.
Definition at line 126 of file blit_pass_mtl.mm.
130 {
131 auto command = std::make_unique<BlitCopyBufferToTextureCommandMTL>();
134 command->destination = std::move(destination);
135 command->destination_origin = destination_origin;
136
137 commands_.emplace_back(std::move(command));
138 return true;
139}
◆ OnCopyTextureToBufferCommand()
bool impeller::BlitPassMTL::OnCopyTextureToBufferCommand |
( |
std::shared_ptr< Texture > |
source, |
|
|
std::shared_ptr< DeviceBuffer > |
destination, |
|
|
IRect |
source_region, |
|
|
size_t |
destination_offset, |
|
|
std::string |
label |
|
) |
| |
|
overrideprivatevirtual |
Implements impeller::BlitPass.
Definition at line 109 of file blit_pass_mtl.mm.
114 {
115 auto command = std::make_unique<BlitCopyTextureToBufferCommandMTL>();
118 command->destination = std::move(destination);
119 command->source_region = source_region;
120 command->destination_offset = destination_offset;
121
122 commands_.emplace_back(std::move(command));
123 return true;
124}
◆ OnCopyTextureToTextureCommand()
bool impeller::BlitPassMTL::OnCopyTextureToTextureCommand |
( |
std::shared_ptr< Texture > |
source, |
|
|
std::shared_ptr< Texture > |
destination, |
|
|
IRect |
source_region, |
|
|
IPoint |
destination_origin, |
|
|
std::string |
label |
|
) |
| |
|
overrideprivatevirtual |
Implements impeller::BlitPass.
Definition at line 91 of file blit_pass_mtl.mm.
96 {
97 auto command = std::make_unique<BlitCopyTextureToTextureCommandMTL>();
100 command->destination = std::move(destination);
101 command->source_region = source_region;
102 command->destination_origin = destination_origin;
103
104 commands_.emplace_back(std::move(command));
105 return true;
106}
◆ OnGenerateMipmapCommand()
bool impeller::BlitPassMTL::OnGenerateMipmapCommand |
( |
std::shared_ptr< Texture > |
texture, |
|
|
std::string |
label |
|
) |
| |
|
overrideprivatevirtual |
Implements impeller::BlitPass.
Definition at line 142 of file blit_pass_mtl.mm.
143 {
144 auto command = std::make_unique<BlitGenerateMipmapCommandMTL>();
147
148 commands_.emplace_back(std::move(command));
149 return true;
150}
◆ OnSetLabel()
void impeller::BlitPassMTL::OnSetLabel |
( |
std::string |
label | ) |
|
|
overrideprivatevirtual |
◆ CommandBufferMTL
The documentation for this class was generated from the following files: