vulkan.h: Refactoring physical device sparse properties and limits, bug# 13139

Part of changes for header revision V161.
diff --git a/include/vk_layer.h b/include/vk_layer.h
index 721dfb2..651702d 100644
--- a/include/vk_layer.h
+++ b/include/vk_layer.h
@@ -188,7 +188,6 @@
     PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
     PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties;
     PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
-    PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits;
     PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
     PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
     PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
diff --git a/include/vulkan.h b/include/vulkan.h
index a053269..d1e4727 100644
--- a/include/vulkan.h
+++ b/include/vulkan.h
@@ -1198,7 +1198,7 @@
     VkBool32                                    shaderResourceResidency;
     VkBool32                                    shaderResourceMinLOD;
     VkBool32                                    alphaToOne;
-    VkBool32                                    sparse;
+    VkBool32                                    sparseBinding;
     VkBool32                                    sparseResidencyBuffer;
     VkBool32                                    sparseResidencyImage2D;
     VkBool32                                    sparseResidencyImage3D;
@@ -1206,12 +1206,6 @@
     VkBool32                                    sparseResidency4Samples;
     VkBool32                                    sparseResidency8Samples;
     VkBool32                                    sparseResidency16Samples;
-    VkBool32                                    sparseResidencyStandard2DBlockShape;
-    VkBool32                                    sparseResidencyStandard2DMSBlockShape;
-    VkBool32                                    sparseResidencyStandard3DBlockShape;
-    VkBool32                                    sparseResidencyAlignedMipSize;
-    VkBool32                                    sparseResidencyNonResident;
-    VkBool32                                    sparseResidencyNonResidentStrict;
     VkBool32                                    sparseResidencyAliased;
 } VkPhysicalDeviceFeatures;
 
@@ -1324,6 +1318,15 @@
 } VkPhysicalDeviceLimits;
 
 typedef struct {
+    VkBool32                                    sparseResidencyStandard2DBlockShape;
+    VkBool32                                    sparseResidencyStandard2DMSBlockShape;
+    VkBool32                                    sparseResidencyStandard3DBlockShape;
+    VkBool32                                    sparseResidencyAlignedMipSize;
+    VkBool32                                    sparseResidencyNonResident;
+    VkBool32                                    sparseResidencyNonResidentStrict;
+} VkPhysicalDeviceSparseProperties;
+
+typedef struct {
     uint32_t                                    apiVersion;
     uint32_t                                    driverVersion;
     uint32_t                                    vendorId;
@@ -1331,6 +1334,8 @@
     VkPhysicalDeviceType                        deviceType;
     char                                        deviceName[VK_MAX_PHYSICAL_DEVICE_NAME];
     uint8_t                                     pipelineCacheUUID[VK_UUID_LENGTH];
+    VkPhysicalDeviceLimits                      limits;
+    VkPhysicalDeviceSparseProperties            sparseProperties;
 } VkPhysicalDeviceProperties;
 
 typedef struct {
@@ -2110,7 +2115,6 @@
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceLimits)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkQueueFamilyProperties* pQueueFamilyProperties);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
@@ -2290,10 +2294,6 @@
     VkImageUsageFlags                           usage,
     VkImageFormatProperties*                    pImageFormatProperties);
 
-VkResult VKAPI vkGetPhysicalDeviceLimits(
-    VkPhysicalDevice                            physicalDevice,
-    VkPhysicalDeviceLimits*                     pLimits);
-
 VkResult VKAPI vkGetPhysicalDeviceProperties(
     VkPhysicalDevice                            physicalDevice,
     VkPhysicalDeviceProperties*                 pProperties);
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 3d3ad0c..3194f89 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -2232,37 +2232,6 @@
     return result;
 }
 
