aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Barbour <tony@LunarG.com>2015-07-10 10:50:45 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-07-17 10:05:19 -0600
commit4efb01f1bcbf9403eaddb428c7684b8ec39344a9 (patch)
tree2186e749400f5eb54a60eef87dfe42992a868bb3
parentc0980d972bffe57c30eaaf149156d9324ae7936d (diff)
downloadusermoji-4efb01f1bcbf9403eaddb428c7684b8ec39344a9.tar.xz
Bug 14248: Add vkFreeDescriptorSets
-rw-r--r--demos/cube.c2
-rw-r--r--demos/tri.c2
-rw-r--r--icd/nulldrv/nulldrv.c10
-rw-r--r--include/vk_layer.h1
-rw-r--r--include/vulkan.h7
-rw-r--r--layers/draw_state.cpp7
-rw-r--r--loader/gpa_helper.h2
-rw-r--r--loader/table_ops.h3
-rw-r--r--loader/trampoline.c9
-rwxr-xr-xvulkan.py6
10 files changed, 47 insertions, 2 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 4e48cf50..ce36b062 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1706,7 +1706,7 @@ static void demo_cleanup(struct demo *demo)
for (i = 0; i < DEMO_BUFFER_COUNT; i++) {
vkDestroyFramebuffer(demo->device, demo->framebuffers[i]);
}
-// vkDestroyDescriptorSet(demo->device, demo->desc_set);
+ vkFreeDescriptorSets(demo->device, demo->desc_pool, 1, &demo->desc_set);
vkDestroyDescriptorPool(demo->device, demo->desc_pool);
vkDestroyDynamicViewportState(demo->device, demo->viewport);
diff --git a/demos/tri.c b/demos/tri.c
index 60650b32..80974875 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -1787,7 +1787,7 @@ static void demo_cleanup(struct demo *demo)
for (i = 0; i < DEMO_BUFFER_COUNT; i++) {
vkDestroyFramebuffer(demo->device, demo->framebuffers[i]);
}
- // vkDestroyDescriptorSet(demo->device, demo->desc_set);
+ vkFreeDescriptorSets(demo->device, demo->desc_pool, 1, &demo->desc_set);
vkDestroyDescriptorPool(demo->device, demo->desc_pool);
if (demo->setup_cmd) {
diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c
index cea36c20..eb35263f 100644
--- a/icd/nulldrv/nulldrv.c
+++ b/icd/nulldrv/nulldrv.c
@@ -2283,6 +2283,16 @@ ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
return ret;
}
+ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
+ VkDevice device,
+ VkDescriptorPool descriptorPool,
+ uint32_t count,
+ const VkDescriptorSet* pDescriptorSets)
+{
+ NULLDRV_LOG_FUNC;
+ return VK_SUCCESS;
+}
+
ICD_EXPORT VkResult VKAPI vkUpdateDescriptorSets(
VkDevice device,
uint32_t writeCount,
diff --git a/include/vk_layer.h b/include/vk_layer.h
index 8cb5f3fa..0881d24f 100644
--- a/include/vk_layer.h
+++ b/include/vk_layer.h
@@ -99,6 +99,7 @@ typedef struct VkLayerDispatchTable_
PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
PFN_vkResetDescriptorPool ResetDescriptorPool;
PFN_vkAllocDescriptorSets AllocDescriptorSets;
+ PFN_vkFreeDescriptorSets FreeDescriptorSets;
PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
PFN_vkCreateDynamicViewportState CreateDynamicViewportState;
PFN_vkDestroyDynamicViewportState DestroyDynamicViewportState;
diff --git a/include/vulkan.h b/include/vulkan.h
index d9bc8590..f2b35c65 100644
--- a/include/vulkan.h
+++ b/include/vulkan.h
@@ -2345,6 +2345,7 @@ typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescript
typedef VkResult (VKAPI *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount);
+typedef VkResult (VKAPI *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets);
typedef VkResult (VKAPI *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
typedef VkResult (VKAPI *PFN_vkCreateDynamicViewportState)(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState);
typedef VkResult (VKAPI *PFN_vkDestroyDynamicViewportState)(VkDevice device, VkDynamicViewportState dynamicViewportState);
@@ -2871,6 +2872,12 @@ VkResult VKAPI vkAllocDescriptorSets(
VkDescriptorSet* pDescriptorSets,
uint32_t* pCount);
+VkResult VKAPI vkFreeDescriptorSets(
+ VkDevice device,
+ VkDescriptorPool descriptorPool,
+ uint32_t count,
+ const VkDescriptorSet* pDescriptorSets);
+
VkResult VKAPI vkUpdateDescriptorSets(
VkDevice device,
uint32_t writeCount,
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index becde6a3..60f65aa0 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -1918,6 +1918,13 @@ VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, VkDescript
return result;
}
+VK_LAYER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets)
+{
+ VkResult result = get_dispatch_table(draw_state_device_table_map, device)->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets);
+ // TODO : Clean up any internal data structures using this obj.
+ return result;
+}
+
VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
{
if (dsUpdate(device, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, writeCount, pDescriptorWrites) &&
diff --git a/loader/gpa_helper.h b/loader/gpa_helper.h
index 04f97dae..a6d88085 100644
--- a/loader/gpa_helper.h
+++ b/loader/gpa_helper.h
@@ -207,6 +207,8 @@ static inline void* globalGetProcAddr(const char *name)
return (void*) vkResetDescriptorPool;
if (!strcmp(name, "AllocDescriptorSets"))
return (void*) vkAllocDescriptorSets;
+ if (!strcmp(name, "FreeDescriptorSets"))
+ return (void*) vkFreeDescriptorSets;
if (!strcmp(name, "UpdateDescriptorSets"))
return (void*) vkUpdateDescriptorSets;
if (!strcmp(name, "CreateDynamicViewportState"))
diff --git a/loader/table_ops.h b/loader/table_ops.h
index df8c2b4a..8e8ce9bf 100644
--- a/loader/table_ops.h
+++ b/loader/table_ops.h
@@ -107,6 +107,7 @@ static inline void loader_init_device_dispatch_table(VkLayerDispatchTable *table
table->DestroyDescriptorPool = (PFN_vkDestroyDescriptorPool) gpa(dev, "vkDestroyDescriptorPool");
table->ResetDescriptorPool = (PFN_vkResetDescriptorPool) gpa(dev, "vkResetDescriptorPool");
table->AllocDescriptorSets = (PFN_vkAllocDescriptorSets) gpa(dev, "vkAllocDescriptorSets");
+ table->FreeDescriptorSets = (PFN_vkFreeDescriptorSets) gpa(dev, "vkFreeDescriptorSets");
table->UpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) gpa(dev, "vkUpdateDescriptorSets");
table->CreateDynamicViewportState = (PFN_vkCreateDynamicViewportState) gpa(dev, "vkCreateDynamicViewportState");
table->DestroyDynamicViewportState = (PFN_vkDestroyDynamicViewportState) gpa(dev, "vkDestroyDynamicViewportState");
@@ -323,6 +324,8 @@ static inline void *loader_lookup_device_dispatch_table(
return (void *) table->ResetDescriptorPool;
if (!strcmp(name, "AllocDescriptorSets"))
return (void *) table->AllocDescriptorSets;
+ if (!strcmp(name, "FreeDescriptorSets"))
+ return (void *) table->FreeDescriptorSets;
if (!strcmp(name, "UpdateDescriptorSets"))
return (void *) table->UpdateDescriptorSets;
if (!strcmp(name, "CreateDynamicViewportState"))
diff --git a/loader/trampoline.c b/loader/trampoline.c
index dbd134fd..13d4e680 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -953,6 +953,15 @@ LOADER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, VkDescriptor
return disp->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount);
}
+LOADER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets)
+{
+ const VkLayerDispatchTable *disp;
+
+ disp = loader_get_dispatch(device);
+
+ return disp->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets);
+}
+
LOADER_EXPORT VkResult VKAPI vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies)
{
const VkLayerDispatchTable *disp;
diff --git a/vulkan.py b/vulkan.py
index 1f638f78..4ef8f418 100755
--- a/vulkan.py
+++ b/vulkan.py
@@ -645,6 +645,12 @@ core = Extension(
Param("VkDescriptorSet*", "pDescriptorSets"),
Param("uint32_t*", "pCount")]),
+ Proto("VkResult", "FreeDescriptorSets",
+ [Param("VkDevice", "device"),
+ Param("VkDescriptorPool", "descriptorPool"),
+ Param("uint32_t", "count"),
+ Param("const VkDescriptorSet*", "pDescriptorSets")]),
+
Proto("VkResult", "UpdateDescriptorSets",
[Param("VkDevice", "device"),
Param("uint32_t", "writeCount"),