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 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_
7 
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  CommandBufferVK(const CommandBufferVK&) = delete;
59 
60  CommandBufferVK& operator=(const CommandBufferVK&) = delete;
61 };
62 
63 } // namespace impeller
64 
65 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_
impeller::CommandBufferVK::GetEncoder
const std::shared_ptr< CommandEncoderVK > & GetEncoder()
Definition: command_buffer_vk.cc:45
impeller::CommandBuffer::CompletionCallback
std::function< void(Status)> CompletionCallback
Definition: command_buffer.h:55
vk.h
impeller::CommandBufferVK::~CommandBufferVK
~CommandBufferVK() override
backend_cast.h
impeller::RenderTarget
Definition: render_target.h:38
impeller::CommandBufferVK
Definition: command_buffer_vk.h:18
impeller::ContextVK
Definition: context_vk.h:42
command_buffer.h
impeller::BackendCast
Definition: backend_cast.h:11
impeller
Definition: aiks_blur_unittests.cc:20
impeller::CommandBuffer
A collection of encoded commands to be submitted to the GPU for execution. A command buffer is obtain...
Definition: command_buffer.h:45