7 #include "flutter/fml/logging.h"
8 #include "flutter/fml/trace_event.h"
13 BlitPassVK::BlitPassVK(std::weak_ptr<CommandBufferVK> command_buffer)
14 : command_buffer_(
std::move(command_buffer)) {}
18 void BlitPassVK::OnSetLabel(std::string label) {
22 label_ = std::move(label);
26 bool BlitPassVK::IsValid()
const {
31 bool BlitPassVK::EncodeCommands(
32 const std::shared_ptr<Allocator>& transients_allocator)
const {
33 TRACE_EVENT0(
"impeller",
"BlitPassVK::EncodeCommands");
39 auto command_buffer = command_buffer_.lock();
40 if (!command_buffer) {
43 auto encoder = command_buffer->GetEncoder();
48 for (
auto& command : commands_) {
49 if (!command->Encode(*encoder)) {
58 bool BlitPassVK::OnCopyTextureToTextureCommand(
59 std::shared_ptr<Texture> source,
60 std::shared_ptr<Texture> destination,
64 auto command = std::make_unique<BlitCopyTextureToTextureCommandVK>();
66 command->source = std::move(source);
67 command->destination = std::move(destination);
68 command->source_region = source_region;
69 command->destination_origin = destination_origin;
70 command->label = std::move(label);
72 commands_.push_back(std::move(command));
77 bool BlitPassVK::OnCopyTextureToBufferCommand(
78 std::shared_ptr<Texture> source,
79 std::shared_ptr<DeviceBuffer> destination,
81 size_t destination_offset,
83 auto command = std::make_unique<BlitCopyTextureToBufferCommandVK>();
85 command->source = std::move(source);
86 command->destination = std::move(destination);
87 command->source_region = source_region;
88 command->destination_offset = destination_offset;
89 command->label = std::move(label);
91 commands_.push_back(std::move(command));
96 bool BlitPassVK::OnCopyBufferToTextureCommand(
98 std::shared_ptr<Texture> destination,
101 auto command = std::make_unique<BlitCopyBufferToTextureCommandVK>();
103 command->source = std::move(source);
104 command->destination = std::move(destination);
105 command->destination_origin = destination_origin;
106 command->label = std::move(label);
108 commands_.push_back(std::move(command));
113 bool BlitPassVK::OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
115 auto command = std::make_unique<BlitGenerateMipmapCommandVK>();
117 command->texture = std::move(texture);
118 command->label = std::move(label);
120 commands_.push_back(std::move(command));