10 #include "flutter/fml/logging.h"
23 CommandBufferVK::CommandBufferVK(
24 std::weak_ptr<const Context> context,
25 std::shared_ptr<CommandEncoderFactoryVK> encoder_factory)
26 : CommandBuffer(
std::move(context)),
27 encoder_factory_(
std::move(encoder_factory)) {}
31 void CommandBufferVK::SetLabel(
const std::string& label)
const {
33 encoder_factory_->SetLabel(label);
36 if (!context || !encoder_) {
43 bool CommandBufferVK::IsValid()
const {
49 encoder_ = encoder_factory_->Create();
54 bool CommandBufferVK::OnSubmitCommands(CompletionCallback callback) {
56 return encoder_->Submit();
58 return encoder_->Submit([callback](
bool submitted) {
64 void CommandBufferVK::OnWaitUntilScheduled() {}
66 std::shared_ptr<RenderPass> CommandBufferVK::OnCreateRenderPass(
67 RenderTarget target) {
73 std::shared_ptr<RenderPassVK>(
new RenderPassVK(context,
77 if (!pass->IsValid()) {
83 std::shared_ptr<BlitPass> CommandBufferVK::OnCreateBlitPass() {
87 auto pass = std::shared_ptr<BlitPassVK>(
new BlitPassVK(weak_from_this()));
88 if (!pass->IsValid()) {
94 std::shared_ptr<ComputePass> CommandBufferVK::OnCreateComputePass() {
103 std::shared_ptr<ComputePassVK>(
new ComputePassVK(context,
106 if (!pass->IsValid()) {