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 
8 #include "flutter/fml/macros.h"
12 
13 namespace impeller {
14 
15 class ContextVK;
16 class CommandEncoderFactoryVK;
17 class CommandEncoderVK;
18 
19 class CommandBufferVK final
20  : public CommandBuffer,
21  public BackendCast<CommandBufferVK, CommandBuffer>,
22  public std::enable_shared_from_this<CommandBufferVK> {
23  public:
24  // |CommandBuffer|
25  ~CommandBufferVK() override;
26 
27  const std::shared_ptr<CommandEncoderVK>& GetEncoder();
28 
29  private:
30  friend class ContextVK;
31 
32  std::shared_ptr<CommandEncoderVK> encoder_;
33  std::shared_ptr<CommandEncoderFactoryVK> encoder_factory_;
34 
35  CommandBufferVK(std::weak_ptr<const Context> context,
36  std::shared_ptr<CommandEncoderFactoryVK> encoder_factory);
37 
38  // |CommandBuffer|
39  void SetLabel(const std::string& label) const override;
40 
41  // |CommandBuffer|
42  bool IsValid() const override;
43 
44  // |CommandBuffer|
45  bool OnSubmitCommands(CompletionCallback callback) override;
46 
47  // |CommandBuffer|
48  void OnWaitUntilScheduled() override;
49 
50  // |CommandBuffer|
51  std::shared_ptr<RenderPass> OnCreateRenderPass(RenderTarget target) override;
52 
53  // |CommandBuffer|
54  std::shared_ptr<BlitPass> OnCreateBlitPass() override;
55 
56  // |CommandBuffer|
57  std::shared_ptr<ComputePass> OnCreateComputePass() override;
58 
59  CommandBufferVK(const CommandBufferVK&) = delete;
60 
61  CommandBufferVK& operator=(const CommandBufferVK&) = delete;
62 };
63 
64 } // namespace impeller
65 
66 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_BUFFER_VK_H_
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:55
vk.h
impeller::CommandBufferVK::~CommandBufferVK
~CommandBufferVK() override
backend_cast.h
impeller::RenderTarget
Definition: render_target.h:49
impeller::CommandBufferVK
Definition: command_buffer_vk.h:19
impeller::ContextVK
Definition: context_vk.h:40
command_buffer.h
impeller::BackendCast
Definition: backend_cast.h:13
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:45