Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
VulkanDescriptorPool.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_VulkanDescriptorPool_DEFINED
9#define skgpu_graphite_VulkanDescriptorPool_DEFINED
10
12
13#include "include/core/SkSpan.h"
16
17namespace skgpu::graphite {
18
19class VulkanSharedContext;
20
22public:
23 // Conservative upper bound of number of sets supported per pool.
24 static constexpr int kMaxNumSets = 512;
25 /**
26 * Given a span of descriptor types and counts, a descriptor pool will be created which houses
27 * enough of the descriptor types and quantities requested to allocate the maximum number of
28 * sets possible (kMaxNumSets). Counts must be > 0.
29 */
32 VkDescriptorSetLayout);
33
34 VkDescriptorPool descPool() { return fDescPool; }
35
36 const VkDescriptorSetLayout* descSetLayout() {
37 SkASSERT(fDescSetLayout != VK_NULL_HANDLE);
38 return &fDescSetLayout;
39 }
40
41private:
42 // Conservative overestimation of a maximum number of descriptors of any given type that can be
43 // requested.
44 static constexpr int kMaxNumDescriptors = 1024;
45
47 VkDescriptorPool,
48 VkDescriptorSetLayout);
49 ~VulkanDescriptorPool() override;
50
51 const VulkanSharedContext* fSharedContext;
52 VkDescriptorPool fDescPool;
53 // The VulkanDescriptorPool has ownership of the VkDescSetLayout used to allocate sets from this
54 // pool.
55 VkDescriptorSetLayout fDescSetLayout;
56};
57} // namespace skgpu::graphite
58
59#endif // skgpu_graphite_VulkanDescriptorPool_DEFINED
#define SkASSERT(cond)
Definition SkAssert.h:116
static sk_sp< VulkanDescriptorPool > Make(const VulkanSharedContext *, SkSpan< DescriptorData >, VkDescriptorSetLayout)
const VkDescriptorSetLayout * descSetLayout()
#define VK_NULL_HANDLE
Definition vulkan_core.h:46