-bool PostGetPhysicalDeviceLimits(
-    VkPhysicalDevice physicalDevice,
-    VkPhysicalDeviceLimits* pLimits,
-    VkResult result)
-{
-
-    if(pLimits != nullptr)
-    {
-    }
-
-    if(result < VK_SUCCESS)
-    {
-        std::string reason = "vkGetPhysicalDeviceLimits parameter, VkResult result, is " + EnumeratorString(result);
-        log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str());
-        return false;
-    }
-
-    return true;
-}
-
-VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits(
-    VkPhysicalDevice physicalDevice,
-    VkPhysicalDeviceLimits* pLimits)
-{
-    VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceLimits(physicalDevice, pLimits);
-
-    PostGetPhysicalDeviceLimits(physicalDevice, pLimits, result);
-
-    return result;
-}
-
 bool PostGetPhysicalDeviceProperties(
     VkPhysicalDevice physicalDevice,
     VkPhysicalDeviceProperties* pProperties,
@@ -8489,8 +8458,6 @@
         return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures;
     if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties"))
         return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties;
-    if (!strcmp(funcName, "vkGetPhysicalDeviceLimits"))
-        return (PFN_vkVoidFunction) vkGetPhysicalDeviceLimits;
     if (!strcmp(funcName, "vkGetGlobalLayerProperties"))
         return (PFN_vkVoidFunction) vkGetGlobalLayerProperties;
     if (!strcmp(funcName, "vkGetGlobalExtensionProperties"))
diff --git a/loader/gpa_helper.h b/loader/gpa_helper.h
index 17fd9ad..fe6449a 100644
--- a/loader/gpa_helper.h
+++ b/loader/gpa_helper.h
@@ -43,8 +43,6 @@
         return (void*) vkGetPhysicalDeviceFormatProperties;
     if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
         return (void*) vkGetPhysicalDeviceImageFormatProperties;
-    if (!strcmp(name, "GetPhysicalDeviceLimits"))
-        return (void*) vkGetPhysicalDeviceLimits;
     if (!strcmp(name, "GetPhysicalDeviceProperties"))
         return (void*) vkGetPhysicalDeviceProperties;
     if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
@@ -366,8 +364,6 @@
         return (void*) vkGetPhysicalDeviceFormatProperties;
     if (!strcmp(name, "GetPhysicalDeviceImageFormatProperties"))
         return (void*) vkGetPhysicalDeviceImageFormatProperties;
-    if (!strcmp(name, "GetPhysicalDeviceLimits"))
-        return (void*) vkGetPhysicalDeviceLimits;
     if (!strcmp(name, "GetPhysicalDeviceQueueFamilyProperties"))
         return (void*) vkGetPhysicalDeviceQueueFamilyProperties;
     if (!strcmp(name, "GetPhysicalDeviceMemoryProperties"))
diff --git a/loader/loader.c b/loader/loader.c
index daf428a..18a4a2a 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -95,7 +95,6 @@
     .GetPhysicalDeviceFeatures = loader_GetPhysicalDeviceFeatures,
     .GetPhysicalDeviceFormatProperties = loader_GetPhysicalDeviceFormatProperties,
     .GetPhysicalDeviceImageFormatProperties = loader_GetPhysicalDeviceImageFormatProperties,
-    .GetPhysicalDeviceLimits = loader_GetPhysicalDeviceLimits,
     .GetPhysicalDeviceProperties = loader_GetPhysicalDeviceProperties,
     .GetPhysicalDeviceQueueFamilyProperties = loader_GetPhysicalDeviceQueueFamilyProperties,
     .GetPhysicalDeviceMemoryProperties = loader_GetPhysicalDeviceMemoryProperties,
@@ -1115,7 +1114,6 @@
     LOOKUP_GIPA(GetPhysicalDeviceFeatures, true);
     LOOKUP_GIPA(GetPhysicalDeviceFormatProperties, true);
     LOOKUP_GIPA(GetPhysicalDeviceImageFormatProperties, true);
-    LOOKUP_GIPA(GetPhysicalDeviceLimits, true);
     LOOKUP_GIPA(CreateDevice, true);
     LOOKUP_GIPA(GetPhysicalDeviceProperties, true);
     LOOKUP_GIPA(GetPhysicalDeviceMemoryProperties, true);
@@ -2878,20 +2876,6 @@
     return res;
 }
 
