Flutter Impeller
command_buffer_vk.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include "flutter/fml/macros.h"
11 
12 namespace impeller {
13 
14 class ContextVK;
15 class CommandEncoderFactoryVK;
16 class CommandEncoderVK;
17 
18 class CommandBufferVK final
19  : public CommandBuffer,
20  public BackendCast<CommandBufferVK, CommandBuffer>,
21  public std::enable_shared_from_this<CommandBufferVK> {
22  public:
23  // |CommandBuffer|
24  ~CommandBufferVK() override;
25 
26  const std::shared_ptr<CommandEncoderVK>& GetEncoder();
27 
28  private:
29  friend class ContextVK;
30 
31  std::shared_ptr<CommandEncoderVK> encoder_;
32  std::shared_ptr<CommandEncoderFactoryVK> encoder_factory_;
33 
34  CommandBufferVK(std::weak_ptr<const Context> context,
35  std::shared_ptr<CommandEncoderFactoryVK> encoder_factory);
36 
37  // |CommandBuffer|
38  void SetLabel(const std::string& label) const override;
39 
40  // |CommandBuffer|
41  bool IsValid() const override;
42 
43  // |CommandBuffer|
44  bool OnSubmitCommands(CompletionCallback callback) override;
45 
46  // |CommandBuffer|
47  void OnWaitUntilScheduled() override;
48 
49  // |CommandBuffer|
50  std::shared_ptr<RenderPass> OnCreateRenderPass(RenderTarget target) override;
51 
52  // |CommandBuffer|
53  std::shared_ptr<BlitPass> OnCreateBlitPass() override;
54 
55  // |CommandBuffer|
56  std::shared_ptr<ComputePass> OnCreateComputePass() override;
57 
58  FML_DISALLOW_COPY_AND_ASSIGN(CommandBufferVK);
59 };
60 
61 } // namespace impeller
impeller::CommandBufferVK::GetEncoder
const std::shared_ptr< CommandEncoderVK > & GetEncoder()
Definition: command_buffer_vk.cc:47
impeller::CommandBuffer::CompletionCallback
std::function< void(Status)> CompletionCallback
Definition: command_buffer.h:54
vk.h
impeller::CommandBufferVK::~CommandBufferVK
~CommandBufferVK() override
backend_cast.h
impeller::RenderTarget
Definition: render_target.h:48
impeller::CommandBufferVK
Definition: command_buffer_vk.h:18
impeller::ContextVK
Definition: context_vk.h:36
command_buffer.h
impeller::BackendCast
Definition: backend_cast.h:12
impeller
Definition: aiks_context.cc:10
impeller::CommandBuffer
A collection of encoded commands to be submitted to the GPU for execution. A command buffer is obtain...
Definition: command_buffer.h:44