diff options
| author | Chia-I Wu <olv@lunarg.com> | 2015-10-26 20:48:51 +0800 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-11-02 13:40:50 -0700 |
| commit | 3dfc13470d037c5681ae716bfbeb65b7e59f9018 (patch) | |
| tree | 57e3af6b43557afbb039eb1c7f53bc6bf63ba3a4 /layers | |
| parent | 3f72dda365a3289d988160b6fdbcaa28dc059a71 (diff) | |
| download | usermoji-3dfc13470d037c5681ae716bfbeb65b7e59f9018.tar.xz | |
bug 14892: 'count' parameters and members named inconsistently in many cases (WIP)
s/waitSemCount/waitSemaphoreCount/g
s/signalSemCount/signalSemaphoreCount/g
s/cmdBufferCount/commandBufferCount/g
s/queueFamilyCount/queueFamilyIndexCount/g
s/layerCount/enabledLayerNameCount/g
s/extensionCount/enabledExtensionNameCount/g
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14892
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/apidump.h | 4 | ||||
| -rw-r--r-- | layers/device_limits.cpp | 8 | ||||
| -rwxr-xr-x | layers/draw_state.cpp | 152 | ||||
| -rwxr-xr-x | layers/draw_state.h | 20 | ||||
| -rw-r--r-- | layers/generic.h | 4 | ||||
| -rw-r--r-- | layers/image.cpp | 2 | ||||
| -rw-r--r-- | layers/mem_tracker.cpp | 12 | ||||
| -rw-r--r-- | layers/object_track.h | 10 | ||||
| -rw-r--r-- | layers/param_checker.cpp | 20 | ||||
| -rw-r--r-- | layers/screenshot.cpp | 8 | ||||
| -rw-r--r-- | layers/shader_checker.cpp | 16 | ||||
| -rw-r--r-- | layers/swapchain.cpp | 8 |
12 files changed, 132 insertions, 132 deletions
diff --git a/layers/apidump.h b/layers/apidump.h index 7eba182a..fb8dcf12 100644 --- a/layers/apidump.h +++ b/layers/apidump.h @@ -78,7 +78,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo pDisp->QueuePresentKHR = (PFN_vkQueuePresentKHR) gpa(device, "vkQueuePresentKHR"); deviceExtMap[pDisp].wsi_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME) == 0) deviceExtMap[pDisp].wsi_enabled = true; @@ -92,7 +92,7 @@ static void createInstanceRegisterExtensions(const VkInstanceCreateInfo* pCreate PFN_vkGetInstanceProcAddr gpa = pDisp->GetInstanceProcAddr; pDisp->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); instanceExtMap[pDisp].wsi_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) instanceExtMap[pDisp].wsi_enabled = true; diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp index c311f5d6..1d686dd1 100644 --- a/layers/device_limits.cpp +++ b/layers/device_limits.cpp @@ -168,7 +168,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCre my_data->report_data = debug_report_create_instance( pTable, *pInstance, - pCreateInfo->extensionCount, + pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); init_device_limits(my_data); @@ -349,7 +349,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); my_data->device_extensions.debug_marker_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], DEBUG_MARKER_EXTENSION_NAME) == 0) { /* Found a matching extension name, mark it enabled and init dispatch table*/ initDebugMarkerTable(device); @@ -405,9 +405,9 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalDevice gpu, const VkDevi if (phy_dev_data->queueFamilyProperties.size() <= requestedIndex) { // requested index is out of bounds for this physical device skipCall |= log_msg(phy_dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PHYSICAL_DEVICE, 0, 0, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL", "Invalid queue create request in vkCreateDevice(). Invalid queueFamilyIndex %u requested.", requestedIndex); - } else if (pCreateInfo->pRequestedQueues[i].queueCount > phy_dev_data->queueFamilyProperties[requestedIndex]->queueCount) { + } else if (pCreateInfo->pRequestedQueues[i].queuePriorityCount > phy_dev_data->queueFamilyProperties[requestedIndex]->queueCount) { skipCall |= log_msg(phy_dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PHYSICAL_DEVICE, 0, 0, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL", - "Invalid queue create request in vkCreateDevice(). QueueFamilyIndex %u only has %u queues, but requested queueCount is %u.", requestedIndex, phy_dev_data->queueFamilyProperties[requestedIndex]->queueCount, pCreateInfo->pRequestedQueues[i].queueCount); + "Invalid queue create request in vkCreateDevice(). QueueFamilyIndex %u only has %u queues, but requested queuePriorityCount is %u.", requestedIndex, phy_dev_data->queueFamilyProperties[requestedIndex]->queueCount, pCreateInfo->pRequestedQueues[i].queuePriorityCount); } } } diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index cb2c46dd..bbcc4b05 100755 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -492,13 +492,13 @@ static PIPELINE_NODE* initPipeline(layer_data* dev_data, const VkGraphicsPipelin memcpy((void*)&pPipeline->vertexInputCI, pCreateInfo->pVertexInputState , sizeof(VkPipelineVertexInputStateCreateInfo)); // Copy embedded ptrs pVICI = pCreateInfo->pVertexInputState; - pPipeline->vtxBindingCount = pVICI->bindingCount; + pPipeline->vtxBindingCount = pVICI->vertexBindingDescriptionCount; if (pPipeline->vtxBindingCount) { pPipeline->pVertexBindingDescriptions = new VkVertexInputBindingDescription[pPipeline->vtxBindingCount]; bufferSize = pPipeline->vtxBindingCount * sizeof(VkVertexInputBindingDescription); memcpy((void*)pPipeline->pVertexBindingDescriptions, pVICI->pVertexBindingDescriptions, bufferSize); } - pPipeline->vtxAttributeCount = pVICI->attributeCount; + pPipeline->vtxAttributeCount = pVICI->vertexAttributeDescriptionCount; if (pPipeline->vtxAttributeCount) { pPipeline->pVertexAttributeDescriptions = new VkVertexInputAttributeDescription[pPipeline->vtxAttributeCount]; bufferSize = pPipeline->vtxAttributeCount * sizeof(VkVertexInputAttributeDescription); @@ -600,7 +600,7 @@ static VkBool32 validatePipelineState(layer_data* my_data, const GLOBAL_CB_NODE* int subpassNumSamples = 0; uint32_t i; - for (i = 0; i < pSD->colorCount; i++) { + for (i = 0; i < pSD->colorAttachmentCount; i++) { uint32_t samples; if (pSD->pColorAttachments[i].attachment == VK_ATTACHMENT_UNUSED) @@ -692,10 +692,10 @@ static uint32_t getUpdateCount(layer_data* my_data, const VkDevice device, const switch (pUpdateStruct->sType) { case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET: - return ((VkWriteDescriptorSet*)pUpdateStruct)->count; + return ((VkWriteDescriptorSet*)pUpdateStruct)->descriptorCount; case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET: // TODO : Need to understand this case better and make sure code is correct - return ((VkCopyDescriptorSet*)pUpdateStruct)->count; + return ((VkCopyDescriptorSet*)pUpdateStruct)->descriptorCount; } } // For given Layout Node and binding, return index where that binding begins @@ -703,7 +703,7 @@ static uint32_t getBindingStartIndex(const LAYOUT_NODE* pLayout, const uint32_t { uint32_t offsetIndex = 0; for (uint32_t i = 0; i<binding; i++) { - offsetIndex += pLayout->createInfo.pBinding[i].arraySize; + offsetIndex += pLayout->createInfo.pBindings[i].arraySize; } return offsetIndex; } @@ -712,7 +712,7 @@ static uint32_t getBindingEndIndex(const LAYOUT_NODE* pLayout, const uint32_t bi { uint32_t offsetIndex = 0; for (uint32_t i = 0; i<=binding; i++) { - offsetIndex += pLayout->createInfo.pBinding[i].arraySize; + offsetIndex += pLayout->createInfo.pBindings[i].arraySize; } return offsetIndex-1; } @@ -790,16 +790,16 @@ static VkBool32 shadowUpdateNode(layer_data* my_data, const VkDevice device, GEN case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: { - VkDescriptorImageInfo *info = new VkDescriptorImageInfo[pWDS->count]; - memcpy(info, pWDS->pImageInfo, pWDS->count * sizeof(VkDescriptorImageInfo)); + VkDescriptorImageInfo *info = new VkDescriptorImageInfo[pWDS->descriptorCount]; + memcpy(info, pWDS->pImageInfo, pWDS->descriptorCount * sizeof(VkDescriptorImageInfo)); pWDS->pImageInfo = info; } break; case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: { - VkBufferView *info = new VkBufferView[pWDS->count]; - memcpy(info, pWDS->pTexelBufferView, pWDS->count * sizeof(VkBufferView)); + VkBufferView *info = new VkBufferView[pWDS->descriptorCount]; + memcpy(info, pWDS->pTexelBufferView, pWDS->descriptorCount * sizeof(VkBufferView)); pWDS->pTexelBufferView = info; } break; @@ -808,8 +808,8 @@ static VkBool32 shadowUpdateNode(layer_data* my_data, const VkDevice device, GEN case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: { - VkDescriptorBufferInfo *info = new VkDescriptorBufferInfo[pWDS->count]; - memcpy(info, pWDS->pBufferInfo, pWDS->count * sizeof(VkDescriptorBufferInfo)); + VkDescriptorBufferInfo *info = new VkDescriptorBufferInfo[pWDS->descriptorCount]; + memcpy(info, pWDS->pBufferInfo, pWDS->descriptorCount * sizeof(VkDescriptorBufferInfo)); pWDS->pBufferInfo = info; } break; @@ -956,12 +956,12 @@ static VkBool32 validateUpdateContents(const layer_data* my_data, const VkWriteD // For given update type, verify that update contents are correct switch (pWDS->descriptorType) { case VK_DESCRIPTOR_TYPE_SAMPLER: - for (i=0; i<pWDS->count; ++i) { + for (i=0; i<pWDS->descriptorCount; ++i) { skipCall |= validateSampler(my_data, &(pWDS->pImageInfo[i].sampler), immutable); } break; case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: - for (i=0; i<pWDS->count; ++i) { + for (i=0; i<pWDS->descriptorCount; ++i) { if (NULL == pLayoutBinding->pImmutableSamplers) { pSampler = &(pWDS->pImageInfo[i].sampler); if (immutable) { @@ -986,13 +986,13 @@ static VkBool32 validateUpdateContents(const layer_data* my_data, const VkWriteD case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: - for (i=0; i<pWDS->count; ++i) { + for (i=0; i<pWDS->descriptorCount; ++i) { skipCall |= validateImageView(my_data, &(pWDS->pImageInfo[i].imageView), pWDS->pImageInfo[i].imageLayout); } break; case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: - for (i=0; i<pWDS->count; ++i) { + for (i=0; i<pWDS->descriptorCount; ++i) { skipCall |= validateBufferView(my_data, &(pWDS->pTexelBufferView[i])); } break; @@ -1000,7 +1000,7 @@ static VkBool32 validateUpdateContents(const layer_data* my_data, const VkWriteD case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: - for (i=0; i<pWDS->count; ++i) { + for (i=0; i<pWDS->descriptorCount; ++i) { skipCall |= validateBufferInfo(my_data, &(pWDS->pBufferInfo[i])); } break; @@ -1029,7 +1029,7 @@ static VkBool32 dsUpdate(layer_data* my_data, VkDevice device, uint32_t writeCou uint32_t binding = 0, endIndex = 0; binding = pWDS[i].destBinding; // Make sure that layout being updated has the binding being updated - if (pLayout->createInfo.count < binding) { + if (pLayout->createInfo.bindingCount < binding) { skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t) ds, 0, DRAWSTATE_INVALID_UPDATE_INDEX, "DS", "Descriptor Set %p does not have binding to match update binding %u for update type %s!", ds, binding, string_VkStructureType(pUpdate->sType)); } else { @@ -1046,7 +1046,7 @@ static VkBool32 dsUpdate(layer_data* my_data, VkDevice device, uint32_t writeCou // Layout bindings match w/ update, now verify that update type & stageFlags are the same for entire update if ((skipCall = validateUpdateConsistency(my_data, device, pLayout, pUpdate, startIndex, endIndex)) == VK_FALSE) { // The update is within bounds and consistent, but need to make sure contents make sense as well - if ((skipCall = validateUpdateContents(my_data, &pWDS[i], &pLayout->createInfo.pBinding[binding])) == VK_FALSE) { + if ((skipCall = validateUpdateContents(my_data, &pWDS[i], &pLayout->createInfo.pBindings[binding])) == VK_FALSE) { // Update is good. Save the update info // Create new update struct for this set's shadow copy GENERIC_HEADER* pNewNode = NULL; @@ -1080,14 +1080,14 @@ static VkBool32 dsUpdate(layer_data* my_data, VkDevice device, uint32_t writeCou pSrcLayout = pSrcSet->pLayout; pDstLayout = pDstSet->pLayout; // Validate that src binding is valid for src set layout - if (pSrcLayout->createInfo.count < pCDS[i].srcBinding) { + if (pSrcLayout->createInfo.bindingCount < pCDS[i].srcBinding) { skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t) pSrcSet->set, 0, DRAWSTATE_INVALID_UPDATE_INDEX, "DS", "Copy descriptor update %u has srcBinding %u which is out of bounds for underlying SetLayout %#" PRIxLEAST64 " which only has bindings 0-%u.", - i, pCDS[i].srcBinding, (uint64_t) pSrcLayout->layout, pSrcLayout->createInfo.count-1); - } else if (pDstLayout->createInfo.count < pCDS[i].destBinding) { + i, pCDS[i].srcBinding, (uint64_t) pSrcLayout->layout, pSrcLayout->createInfo.bindingCount-1); + } else if (pDstLayout->createInfo.bindingCount < pCDS[i].destBinding) { skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t) pDstSet->set, 0, DRAWSTATE_INVALID_UPDATE_INDEX, "DS", "Copy descriptor update %u has destBinding %u which is out of bounds for underlying SetLayout %#" PRIxLEAST64 " which only has bindings 0-%u.", - i, pCDS[i].destBinding, (uint64_t) pDstLayout->layout, pDstLayout->createInfo.count-1); + i, pCDS[i].destBinding, (uint64_t) pDstLayout->layout, pDstLayout->createInfo.bindingCount-1); } else { // Proceed with validation. Bindings are ok, but make sure update is within bounds of given layout srcEndIndex = getUpdateEndIndex(my_data, device, pSrcLayout, pCDS[i].srcBinding, pCDS[i].srcArrayElement, (const GENERIC_HEADER*)&(pCDS[i])); @@ -1105,7 +1105,7 @@ static VkBool32 dsUpdate(layer_data* my_data, VkDevice device, uint32_t writeCou } else { srcStartIndex = getUpdateStartIndex(my_data, device, pSrcLayout, pCDS[i].srcBinding, pCDS[i].srcArrayElement, (const GENERIC_HEADER*)&(pCDS[i])); dstStartIndex = getUpdateStartIndex(my_data, device, pDstLayout, pCDS[i].destBinding, pCDS[i].destArrayElement, (const GENERIC_HEADER*)&(pCDS[i])); - for (uint32_t j=0; j<pCDS[i].count; ++j) { + for (uint32_t j=0; j<pCDS[i].descriptorCount; ++j) { // For copy just make sure that the types match and then perform the update if (pSrcLayout->descriptorTypes[srcStartIndex+j] != pDstLayout->descriptorTypes[dstStartIndex+j]) { skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_DESCRIPTOR_TYPE_MISMATCH, "DS", @@ -1134,13 +1134,13 @@ static VkBool32 validate_descriptor_availability_in_pool(layer_data* dev_data, P "Unable to find set layout node for layout %#" PRIxLEAST64 " specified in vkAllocDescriptorSets() call", (uint64_t) pSetLayouts[i]); } else { uint32_t typeIndex = 0, typeCount = 0; - for (j=0; j<pLayout->createInfo.count; ++j) { - typeIndex = static_cast<uint32_t>(pLayout->createInfo.pBinding[j].descriptorType); - typeCount = pLayout->createInfo.pBinding[j].arraySize; + for (j=0; j<pLayout->createInfo.bindingCount; ++j) { + typeIndex = static_cast<uint32_t>(pLayout->createInfo.pBindings[j].descriptorType); + typeCount = pLayout->createInfo.pBindings[j].arraySize; if (typeCount > pPoolNode->availableDescriptorTypeCount[typeIndex]) { skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, (uint64_t) pLayout->layout, 0, DRAWSTATE_DESCRIPTOR_POOL_EMPTY, "DS", "Unable to allocate %u descriptors of type %s from pool %#" PRIxLEAST64 ". This pool only has %u descriptors of this type remaining.", - typeCount, string_VkDescriptorType(pLayout->createInfo.pBinding[j].descriptorType), (uint64_t) pPoolNode->pool, pPoolNode->availableDescriptorTypeCount[typeIndex]); + typeCount, string_VkDescriptorType(pLayout->createInfo.pBindings[j].descriptorType), (uint64_t) pPoolNode->pool, pPoolNode->availableDescriptorTypeCount[typeIndex]); } else { // Decrement available descriptors of this type pPoolNode->availableDescriptorTypeCount[typeIndex] -= typeCount; } @@ -1237,12 +1237,12 @@ static void deleteLayouts(layer_data* my_data) return; for (auto ii=my_data->layoutMap.begin(); ii!=my_data->layoutMap.end(); ++ii) { LAYOUT_NODE* pLayout = (*ii).second; - if (pLayout->createInfo.pBinding) { - for (uint32_t i=0; i<pLayout->createInfo.count; i++) { - if (pLayout->createInfo.pBinding[i].pImmutableSamplers) - delete[] pLayout->createInfo.pBinding[i].pImmutableSamplers; + if (pLayout->createInfo.pBindings) { + for (uint32_t i=0; i<pLayout->createInfo.bindingCount; i++) { + if (pLayout->createInfo.pBindings[i].pImmutableSamplers) + delete[] pLayout->createInfo.pBindings[i].pImmutableSamplers; } - delete[] pLayout->createInfo.pBinding; + delete[] pLayout->createInfo.pBindings; } delete pLayout; } @@ -1576,7 +1576,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCre my_data->report_data = debug_report_create_instance( pTable, *pInstance, - pCreateInfo->extensionCount, + pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); init_draw_state(my_data); @@ -1616,7 +1616,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo layer_data* dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); dev_data->device_extensions.debug_marker_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], DEBUG_MARKER_EXTENSION_NAME) == 0) { /* Found a matching extension name, mark it enabled and init dispatch table*/ initDebugMarkerTable(device); @@ -1732,7 +1732,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit(VkQueue queue, uint32_t submitCount layer_data* dev_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); for (uint32_t submit_idx = 0; submit_idx < submitCount; submit_idx++) { const VkSubmitInfo *submit = &pSubmitInfo[submit_idx]; - for (uint32_t i=0; i < submit->cmdBufferCount; i++) { + for (uint32_t i=0; i < submit->commandBufferCount; i++) { // Validate that cmd buffers have been updated pCB = getCBNode(dev_data, submit->pCommandBuffers[i]); loader_platform_thread_lock_mutex(&globalLock); @@ -2043,15 +2043,15 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, cons } memset(pNewNode, 0, sizeof(LAYOUT_NODE)); memcpy((void*)&pNewNode->createInfo, pCreateInfo, sizeof(VkDescriptorSetLayoutCreateInfo)); - pNewNode->createInfo.pBinding = new VkDescriptorSetLayoutBinding[pCreateInfo->count]; - memcpy((void*)pNewNode->createInfo.pBinding, pCreateInfo->pBinding, sizeof(VkDescriptorSetLayoutBinding)*pCreateInfo->count); + pNewNode->createInfo.pBindings = new VkDescriptorSetLayoutBinding[pCreateInfo->bindingCount]; + memcpy((void*)pNewNode->createInfo.pBindings, pCreateInfo->pBindings, sizeof(VkDescriptorSetLayoutBinding)*pCreateInfo->bindingCount); uint32_t totalCount = 0; - for (uint32_t i=0; i<pCreateInfo->count; i++) { - totalCount += pCreateInfo->pBinding[i].arraySize; - if (pCreateInfo->pBinding[i].pImmutableSamplers) { - VkSampler** ppIS = (VkSampler**)&pNewNode->createInfo.pBinding[i].pImmutableSamplers; - *ppIS = new VkSampler[pCreateInfo->pBinding[i].arraySize]; - memcpy(*ppIS, pCreateInfo->pBinding[i].pImmutableSamplers, pCreateInfo->pBinding[i].arraySize*sizeof(VkSampler)); + for (uint32_t i=0; i<pCreateInfo->bindingCount; i++) { + totalCount += pCreateInfo->pBindings[i].arraySize; + if (pCreateInfo->pBindings[i].pImmutableSamplers) { + VkSampler** ppIS = (VkSampler**)&pNewNode->createInfo.pBindings[i].pImmutableSamplers; + *ppIS = new VkSampler[pCreateInfo->pBindings[i].arraySize]; + memcpy(*ppIS, pCreateInfo->pBindings[i].pImmutableSamplers, pCreateInfo->pBindings[i].arraySize*sizeof(VkSampler)); } } if (totalCount > 0) { @@ -2059,10 +2059,10 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(VkDevice device, cons pNewNode->stageFlags.resize(totalCount); uint32_t offset = 0; uint32_t j = 0; - for (uint32_t i=0; i<pCreateInfo->count; i++) { - for (j = 0; j < pCreateInfo->pBinding[i].arraySize; j++) { - pNewNode->descriptorTypes[offset + j] = pCreateInfo->pBinding[i].descriptorType; - pNewNode->stageFlags[offset + j] = pCreateInfo->pBinding[i].stageFlags; + for (uint32_t i=0; i<pCreateInfo->bindingCount; i++) { + for (j = 0; j < pCreateInfo->pBindings[i].arraySize; j++) { + pNewNode->descriptorTypes[offset + j] = pCreateInfo->pBindings[i].descriptorType; + pNewNode->stageFlags[offset + j] = pCreateInfo->pBindings[i].stageFlags; } offset += j; } @@ -2085,9 +2085,9 @@ VkResult VKAPI vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCre VkResult result = dev_data->device_dispatch_table->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); if (VK_SUCCESS == result) { PIPELINE_LAYOUT_NODE plNode = dev_data->pipelineLayoutMap[*pPipelineLayout]; - plNode.descriptorSetLayouts.resize(pCreateInfo->descriptorSetCount); + plNode.descriptorSetLayouts.resize(pCreateInfo->setLayoutCount); uint32_t i = 0; - for (i=0; i<pCreateInfo->descriptorSetCount; ++i) { + for (i=0; i<pCreateInfo->setLayoutCount; ++i) { plNode.descriptorSetLayouts[i] = pCreateInfo->pSetLayouts[i]; } plNode.pushConstantRanges.resize(pCreateInfo->pushConstantRangeCount); @@ -2143,7 +2143,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, const VkDe skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (uint64_t) pAllocInfo->descriptorPool, 0, DRAWSTATE_INVALID_POOL, "DS", "Unable to find pool node for pool %#" PRIxLEAST64 " specified in vkAllocDescriptorSets() call", (uint64_t) pAllocInfo->descriptorPool); } else { // Make sure pool has all the available descriptors before calling down chain - skipCall |= validate_descriptor_availability_in_pool(dev_data, pPoolNode, pAllocInfo->count, pAllocInfo->pSetLayouts); + skipCall |= validate_descriptor_availability_in_pool(dev_data, pPoolNode, pAllocInfo->setLayoutCount, pAllocInfo->pSetLayouts); } if (skipCall) return VK_ERROR_VALIDATION_FAILED; @@ -2151,11 +2151,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets(VkDevice device, const VkDe if (VK_SUCCESS == result) { POOL_NODE *pPoolNode = getPoolNode(dev_data, pAllocInfo->descriptorPool); if (pPoolNode) { - if (pAllocInfo->count == 0) { - log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pAllocInfo->count, 0, DRAWSTATE_NONE, "DS", + if (pAllocInfo->setLayoutCount == 0) { + log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pAllocInfo->setLayoutCount, 0, DRAWSTATE_NONE, "DS", "AllocDescriptorSets called with 0 count"); } - for (uint32_t i = 0; i < pAllocInfo->count; i++) { + for (uint32_t i = 0; i < pAllocInfo->setLayoutCount; i++) { log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t) pDescriptorSets[i], 0, DRAWSTATE_NONE, "DS", "Created Descriptor Set %#" PRIxLEAST64, (uint64_t) pDescriptorSets[i]); // Create new set node and add to head of pool nodes @@ -2214,9 +2214,9 @@ VK_LAYER_EXPORT VkResult VKAPI vkFreeDescriptorSets(VkDevice device, VkDescripto SET_NODE* pSet = dev_data->setMap[pDescriptorSets[i]]; // getSetNode() without locking LAYOUT_NODE* pLayout = pSet->pLayout; uint32_t typeIndex = 0, typeCount = 0; - for (uint32_t j=0; j<pLayout->createInfo.count; ++j) { - typeIndex = static_cast<uint32_t>(pLayout->createInfo.pBinding[j].descriptorType); - typeCount = pLayout->createInfo.pBinding[j].arraySize; + for (uint32_t j=0; j<pLayout->createInfo.bindingCount; ++j) { + typeIndex = static_cast<uint32_t>(pLayout->createInfo.pBindings[j].descriptorType); + typeCount = pLayout->createInfo.pBindings[j].arraySize; pPoolNode->availableDescriptorTypeCount[typeIndex] += typeCount; } } @@ -3017,7 +3017,7 @@ VK_LAYER_EXPORT void VKAPI vkCmdClearAttachments( const VkClearAttachment *attachment = &pAttachments[attachment_idx]; if (attachment->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) { VkBool32 found = VK_FALSE; - for (uint32_t i = 0; i < pSD->colorCount; i++) { + for (uint32_t i = 0; i < pSD->colorAttachmentCount; i++) { if (attachment->colorAttachment == pSD->pColorAttachments[i].attachment) { found = VK_TRUE; break; @@ -3344,7 +3344,7 @@ bool CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPa const DAGNode& node = subpass_to_node[index]; // If this node writes to the attachment return true as next nodes need to preserve the attachment. const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[index]; - for (uint32_t j = 0; j < subpass.colorCount; ++j) { + for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) { if (attachment == subpass.pColorAttachments[j].attachment) return true; } @@ -3361,7 +3361,7 @@ bool CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPa if (result && depth > 0) { const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[index]; bool has_preserved = false; - for (uint32_t j = 0; j < subpass.preserveCount; ++j) { + for (uint32_t j = 0; j < subpass.preserveAttachmentCount; ++j) { if (subpass.pPreserveAttachments[j].attachment == attachment) { has_preserved = true; break; @@ -3397,10 +3397,10 @@ bool validateDependencies(const layer_data* my_data, VkDevice device, const VkRe // Find for each attachment the subpasses that use them. for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[i]; - for (uint32_t j = 0; j < subpass.inputCount; ++j) { + for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) { input_attachment_to_subpass[subpass.pInputAttachments[j].attachment].push_back(i); } - for (uint32_t j = 0; j < subpass.colorCount; ++j) { + for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) { output_attachment_to_subpass[subpass.pColorAttachments[j].attachment].push_back(i); } if (subpass.depthStencilAttachment.attachment != VK_ATTACHMENT_UNUSED) { @@ -3411,12 +3411,12 @@ bool validateDependencies(const layer_data* my_data, VkDevice device, const VkRe for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[i]; // If the attachment is an input then all subpasses that output must have a dependency relationship - for (uint32_t j = 0; j < subpass.inputCount; ++j) { + for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) { const uint32_t& attachment = subpass.pInputAttachments[j].attachment; CheckDependencyExists(my_data, device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call); } // If the attachment is an output then all subpasses that use the attachment must have a dependency relationship - for (uint32_t j = 0; j < subpass.colorCount; ++j) { + for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) { const uint32_t& attachment = subpass.pColorAttachments[j].attachment; CheckDependencyExists(my_data, device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call); CheckDependencyExists(my_data, device, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call); @@ -3430,7 +3430,7 @@ bool validateDependencies(const layer_data* my_data, VkDevice device, const VkRe // Loop through implicit dependencies, if this pass reads make sure the attachment is preserved for all passes after it was written. for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[i]; - for (uint32_t j = 0; j < subpass.inputCount; ++j) { + for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) { CheckPreserved(my_data, device, pCreateInfo, i, subpass.pInputAttachments[j].attachment, subpass_to_node, 0, skip_call); } } @@ -3457,30 +3457,30 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRende for (uint32_t i = 0; i < localRPCI->subpassCount; i++) { VkSubpassDescription *subpass = (VkSubpassDescription *) &localRPCI->pSubpasses[i]; - const uint32_t attachmentCount = subpass->inputCount + - subpass->colorCount * (1 + (subpass->pResolveAttachments?1:0)) + - subpass->preserveCount; + const uint32_t attachmentCount = subpass->inputAttachmentCount + + subpass->colorAttachmentCount * (1 + (subpass->pResolveAttachments?1:0)) + + subpass->preserveAttachmentCount; VkAttachmentReference *attachments = new VkAttachmentReference[attachmentCount]; memcpy(attachments, subpass->pInputAttachments, - sizeof(attachments[0]) * subpass->inputCount); + sizeof(attachments[0]) * subpass->inputAttachmentCount); subpass->pInputAttachments = attachments; - attachments += subpass->inputCount; + attachments += subpass->inputAttachmentCount; memcpy(attachments, subpass->pColorAttachments, - sizeof(attachments[0]) * subpass->colorCount); + sizeof(attachments[0]) * subpass->colorAttachmentCount); subpass->pColorAttachments = attachments; - attachments += subpass->colorCount; + attachments += subpass->colorAttachmentCount; if (subpass->pResolveAttachments) { memcpy(attachments, subpass->pResolveAttachments, - sizeof(attachments[0]) * subpass->colorCount); + sizeof(attachments[0]) * subpass->colorAttachmentCount); subpass->pResolveAttachments = attachments; - attachments += subpass->colorCount; + attachments += subpass->colorAttachmentCount; } memcpy(attachments, subpass->pPreserveAttachments, - sizeof(attachments[0]) * subpass->preserveCount); + sizeof(attachments[0]) * subpass->preserveAttachmentCount); subpass->pPreserveAttachments = attachments; } } diff --git a/layers/draw_state.h b/layers/draw_state.h index 053dafe0..20a1b2f9 100755 --- a/layers/draw_state.h +++ b/layers/draw_state.h @@ -179,15 +179,15 @@ typedef struct _POOL_NODE { pool(pool), createInfo(*pCreateInfo), maxSets(pCreateInfo->maxSets), pSets(NULL), maxDescriptorTypeCount(VK_DESCRIPTOR_TYPE_END_RANGE), availableDescriptorTypeCount(VK_DESCRIPTOR_TYPE_END_RANGE) { - if (createInfo.count) { // Shadow type struct from ptr into local struct - size_t typeCountSize = createInfo.count * sizeof(VkDescriptorTypeCount); - createInfo.pTypeCount = new VkDescriptorTypeCount[typeCountSize]; - memcpy((void*)createInfo.pTypeCount, pCreateInfo->pTypeCount, typeCountSize); + if (createInfo.typeCount) { // Shadow type struct from ptr into local struct + size_t typeCountSize = createInfo.typeCount * sizeof(VkDescriptorTypeCount); + createInfo.pTypeCounts = new VkDescriptorTypeCount[typeCountSize]; + memcpy((void*)createInfo.pTypeCounts, pCreateInfo->pTypeCounts, typeCountSize); // Now set max counts for each descriptor type based on count of that type times maxSets int32_t i=0; - for (i=0; i<createInfo.count; ++i) { - uint32_t typeIndex = static_cast<uint32_t>(createInfo.pTypeCount[i].type); - uint32_t typeCount = createInfo.pTypeCount[i].count; + for (i=0; i<createInfo.typeCount; ++i) { + uint32_t typeIndex = static_cast<uint32_t>(createInfo.pTypeCounts[i].type); + uint32_t typeCount = createInfo.pTypeCounts[i].descriptorCount; maxDescriptorTypeCount[typeIndex] += typeCount; } for (i=0; i<maxDescriptorTypeCount.size(); ++i) { @@ -196,12 +196,12 @@ typedef struct _POOL_NODE { availableDescriptorTypeCount[i] = maxDescriptorTypeCount[i]; } } else { - createInfo.pTypeCount = NULL; // Make sure this is NULL so we don't try to clean it up + createInfo.pTypeCounts = NULL; // Make sure this is NULL so we don't try to clean it up } } ~_POOL_NODE() { - if (createInfo.pTypeCount) { - delete[] createInfo.pTypeCount; + if (createInfo.pTypeCounts) { + delete[] createInfo.pTypeCounts; } // TODO : pSets are currently freed in deletePools function which uses freeShadowUpdateTree function // need to migrate that struct to smart ptrs for auto-cleanup diff --git a/layers/generic.h b/layers/generic.h index 69a8970f..c1e56215 100644 --- a/layers/generic.h +++ b/layers/generic.h @@ -86,7 +86,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo pDisp->QueuePresentKHR = (PFN_vkQueuePresentKHR) gpa(device, "vkQueuePresentKHR"); deviceExtMap[pDisp].wsi_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME) == 0) deviceExtMap[pDisp].wsi_enabled = true; @@ -100,7 +100,7 @@ static void createInstanceRegisterExtensions(const VkInstanceCreateInfo* pCreate PFN_vkGetInstanceProcAddr gpa = pDisp->GetInstanceProcAddr; pDisp->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); instanceExtMap[pDisp].wsi_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) instanceExtMap[pDisp].wsi_enabled = true; diff --git a/layers/image.cpp b/layers/image.cpp index a484d645..8ae7a12f 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -119,7 +119,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCre VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); if (result == VK_SUCCESS) { - my_data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, + my_data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); InitImage(my_data); diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index 7412021b..cd606271 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -962,7 +962,7 @@ VkResult VKAPI vkCreateInstance( my_data->report_data = debug_report_create_instance( pTable, *pInstance, - pCreateInfo->extensionCount, + pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); init_mem_tracker(my_data); @@ -984,7 +984,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo pDisp->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) gpa(device, "vkAcquireNextImageKHR"); pDisp->QueuePresentKHR = (PFN_vkQueuePresentKHR) gpa(device, "vkQueuePresentKHR"); my_device_data->wsi_enabled = false; - for (uint32_t i = 0; i < pCreateInfo->extensionCount; i++) { + for (uint32_t i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME) == 0) my_device_data->wsi_enabled = true; } @@ -1137,14 +1137,14 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( printCBList(my_data, queue); for (uint32_t submit_idx = 0; submit_idx < submitCount; submit_idx++) { const VkSubmitInfo *submit = &pSubmitInfo[submit_idx]; - for (uint32_t i = 0; i < submit->cmdBufferCount; i++) { + for (uint32_t i = 0; i < submit->commandBufferCount; i++) { pCBInfo = get_cmd_buf_info(my_data, submit->pCommandBuffers[i]); pCBInfo->fenceId = fenceId; pCBInfo->lastSubmittedFence = fence; pCBInfo->lastSubmittedQueue = queue; } - for (uint32_t i = 0; i < submit->waitSemCount; i++) { + for (uint32_t i = 0; i < submit->waitSemaphoreCount; i++) { VkSemaphore sem = submit->pWaitSemaphores[i]; if (my_data->semaphoreMap.find(sem) != my_data->semaphoreMap.end()) { @@ -1156,7 +1156,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( my_data->semaphoreMap[sem] = MEMTRACK_SEMAPHORE_STATE_WAIT; } } - for (uint32_t i = 0; i < submit->signalSemCount; i++) { + for (uint32_t i = 0; i < submit->signalSemaphoreCount; i++) { VkSemaphore sem = submit->pWaitSemaphores[i]; if (my_data->semaphoreMap.find(sem) != my_data->semaphoreMap.end()) { @@ -1179,7 +1179,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( loader_platform_thread_lock_mutex(&globalLock); for (uint32_t submit_idx = 0; submit_idx < submitCount; submit_idx++) { const VkSubmitInfo *submit = &pSubmitInfo[submit_idx]; - for (uint32_t i = 0; i < submit->waitSemCount; i++) { + for (uint32_t i = 0; i < submit->waitSemaphoreCount; i++) { VkSemaphore sem = submit->pWaitSemaphores[i]; if (my_data->semaphoreMap.find(sem) != my_data->semaphoreMap.end()) { diff --git a/layers/object_track.h b/layers/object_track.h index ea75743c..6969b6fb 100644 --- a/layers/object_track.h +++ b/layers/object_track.h @@ -194,7 +194,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo pDisp->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) gpa(device, "vkAcquireNextImageKHR"); pDisp->QueuePresentKHR = (PFN_vkQueuePresentKHR) gpa(device, "vkQueuePresentKHR"); my_device_data->wsi_enabled = false; - for (uint32_t i = 0; i < pCreateInfo->extensionCount; i++) { + for (uint32_t i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME) == 0) my_device_data->wsi_enabled = true; @@ -210,7 +210,7 @@ static void createInstanceRegisterExtensions(const VkInstanceCreateInfo* pCreate PFN_vkGetInstanceProcAddr gpa = pDisp->GetInstanceProcAddr; pDisp->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); instanceExtMap[pDisp].wsi_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) instanceExtMap[pDisp].wsi_enabled = true; @@ -645,7 +645,7 @@ explicit_CreateInstance( my_data->report_data = debug_report_create_instance( pInstanceTable, *pInstance, - pCreateInfo->extensionCount, + pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); createInstanceRegisterExtensions(pCreateInfo, *pInstance); @@ -826,7 +826,7 @@ explicit_AllocDescriptorSets( loader_platform_thread_lock_mutex(&objLock); skipCall |= validate_object(device, device); skipCall |= validate_object(device, pAllocInfo->descriptorPool); - for (uint32_t i = 0; i < pAllocInfo->count; i++) { + for (uint32_t i = 0; i < pAllocInfo->setLayoutCount; i++) { skipCall |= validate_object(device, pAllocInfo->pSetLayouts[i]); } loader_platform_thread_unlock_mutex(&objLock); @@ -837,7 +837,7 @@ explicit_AllocDescriptorSets( device, pAllocInfo, pDescriptorSets); loader_platform_thread_lock_mutex(&objLock); - for (uint32_t i = 0; i < pAllocInfo->count; i++) { + for (uint32_t i = 0; i < pAllocInfo->setLayoutCount; i++) { create_obj(device, pDescriptorSets[i], VK_OBJECT_TYPE_DESCRIPTOR_SET); } loader_platform_thread_unlock_mutex(&objLock); diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp index 645df9c2..359a8c2e 100644 --- a/layers/param_checker.cpp +++ b/layers/param_checker.cpp @@ -1829,7 +1829,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( if (result == VK_SUCCESS) { layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); - data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, + data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); InitParamChecker(data); @@ -2167,7 +2167,7 @@ bool PreQueueSubmit( bool PostQueueSubmit( VkQueue queue, - uint32_t cmdBufferCount, + uint32_t commandBufferCount, VkFence fence, VkResult result) { @@ -4435,16 +4435,16 @@ bool PreCreateDescriptorSetLayout( "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); return false; } - if(pCreateInfo->pBinding != nullptr) + if(pCreateInfo->pBindings != nullptr) { - if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || - pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) + if(pCreateInfo->pBindings->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || + pCreateInfo->pBindings->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) { log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is an unrecognized enumerator"); return false; } - if(pCreateInfo->pBinding->pImmutableSamplers != nullptr) + if(pCreateInfo->pBindings->pImmutableSamplers != nullptr) { } } @@ -4499,10 +4499,10 @@ bool PreCreateDescriptorPool( "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); return false; } - if(pCreateInfo->pTypeCount != nullptr) + if(pCreateInfo->pTypeCounts != nullptr) { - if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || - pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) + if(pCreateInfo->pTypeCounts->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || + pCreateInfo->pTypeCounts->type > VK_DESCRIPTOR_TYPE_END_RANGE) { log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is an unrecognized enumerator"); @@ -4623,7 +4623,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, pAllocInfo, pDescriptorSets); - PostAllocDescriptorSets(device, pAllocInfo->descriptorPool, pAllocInfo->count, pDescriptorSets, result); + PostAllocDescriptorSets(device, pAllocInfo->descriptorPool, pAllocInfo->setLayoutCount, pDescriptorSets, result); return result; } diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp index 46c015e3..eae5867b 100644 --- a/layers/screenshot.cpp +++ b/layers/screenshot.cpp @@ -248,11 +248,11 @@ static void writePPM( const char *filename, VkImage image1) VkSubmitInfo submit_info; submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submit_info.pNext = NULL; - submit_info.waitSemCount = 0; + submit_info.waitSemaphoreCount = 0; submit_info.pWaitSemaphores = NULL; - submit_info.cmdBufferCount = 1; + submit_info.commandBufferCount = 1; submit_info.pCommandBuffers = &cmdBuffer; - submit_info.signalSemCount = 0; + submit_info.signalSemaphoreCount = 0; submit_info.pSignalSemaphores = NULL; err = pTableQueue->QueueSubmit(queue, 1, &submit_info, nullFence); @@ -327,7 +327,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo pDisp->AcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) gpa(device, "vkAcquireNextImageKHR"); pDisp->QueuePresentKHR = (PFN_vkQueuePresentKHR) gpa(device, "vkQueuePresentKHR"); deviceExtMap[pDisp].wsi_enabled = false; - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME) == 0) deviceExtMap[pDisp].wsi_enabled = true; } diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp index 37bcc682..53efcad7 100644 --- a/layers/shader_checker.cpp +++ b/layers/shader_checker.cpp @@ -111,8 +111,8 @@ struct render_pass { std::vector<VkFormat> color_formats; uint32_t j; - color_formats.reserve(subpass->colorCount); - for (j = 0; j < subpass->colorCount; j++) { + color_formats.reserve(subpass->colorAttachmentCount); + for (j = 0; j < subpass->colorAttachmentCount; j++) { const uint32_t att = subpass->pColorAttachments[j].attachment; const VkFormat format = pCreateInfo->pAttachments[att].format; @@ -148,7 +148,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( loader_platform_thread_lock_mutex(&globalLock); auto& bindings = my_data->descriptor_set_layout_map[*pSetLayout]; bindings = new std::vector<VkDescriptorSetLayoutBinding>( - pCreateInfo->pBinding, pCreateInfo->pBinding + pCreateInfo->count); + pCreateInfo->pBindings, pCreateInfo->pBindings + pCreateInfo->bindingCount); loader_platform_thread_unlock_mutex(&globalLock); } @@ -167,8 +167,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( loader_platform_thread_lock_mutex(&globalLock); auto& layouts = my_data->pipeline_layout_map[*pPipelineLayout]; layouts = new std::vector<std::vector<VkDescriptorSetLayoutBinding>*>(); - layouts->reserve(pCreateInfo->descriptorSetCount); - for (unsigned i = 0; i < pCreateInfo->descriptorSetCount; i++) { + layouts->reserve(pCreateInfo->setLayoutCount); + for (unsigned i = 0; i < pCreateInfo->setLayoutCount; i++) { layouts->push_back(my_data->descriptor_set_layout_map[pCreateInfo->pSetLayouts[i]]); } loader_platform_thread_unlock_mutex(&globalLock); @@ -810,7 +810,7 @@ validate_vi_consistency(layer_data *my_data, VkDevice dev, VkPipelineVertexInput std::unordered_map<uint32_t, VkVertexInputBindingDescription const *> bindings; bool pass = true; - for (unsigned i = 0; i < vi->bindingCount; i++) { + for (unsigned i = 0; i < vi->vertexBindingDescriptionCount; i++) { auto desc = &vi->pVertexBindingDescriptions[i]; auto & binding = bindings[desc->binding]; if (binding) { @@ -843,7 +843,7 @@ validate_vi_against_vs_inputs(layer_data *my_data, VkDevice dev, VkPipelineVerte /* Build index by location */ std::map<uint32_t, VkVertexInputAttributeDescription const *> attribs; if (vi) { - for (unsigned i = 0; i < vi->attributeCount; i++) + for (unsigned i = 0; i < vi->vertexAttributeDescriptionCount; i++) attribs[vi->pVertexAttributeDescriptions[i].location] = &vi->pVertexAttributeDescriptions[i]; } @@ -1184,7 +1184,7 @@ VkResult VKAPI vkCreateInstance( my_data->report_data = debug_report_create_instance( pTable, *pInstance, - pCreateInfo->extensionCount, + pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); init_shader_checker(my_data); diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 46c8aad3..42cf7a83 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -77,7 +77,7 @@ static void createDeviceRegisterExtensions(VkPhysicalDevice physicalDevice, cons // Record whether the WSI device extension was enabled for this VkDevice. // No need to check if the extension was advertised by // vkEnumerateDeviceExtensionProperties(), since the loader handles that. - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME) == 0) { my_data->deviceMap[device].deviceSwapchainExtensionEnabled = true; @@ -101,7 +101,7 @@ static void createInstanceRegisterExtensions(const VkInstanceCreateInfo* pCreate // Record whether the WSI instance extension was enabled for this // VkInstance. No need to check if the extension was advertised by // vkEnumerateInstanceExtensionProperties(), since the loader handles that. - for (i = 0; i < pCreateInfo->extensionCount; i++) { + for (i = 0; i < pCreateInfo->enabledExtensionNameCount; i++) { if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { my_data->instanceMap[instance].swapchainExtensionEnabled = true; @@ -209,7 +209,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCre my_data->report_data = debug_report_create_instance( pTable, *pInstance, - pCreateInfo->extensionCount, + pCreateInfo->enabledExtensionNameCount, pCreateInfo->ppEnabledExtensionNames); // Call the following function after my_data is initialized: createInstanceRegisterExtensions(pCreateInfo, *pInstance); @@ -793,7 +793,7 @@ static VkBool32 validateCreateSwapchainKHR(VkDevice device, const VkSwapchainCre // TODO: Validate the following values: // - pCreateInfo->sharingMode - // - pCreateInfo->queueFamilyCount + // - pCreateInfo->queueFamilyIndexCount // - pCreateInfo->pQueueFamilyIndices // - pCreateInfo->oldSwapchain |
