Bug 14644 - vkCreateDescriptorPool should have poolUsage/maxSets as part of VkDescriptorPoolCreateInfo
merge request #342
const VkDescriptorPoolCreateInfo descriptor_pool = {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = NULL,
+ .poolUsage = VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT,
+ .maxSets = 1,
.count = 2,
.pTypeCount = type_counts,
};
VkResult U_ASSERT_ONLY err;
err = vkCreateDescriptorPool(demo->device,
- VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT, 1,
&descriptor_pool, &demo->desc_pool);
assert(!err);
}
const VkDescriptorPoolCreateInfo descriptor_pool = {
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = NULL,
+ .poolUsage = VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT,
+ .maxSets = 1,
.count = 1,
.pTypeCount = &type_count,
};
VkResult U_ASSERT_ONLY err;
err = vkCreateDescriptorPool(demo->device,
- VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT, 1,
&descriptor_pool, &demo->desc_pool);
assert(!err);
}
}
static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
- VkDescriptorPoolUsage usage,
- uint32_t max_sets,
const VkDescriptorPoolCreateInfo *info,
struct nulldrv_desc_pool **pool_ret)
{
}
ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
- VkDevice device,
- VkDescriptorPoolUsage poolUsage,
- uint32_t maxSets,
- const VkDescriptorPoolCreateInfo* pCreateInfo,
- VkDescriptorPool* pDescriptorPool)
+ VkDevice device,
+ const VkDescriptorPoolCreateInfo* pCreateInfo,
+ VkDescriptorPool* pDescriptorPool)
{
NULLDRV_LOG_FUNC;
struct nulldrv_dev *dev = nulldrv_dev(device);
- return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
+ return nulldrv_desc_pool_create(dev, pCreateInfo,
(struct nulldrv_desc_pool **) pDescriptorPool);
}
((major << 22) | (minor << 12) | patch)
// Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 168, 0)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 169, 0)
#if defined(__cplusplus) && (_MSC_VER >= 1800 || __cplusplus >= 201103L)
typedef struct {
VkStructureType sType;
const void* pNext;
+ VkDescriptorPoolUsage poolUsage;
+ uint32_t maxSets;
uint32_t count;
const VkDescriptorTypeCount* pTypeCount;
} VkDescriptorPoolCreateInfo;
typedef void (VKAPI *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler);
typedef VkResult (VKAPI *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
typedef void (VKAPI *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout);
-typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
+typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
typedef void (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);
VkResult VKAPI vkCreateDescriptorPool(
VkDevice device,
- VkDescriptorPoolUsage poolUsage,
- uint32_t maxSets,
const VkDescriptorPoolCreateInfo* pCreateInfo,
VkDescriptorPool* pDescriptorPool);
return result;
}
-VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
+VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
{
- VkResult result = get_dispatch_table(draw_state_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+ VkResult result = get_dispatch_table(draw_state_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
if (VK_SUCCESS == result) {
// Insert this pool into Global Pool LL at head
if (log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (*pDescriptorPool).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
pNewNode->createInfo.pTypeCount = new VkDescriptorTypeCount[typeCountSize];
memcpy((void*)pNewNode->createInfo.pTypeCount, pCreateInfo->pTypeCount, typeCountSize);
}
- pNewNode->poolUsage = poolUsage;
- pNewNode->maxSets = maxSets;
+ pNewNode->poolUsage = pCreateInfo->poolUsage;
+ pNewNode->maxSets = pCreateInfo->maxSets;
pNewNode->pool = *pDescriptorPool;
poolMap[pDescriptorPool->handle] = pNewNode;
}
return false;
}
+ /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */
if(pDescriptorPool != nullptr)
{
VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(
VkDevice device,
- VkDescriptorPoolUsage poolUsage,
- uint32_t maxSets,
const VkDescriptorPoolCreateInfo* pCreateInfo,
VkDescriptorPool* pDescriptorPool)
{
PreCreateDescriptorPool(device, pCreateInfo);
- VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+ VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
- PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result);
+ PostCreateDescriptorPool(device, pCreateInfo->poolUsage, pCreateInfo->maxSets, pDescriptorPool, result);
return result;
}
disp->DestroyDescriptorSetLayout(device, descriptorSetLayout);
}
-LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
+LOADER_EXPORT VkResult VKAPI vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool)
{
const VkLayerDispatchTable *disp;
disp = loader_get_dispatch(device);
- return disp->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+ return disp->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
}
LOADER_EXPORT void VKAPI vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool)
Proto("VkResult", "CreateDescriptorPool",
[Param("VkDevice", "device"),
- Param("VkDescriptorPoolUsage", "poolUsage"),
- Param("uint32_t", "maxSets"),
Param("const VkDescriptorPoolCreateInfo*", "pCreateInfo"),
Param("VkDescriptorPool*", "pDescriptorPool")]),