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 encoder_ = encoder_factory_->Create();
59 return encoder_->Submit();
61 return encoder_->Submit([callback](
bool submitted) {
67 void CommandBufferVK::OnWaitUntilScheduled() {}
69 std::shared_ptr<RenderPass> CommandBufferVK::OnCreateRenderPass(
70 RenderTarget target) {
76 std::shared_ptr<RenderPassVK>(
new RenderPassVK(context,
80 if (!pass->IsValid()) {
86 std::shared_ptr<BlitPass> CommandBufferVK::OnCreateBlitPass() {
90 auto pass = std::shared_ptr<BlitPassVK>(
new BlitPassVK(weak_from_this()));
91 if (!pass->IsValid()) {
97 std::shared_ptr<ComputePass> CommandBufferVK::OnCreateComputePass() {
106 std::shared_ptr<ComputePassVK>(
new ComputePassVK(context,
109 if (!pass->IsValid()) {