Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
VulkanDescriptorSet.cpp
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
9
12
13namespace skgpu::graphite {
14
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}
34
36 VkDescriptorSet set,
38 : Resource(ctxt,
41 /*gpuMemorySize=*/0,
42 /*label=*/"VulkanDescriptorSet")
43 , fDescSet (set)
44 , fPool (pool) {
45 fPool->ref();
46}
47
49 fPool->unref();
50}
51
52} // namespace skgpu::graphite
AutoreleasePool pool
#define VULKAN_CALL_RESULT(SHARED_CONTEXT, RESULT, X)
VulkanDescriptorSet(const VulkanSharedContext *, VkDescriptorSet, sk_sp< VulkanDescriptorPool >)
static sk_sp< VulkanDescriptorSet > Make(const VulkanSharedContext *, const sk_sp< VulkanDescriptorPool > &)
GAsyncResult * result
Budgeted
Definition GpuTypes.h:35
VkDescriptorPool descriptorPool
const VkDescriptorSetLayout * pSetLayouts
VkResult
@ VK_SUCCESS
@ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO