Flutter Impeller
blit_pass_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_BLIT_PASS_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_PASS_VK_H_
7 
12 
13 namespace impeller {
14 
15 class CommandEncoderVK;
16 class CommandBufferVK;
17 
18 class BlitPassVK final : public BlitPass {
19  public:
20  // |BlitPass|
21  ~BlitPassVK() override;
22 
23  private:
24  friend class CommandBufferVK;
25 
26  std::shared_ptr<CommandBufferVK> command_buffer_;
27  const WorkaroundsVK workarounds_;
28 
29  explicit BlitPassVK(std::shared_ptr<CommandBufferVK> command_buffer,
30  const WorkaroundsVK& workarounds);
31 
32  // |BlitPass|
33  bool IsValid() const override;
34 
35  // |BlitPass|
36  void OnSetLabel(std::string_view label) override;
37 
38  // |BlitPass|
39  bool EncodeCommands() const override;
40 
41  // |BlitPass|
42  bool ResizeTexture(const std::shared_ptr<Texture>& source,
43  const std::shared_ptr<Texture>& destination) override;
44 
45  // |BlitPass|
46  bool ConvertTextureToShaderRead(
47  const std::shared_ptr<Texture>& texture) override;
48 
49  // |BlitPass|
50  bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
51  std::shared_ptr<Texture> destination,
52  IRect source_region,
53  IPoint destination_origin,
54  std::string_view label) override;
55 
56  // |BlitPass|
57  bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
58  std::shared_ptr<DeviceBuffer> destination,
59  IRect source_region,
60  size_t destination_offset,
61  std::string_view label) override;
62 
63  // |BlitPass|
64  bool OnCopyBufferToTextureCommand(BufferView source,
65  std::shared_ptr<Texture> destination,
66  IRect destination_region,
67  std::string_view label,
68  uint32_t mip_level,
69  uint32_t slice,
70  bool convert_to_read) override;
71  // |BlitPass|
72  bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
73  std::string_view label) override;
74 
75  BlitPassVK(const BlitPassVK&) = delete;
76 
77  BlitPassVK& operator=(const BlitPassVK&) = delete;
78 };
79 
80 } // namespace impeller
81 
82 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_BLIT_PASS_VK_H_
Blit passes encode blit into the underlying command buffer.
Definition: blit_pass.h:27
~BlitPassVK() override
A non-exhaustive set of driver specific workarounds.