Flutter Engine
The Flutter Engine
VulkanImageView.h
Go to the documentation of this file.
1/*
2* Copyright 2023 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef skgpu_graphite_VulkanImageView_DEFINED
9#define skgpu_graphite_VulkanImageView_DEFINED
10
14
15namespace skgpu::graphite {
16
17class VulkanSharedContext;
18class VulkanResourceProvider;
19
20/*
21 * VulkanImageView is not derived from Resource as its lifetime is dependent on the lifetime of
22 * its associated VulkanTexture. Hence VulkanTexture will act as a container for its ImageViews
23 * w.r.t. the ResourceCache and CommandBuffer, and is responsible for deleting its ImageView
24 * children when freeGpuData() is called.
25 */
27public:
28 enum class Usage {
29 kShaderInput,
30 kAttachment
31 };
32
33 static std::unique_ptr<const VulkanImageView> Make(
34 const VulkanSharedContext* sharedContext,
35 VkImage image,
38 uint32_t miplevels,
41
42 VkImageView imageView() const { return fImageView; }
43 Usage usage() const { return fUsage; }
44
45private:
47
48 // Since we're not derived from Resource we need to store the context for deletion later
49 const VulkanSharedContext* fSharedContext;
50 VkImageView fImageView;
51 Usage fUsage;
52 sk_sp<VulkanYcbcrConversion> fYcbcrConversion;
53};
54
55} // namespace skgpu::graphite
56
57#endif // skgpu_graphite_VulkanImageView_DEFINED
static std::unique_ptr< const VulkanImageView > Make(const VulkanSharedContext *sharedContext, VkImage image, VkFormat format, Usage usage, uint32_t miplevels, sk_sp< VulkanYcbcrConversion >)
uint32_t uint32_t * format
sk_sp< const SkImage > image
Definition: SkRecords.h:269
VkFormat
Definition: vulkan_core.h:1458