-VkResult VKAPI loader_GetPhysicalDeviceLimits(
-        VkPhysicalDevice                        physicalDevice,
-        VkPhysicalDeviceLimits*                 pLimits)
-{
-    uint32_t gpu_index;
-    struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index);
-    VkResult res = VK_ERROR_INITIALIZATION_FAILED;
-
-    if (icd->GetPhysicalDeviceLimits)
-        res = icd->GetPhysicalDeviceLimits(physicalDevice, pLimits);
-
-    return res;
-}
-
 VkResult VKAPI loader_GetPhysicalDeviceSparseImageFormatProperties(
         VkPhysicalDevice                        physicalDevice,
         VkFormat                                format,
diff --git a/loader/loader.h b/loader/loader.h
index d719640..bcaf998 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -135,7 +135,6 @@
     PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
     PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
     PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties;
-    PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits;
     PFN_vkCreateDevice CreateDevice;
     PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
     PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
@@ -296,10 +295,6 @@
         VkImageUsageFlags                       usage,
         VkImageFormatProperties*                pImageFormatProperties);
 
-VkResult VKAPI loader_GetPhysicalDeviceLimits(
-        VkPhysicalDevice                        physicalDevice,
-        VkPhysicalDeviceLimits*                 pLimits);
-
 VkResult VKAPI loader_GetPhysicalDeviceSparseImageFormatProperties(
         VkPhysicalDevice                        physicalDevice,
         VkFormat                                format,
diff --git a/loader/table_ops.h b/loader/table_ops.h
index 75c7b7a..09823a6 100644
--- a/loader/table_ops.h
+++ b/loader/table_ops.h
@@ -493,7 +493,6 @@
     table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) gpa(inst, "vkGetPhysicalDeviceFeatures");
     table->GetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties) gpa(inst, "vkGetPhysicalDeviceImageFormatProperties");
     table->GetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties) gpa(inst, "vkGetPhysicalDeviceFormatProperties");
-    table->GetPhysicalDeviceLimits = (PFN_vkGetPhysicalDeviceLimits) gpa(inst, "vkGetPhysicalDeviceLimits");
     table->GetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties) gpa(inst, "vkGetPhysicalDeviceSparseImageFormatProperties");
     table->GetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) gpa(inst, "vkGetPhysicalDeviceProperties");
     table->GetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties) gpa(inst, "vkGetPhysicalDeviceQueueFamilyProperties");
@@ -531,8 +530,6 @@
         return (void *) table->GetPhysicalDeviceImageFormatProperties;
     if (!strcmp(name, "GetPhysicalDeviceFormatProperties"))
         return (void *) table->GetPhysicalDeviceFormatProperties;
-    if (!strcmp(name, "GetPhysicalDeviceLimits"))
-        return (void *) table->GetPhysicalDeviceLimits;
     if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties"))
         return (void *) table->GetPhysicalDeviceSparseImageFormatProperties;
     if (!strcmp(name, "GetPhysicalDeviceProperties"))
diff --git a/loader/trampoline.c b/loader/trampoline.c
index f2926b7..33971c3 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -257,18 +257,6 @@
     return res;
 }
 
-LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits(
-                                            VkPhysicalDevice gpu,
-                                            VkPhysicalDeviceLimits *pLimits)
-{
-    const VkLayerInstanceDispatchTable *disp;
-    VkResult res;
-
-    disp = loader_get_instance_dispatch(gpu);
-    res = disp->GetPhysicalDeviceLimits(gpu, pLimits);
-    return res;
-}
-
 LOADER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
                                             VkPhysicalDevice gpu,
                                             VkPhysicalDeviceProperties* pProperties)
diff --git a/vulkan.py b/vulkan.py
index 1847bd5..47c5079 100755
--- a/vulkan.py
+++ b/vulkan.py
@@ -246,10 +246,6 @@
              Param("VkImageUsageFlags", "usage"),
              Param("VkImageFormatProperties*", "pImageFormatProperties")]),
 
-        Proto("VkResult", "GetPhysicalDeviceLimits",
-            [Param("VkPhysicalDevice", "physicalDevice"),
-             Param("VkPhysicalDeviceLimits*", "pLimits")]),
-
         Proto("PFN_vkVoidFunction", "GetInstanceProcAddr",
             [Param("VkInstance", "instance"),
              Param("const char*", "pName")]),