Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
GrVkDescriptorPool Class Reference

#include <GrVkDescriptorPool.h>

Inheritance diagram for GrVkDescriptorPool:
GrVkManagedResource GrManagedResource SkNoncopyable

Public Member Functions

VkDescriptorPool descPool () const
 
bool isCompatible (VkDescriptorType type, uint32_t count) const
 
- Public Member Functions inherited from GrVkManagedResource
 GrVkManagedResource (const GrVkGpu *gpu)
 
- Public Member Functions inherited from GrManagedResource
 GrManagedResource ()
 
virtual ~GrManagedResource ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static GrVkDescriptorPoolCreate (GrVkGpu *gpu, VkDescriptorType type, uint32_t count)
 

Additional Inherited Members

- Protected Attributes inherited from GrVkManagedResource
const GrVkGpufGpu
 

Detailed Description

We require that all descriptor sets are of a single descriptor type. We also use a pool to only make one type of descriptor set. Thus a single VkDescriptorPool will only allocated space for for one type of descriptor.

Definition at line 23 of file GrVkDescriptorPool.h.

Member Function Documentation

◆ Create()

GrVkDescriptorPool * GrVkDescriptorPool::Create ( GrVkGpu gpu,
VkDescriptorType  type,
uint32_t  count 
)
static

Definition at line 14 of file GrVkDescriptorPool.cpp.

15 {
16 VkDescriptorPoolSize poolSize;
17 memset(&poolSize, 0, sizeof(VkDescriptorPoolSize));
18 poolSize.descriptorCount = count;
19 poolSize.type = type;
20
22 memset(&createInfo, 0, sizeof(VkDescriptorPoolCreateInfo));
24 createInfo.pNext = nullptr;
25 createInfo.flags = 0;
26 // This is an over/conservative estimate since each set may contain more than count descriptors.
27 createInfo.maxSets = count;
28 createInfo.poolSizeCount = 1;
29 createInfo.pPoolSizes = &poolSize;
30
31 VkDescriptorPool pool;
33 GR_VK_CALL_RESULT(gpu, result, CreateDescriptorPool(gpu->device(), &createInfo, nullptr,
34 &pool));
35 if (result != VK_SUCCESS) {
36 return nullptr;
37 }
38 return new GrVkDescriptorPool(gpu, pool, type, count);
39}
AutoreleasePool pool
int count
Definition: FontMgrTest.cpp:50
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
Definition: GrVkUtil.h:35
GLenum type
VkDevice device() const
Definition: GrVkGpu.h:71
GAsyncResult * result
const VkDescriptorPoolSize * pPoolSizes
Definition: vulkan_core.h:3760
VkDescriptorPoolCreateFlags flags
Definition: vulkan_core.h:3757
VkDescriptorType type
Definition: vulkan_core.h:3750
VkResult
Definition: vulkan_core.h:140
@ VK_SUCCESS
Definition: vulkan_core.h:141
@ VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
Definition: vulkan_core.h:235

◆ descPool()

VkDescriptorPool GrVkDescriptorPool::descPool ( ) const
inline

Definition at line 27 of file GrVkDescriptorPool.h.

27{ return fDescPool; }

◆ isCompatible()

bool GrVkDescriptorPool::isCompatible ( VkDescriptorType  type,
uint32_t  count 
) const

Definition at line 45 of file GrVkDescriptorPool.cpp.

45 {
46 return fType == type && count <= fCount;
47}

The documentation for this class was generated from the following files: