47bool BlitPassMTL::EncodeCommands(
48 const std::shared_ptr<Allocator>& transients_allocator)
const {
54 auto blit_command_encoder = [buffer_ blitCommandEncoder];
56 if (!blit_command_encoder) {
60 if (!label_.empty()) {
61 [blit_command_encoder setLabel:@(label_.c_str())];
67 [blit_command_encoder]() { [blit_command_encoder endEncoding]; });
69 return EncodeCommands(blit_command_encoder);
91bool BlitPassMTL::OnCopyTextureToTextureCommand(
92 std::shared_ptr<Texture>
source,
93 std::shared_ptr<Texture> destination,
97 auto command = std::make_unique<BlitCopyTextureToTextureCommandMTL>();
98 command->label = label;
99 command->source = std::move(
source);
100 command->destination = std::move(destination);
101 command->source_region = source_region;
102 command->destination_origin = destination_origin;
104 commands_.emplace_back(std::move(command));
109bool BlitPassMTL::OnCopyTextureToBufferCommand(
110 std::shared_ptr<Texture>
source,
111 std::shared_ptr<DeviceBuffer> destination,
113 size_t destination_offset,
115 auto command = std::make_unique<BlitCopyTextureToBufferCommandMTL>();
116 command->label = label;
117 command->source = std::move(
source);
118 command->destination = std::move(destination);
119 command->source_region = source_region;
120 command->destination_offset = destination_offset;
122 commands_.emplace_back(std::move(command));
126bool BlitPassMTL::OnCopyBufferToTextureCommand(
128 std::shared_ptr<Texture> destination,
129 IPoint destination_origin,
131 auto command = std::make_unique<BlitCopyBufferToTextureCommandMTL>();
132 command->label = label;
133 command->source = std::move(
source);
134 command->destination = std::move(destination);
135 command->destination_origin = destination_origin;
137 commands_.emplace_back(std::move(command));
static const uint8_t buffer[]