aboutsummaryrefslogtreecommitdiff
path: root/layers/param_checker.cpp
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-23 14:21:05 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-10-26 16:24:10 -0600
commit014ded8f27412b0d3d29dc40352d938253a57368 (patch)
tree2c7f67895d02b73a28aef86ff09193fcb1a3d344 /layers/param_checker.cpp
parentabd50880e9bee98cb77aec5186781d4098934e0c (diff)
downloadusermoji-014ded8f27412b0d3d29dc40352d938253a57368.tar.xz
bug-14258: Make descriptor pools and command pools more consistent
Diffstat (limited to 'layers/param_checker.cpp')
-rw-r--r--layers/param_checker.cpp57
1 files changed, 18 insertions, 39 deletions
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 618e0fc4..dc9f8da4 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -4606,20 +4606,11 @@ bool PreCreateDescriptorPool(
bool PostCreateDescriptorPool(
VkDevice device,
- VkDescriptorPoolUsage poolUsage,
uint32_t maxSets,
VkDescriptorPool* pDescriptorPool,
VkResult result)
{
- if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE ||
- poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE)
- {
- log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is an unrecognized enumerator");
- return false;
- }
-
/* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */
if(pDescriptorPool != nullptr)
@@ -4645,7 +4636,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool(
VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
- PostCreateDescriptorPool(device, pCreateInfo->poolUsage, pCreateInfo->maxSets, pDescriptorPool, result);
+ PostCreateDescriptorPool(device, pCreateInfo->maxSets, pDescriptorPool, result);
return result;
}
@@ -4669,9 +4660,10 @@ bool PostResetDescriptorPool(
VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool(
VkDevice device,
- VkDescriptorPool descriptorPool)
+ VkDescriptorPool descriptorPool,
+ VkDescriptorPoolResetFlags flags)
{
- VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool);
+ VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool, flags);
PostResetDescriptorPool(device, descriptorPool, result);
@@ -4692,22 +4684,12 @@ bool PreAllocDescriptorSets(
bool PostAllocDescriptorSets(
VkDevice device,
VkDescriptorPool descriptorPool,
- VkDescriptorSetUsage setUsage,
uint32_t count,
VkDescriptorSet* pDescriptorSets,
VkResult result)
{
- if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE ||
- setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE)
- {
- log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is an unrecognized enumerator");
- return false;
- }
-
-
if(pDescriptorSets != nullptr)
{
}
@@ -4724,17 +4706,14 @@ bool PostAllocDescriptorSets(
VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets(
VkDevice device,
- VkDescriptorPool descriptorPool,
- VkDescriptorSetUsage setUsage,
- uint32_t count,
- const VkDescriptorSetLayout* pSetLayouts,
+ const VkDescriptorSetAllocInfo* pAllocInfo,
VkDescriptorSet* pDescriptorSets)
{
- PreAllocDescriptorSets(device, pSetLayouts);
+ PreAllocDescriptorSets(device, pAllocInfo->pSetLayouts);
- VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets);
+ VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, pAllocInfo, pDescriptorSets);
- PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, result);
+ PostAllocDescriptorSets(device, pAllocInfo->descriptorPool, pAllocInfo->count, pDescriptorSets, result);
return result;
}
@@ -5184,21 +5163,21 @@ VK_LAYER_EXPORT VkResult VKAPI vkResetCommandPool(
bool PreCreateCommandBuffer(
VkDevice device,
- const VkCmdBufferCreateInfo* pCreateInfo)
+ const VkCmdBufferAllocInfo* pCreateInfo)
{
if(pCreateInfo != nullptr)
{
- if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO)
+ if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_ALLOC_INFO)
{
log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator");
+ "vkAllocCommandBuffers parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator");
return false;
}
if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE ||
pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE)
{
log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK",
- "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is an unrecognized enumerator");
+ "vkAllocCommandBuffers parameter, VkCmdBufferLevel pCreateInfo->level, is an unrecognized enumerator");
return false;
}
}
@@ -5218,7 +5197,7 @@ bool PostCreateCommandBuffer(
if(result < VK_SUCCESS)
{
- std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result);
+ std::string reason = "vkAllocCommandBuffers parameter, VkResult result, is " + EnumeratorString(result);
log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str());
return false;
}
@@ -5226,14 +5205,14 @@ bool PostCreateCommandBuffer(
return true;
}
-VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer(
+VK_LAYER_EXPORT VkResult VKAPI vkAllocCommandBuffers(
VkDevice device,
- const VkCmdBufferCreateInfo* pCreateInfo,
+ const VkCmdBufferAllocInfo* pCreateInfo,
VkCmdBuffer* pCmdBuffer)
{
PreCreateCommandBuffer(device, pCreateInfo);
- VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer);
+ VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocCommandBuffers(device, pCreateInfo, pCmdBuffer);
PostCreateCommandBuffer(device, pCmdBuffer, result);
@@ -6804,8 +6783,8 @@ VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, co
return (PFN_vkVoidFunction) vkCmdSetStencilWriteMask;
if (!strcmp(funcName, "vkCmdSetStencilReference"))
return (PFN_vkVoidFunction) vkCmdSetStencilReference;
- if (!strcmp(funcName, "vkCreateCommandBuffer"))
- return (PFN_vkVoidFunction) vkCreateCommandBuffer;
+ if (!strcmp(funcName, "vkAllocCommandBuffers"))
+ return (PFN_vkVoidFunction) vkAllocCommandBuffers;
if (!strcmp(funcName, "vkBeginCommandBuffer"))
return (PFN_vkVoidFunction) vkBeginCommandBuffer;
if (!strcmp(funcName, "vkEndCommandBuffer"))