vulkan.h: Remove vkGetFormatInfo, add features/limits (#12827, v125)
NOTES:
1/ Some layers impact from vkGetFormatInfo ->
vkGetPhysicalDeviceFormatInfo; some checks are currently disabled in
ParamChecker pending discussion on the best way to do this. Similar
checks in Image layer implemented via additional layer_data member
to link back from VkDevice -> VkPhysicalDevice.
2/ VkPhysicalDeviceFeatures, VkPhysicalDeviceLimits members all zero
for now; also some further churn to be done to the contents of these
structures.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 4d05ba1..822cb42 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -644,18 +644,14 @@
return result;
}
-VK_LAYER_EXPORT VkResult VKAPI vkGetFormatInfo(VkDevice device, VkFormat format, VkFormatInfoType infoType, size_t* pDataSize, void* pData)
+VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatInfo(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatInfo)
{
char str[1024];
if (!validate_VkFormat(format)) {
- sprintf(str, "Parameter format to function GetFormatInfo has invalid value of %i.", (int)format);
+ sprintf(str, "Parameter format to function GetPhysicalDeviceFormatInfo has invalid value of %i.", (int)format);
layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
}
- if (!validate_VkFormatInfoType(infoType)) {
- sprintf(str, "Parameter infoType to function GetFormatInfo has invalid value of %i.", (int)infoType);
- layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
- }
- VkResult result = device_dispatch_table(device)->GetFormatInfo(device, format, infoType, pDataSize, pData);
+ VkResult result = instance_dispatch_table(physicalDevice)->GetPhysicalDeviceFormatInfo(physicalDevice, format, pFormatInfo);
return result;
}
@@ -723,6 +719,7 @@
return;
}
+ /*
VkFormatProperties properties;
size_t size = sizeof(properties);
VkResult result = device_dispatch_table(device)->GetFormatInfo(device, pCreateInfo->format,
@@ -742,6 +739,7 @@
layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
return;
}
+ */
// TODO: Can we check device-specific limits?
if (!vk_validate_vkextent3d(&pCreateInfo->extent))
@@ -1568,6 +1566,7 @@
continue;
}
+ /*
VkFormatProperties properties;
size_t size = sizeof(properties);
VkResult result = device_dispatch_table(device)->GetFormatInfo(device, pCreateInfo->pColorFormats[i],
@@ -1589,6 +1588,7 @@
layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", ss.str().c_str());
continue;
}
+ */
}
@@ -1696,6 +1696,7 @@
return;
}
+ /*
VkFormatProperties properties;
size_t size = sizeof(properties);
VkResult result = device_dispatch_table(device)->GetFormatInfo(device, pCreateInfo->depthStencilFormat,
@@ -1715,6 +1716,7 @@
layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
return;
}
+ */
if(!validate_VkImageLayout(pCreateInfo->depthStencilLayout))
{
@@ -1948,8 +1950,6 @@
return (void*) vkCreateQueryPool;
if (!strcmp(name, "GetQueryPoolResults"))
return (void*) vkGetQueryPoolResults;
- if (!strcmp(name, "GetFormatInfo"))
- return (void*) vkGetFormatInfo;
if (!strcmp(name, "CreateBuffer"))
return (void*) vkCreateBuffer;
if (!strcmp(name, "CreateBufferView"))
@@ -2102,6 +2102,8 @@
return (void*) vkGetGlobalExtensionInfo;
if (!strcmp(name, "GetPhysicalDeviceExtensionInfo"))
return (void*) vkGetPhysicalDeviceExtensionInfo;
+ if (!strcmp(name, "GetPhysicalDeviceFormatInfo"))
+ return (void*) vkGetPhysicalDeviceFormatInfo;
return NULL;
}