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 
8 #include "flutter/fml/macros.h"
9 #include "impeller/base/config.h"
10 #include "impeller/geometry/rect.h"
13 
14 namespace impeller {
15 
16 class CommandEncoderVK;
17 class CommandBufferVK;
18 
19 class BlitPassVK final : public BlitPass {
20  public:
21  // |BlitPass|
22  ~BlitPassVK() override;
23 
24  private:
25  friend class CommandBufferVK;
26  FML_FRIEND_TEST(BlitPassVKTest,
27  MipmapGenerationTransitionsAllLevelsCorrectly);
28 
29  std::shared_ptr<CommandBufferVK> command_buffer_;
30  const WorkaroundsVK workarounds_;
31 
32  explicit BlitPassVK(std::shared_ptr<CommandBufferVK> command_buffer,
33  const WorkaroundsVK& workarounds);
34 
35  // |BlitPass|
36  bool IsValid() const override;
37 
38  // |BlitPass|
39  void OnSetLabel(std::string_view label) override;
40 
41  // |BlitPass|
42  bool EncodeCommands() const override;
43 
44  // |BlitPass|
45  bool ResizeTexture(const std::shared_ptr<Texture>& source,
46  const std::shared_ptr<Texture>& destination) override;
47 
48  // |BlitPass|
49  bool ConvertTextureToShaderRead(
50  const std::shared_ptr<Texture>& texture) override;
51 
52  // |BlitPass|
53  bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
54  std::shared_ptr<Texture> destination,
55  IRect source_region,
56  IPoint destination_origin,
57  std::string_view label) override;
58 
59  // |BlitPass|
60  bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
61  std::shared_ptr<DeviceBuffer> destination,
62  IRect source_region,
63  size_t destination_offset,
64  std::string_view label) override;
65 
66  // |BlitPass|
67  bool OnCopyBufferToTextureCommand(BufferView source,
68  std::shared_ptr<Texture> destination,
69  IRect destination_region,
70  std::string_view label,
71  uint32_t mip_level,
72  uint32_t slice,
73  bool convert_to_read) override;
74  // |BlitPass|
75  bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
76  std::string_view label) override;
77 
78  BlitPassVK(const BlitPassVK&) = delete;
79 
80  BlitPassVK& operator=(const BlitPassVK&) = delete;
81 };
82 
83 } // namespace impeller
84 
85 #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.