Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
VulkanDescriptorSet.h
Go to the documentation of this file.
1/*
2* Copyright 2023 Google LLC
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_VulkanDescriptorSet_DEFINED
9#define skgpu_graphite_VulkanDescriptorSet_DEFINED
10
12
15
16namespace skgpu::graphite {
17
18class VulkanDescriptorPool;
19class VulkanSharedContext;
20
21/**
22 * Wrapper around VkDescriptorSet which maintains a reference to its descriptor pool. Once the ref
23 * count on that pool is 0, it will be destroyed.
24*/
26public:
29
31 VkDescriptorSet,
33
34 const VkDescriptorSet* descriptorSet() { return &fDescSet; }
35
36 const char* getResourceType() const override { return "Vulkan Descriptor Set"; }
37
38private:
39 void freeGpuData() override;
40
41 VkDescriptorSet fDescSet;
42 // Have this class hold on to a reference of the descriptor pool. When a pool's reference count
43 // is 0, that means all the descriptor sets that came from that pool are no longer needed, so
44 // the pool can safely be destroyed.
46};
47} // namespace skgpu::graphite
48
49#endif // skgpu_graphite_VulkanDescriptorSet_DEFINED
static sk_sp< VulkanDescriptorSet > Make(const VulkanSharedContext *, const sk_sp< VulkanDescriptorPool > &)
const VkDescriptorSet * descriptorSet()
const char * getResourceType() const override