Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skgpu::graphite::VulkanDescriptorSet Class Reference

#include <VulkanDescriptorSet.h>

Inheritance diagram for skgpu::graphite::VulkanDescriptorSet:
skgpu::graphite::Resource

Public Member Functions

 VulkanDescriptorSet (const VulkanSharedContext *, VkDescriptorSet, sk_sp< VulkanDescriptorPool >)
 
const VkDescriptorSet * descriptorSet ()
 
const char * getResourceType () const override
 
- Public Member Functions inherited from skgpu::graphite::Resource
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
Resourceoperator= (const Resource &)=delete
 
Resourceoperator= (Resource &&)=delete
 
void ref () const
 
void unref () const
 
void refCommandBuffer () const
 
void unrefCommandBuffer () const
 
Ownership ownership () const
 
skgpu::Budgeted budgeted () const
 
size_t gpuMemorySize () const
 
UniqueID uniqueID () const
 
virtual const char * getResourceType () const =0
 
std::string getLabel () const
 
void setLabel (std::string_view label)
 
bool wasDestroyed () const
 
const GraphiteResourceKeykey () const
 
void setKey (const GraphiteResourceKey &key)
 
void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 
virtual void prepareForReturnToCache (const std::function< void()> &takeRef)
 

Static Public Member Functions

static sk_sp< VulkanDescriptorSetMake (const VulkanSharedContext *, const sk_sp< VulkanDescriptorPool > &)
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::graphite::Resource
 Resource (const SharedContext *, Ownership, skgpu::Budgeted, size_t gpuMemorySize, bool commandBufferRefsAsUsageRefs=false)
 
virtual ~Resource ()
 
const SharedContextsharedContext () const
 
virtual void onDumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump, const char *dumpName) const
 
void setDeleteASAP ()
 

Detailed Description

Wrapper around VkDescriptorSet which maintains a reference to its descriptor pool. Once the ref count on that pool is 0, it will be destroyed.

Definition at line 25 of file VulkanDescriptorSet.h.

Constructor & Destructor Documentation

◆ VulkanDescriptorSet()

skgpu::graphite::VulkanDescriptorSet::VulkanDescriptorSet ( const VulkanSharedContext ctxt,
VkDescriptorSet  set,
sk_sp< VulkanDescriptorPool pool 
)

Definition at line 35 of file VulkanDescriptorSet.cpp.

38 : Resource(ctxt,
41 /*gpuMemorySize=*/0)
42 , fDescSet(set)
43 , fPool(pool) {
44 fPool->ref();
45}
AutoreleasePool pool
Resource(const Resource &)=delete
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
Definition: switches.h:76

Member Function Documentation

◆ descriptorSet()

const VkDescriptorSet * skgpu::graphite::VulkanDescriptorSet::descriptorSet ( )
inline

Definition at line 34 of file VulkanDescriptorSet.h.

34{ return &fDescSet; }

◆ getResourceType()

const char * skgpu::graphite::VulkanDescriptorSet::getResourceType ( ) const
inlineoverridevirtual

Implements skgpu::graphite::Resource.

Definition at line 36 of file VulkanDescriptorSet.h.

36{ return "Vulkan Descriptor Set"; }

◆ Make()

sk_sp< VulkanDescriptorSet > skgpu::graphite::VulkanDescriptorSet::Make ( const VulkanSharedContext ctxt,
const sk_sp< VulkanDescriptorPool > &  pool 
)
static

Definition at line 15 of file VulkanDescriptorSet.cpp.

16 {
17 VkDescriptorSet descSet;
18 VkDescriptorSetAllocateInfo dsAllocateInfo;
19 memset(&dsAllocateInfo, 0, sizeof(VkDescriptorSetAllocateInfo));
21 dsAllocateInfo.pNext = nullptr;
22 dsAllocateInfo.descriptorPool = pool->descPool();
23 dsAllocateInfo.descriptorSetCount = 1;
24 dsAllocateInfo.pSetLayouts = pool->descSetLayout();
25
28 ctxt, result, AllocateDescriptorSets(ctxt->device(), &dsAllocateInfo, &descSet));
29 if (result != VK_SUCCESS) {
30 return nullptr;
31 }
32 return sk_sp<VulkanDescriptorSet>(new VulkanDescriptorSet(ctxt, descSet, pool));
33}
#define VULKAN_CALL_RESULT(SHARED_CONTEXT, RESULT, X)
VulkanDescriptorSet(const VulkanSharedContext *, VkDescriptorSet, sk_sp< VulkanDescriptorPool >)
GAsyncResult * result
VkDescriptorPool descriptorPool
Definition: vulkan_core.h:3766
const VkDescriptorSetLayout * pSetLayouts
Definition: vulkan_core.h:3768
VkResult
Definition: vulkan_core.h:140
@ VK_SUCCESS
Definition: vulkan_core.h:141
@ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Definition: vulkan_core.h:236

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