| 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_VULKAN_VULKAN_IMAGE_H_ |
| 6 | #define FLUTTER_VULKAN_VULKAN_IMAGE_H_ |
| 7 | |
| 8 | #include "flutter/fml/compiler_specific.h" |
| 9 | #include "flutter/fml/macros.h" |
| 10 | #include "flutter/vulkan/procs/vulkan_handle.h" |
| 11 | |
| 12 | namespace vulkan { |
| 13 | |
| 14 | class VulkanProcTable; |
| 15 | class VulkanCommandBuffer; |
| 16 | |
| 17 | class VulkanImage { |
| 18 | public: |
| 19 | explicit VulkanImage(VulkanHandle<VkImage> image); |
| 20 | |
| 21 | ~VulkanImage(); |
| 22 | |
| 23 | bool IsValid() const; |
| 24 | |
| 25 | [[nodiscard]] bool InsertImageMemoryBarrier( |
| 26 | const VulkanCommandBuffer& command_buffer, |
| 27 | VkPipelineStageFlagBits src_pipline_bits, |
| 28 | VkPipelineStageFlagBits dest_pipline_bits, |
| 29 | VkAccessFlags dest_access_flags, |
| 30 | VkImageLayout dest_layout); |
| 31 | |
| 32 | private: |
| 33 | VulkanHandle<VkImage> handle_; |
| 34 | VkImageLayout layout_; |
| 35 | uint32_t /* mask of VkAccessFlagBits */ access_flags_; |
| 36 | bool valid_; |
| 37 | |
| 38 | FML_DISALLOW_COPY_AND_ASSIGN(VulkanImage); |
| 39 | }; |
| 40 | |
| 41 | } // namespace vulkan |
| 42 | |
| 43 | #endif // FLUTTER_VULKAN_VULKAN_IMAGE_H_ |
| 44 |
