From f576a3edbd003797df3ca6995160e093f14c9f9d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 21 Jun 2015 22:55:02 +1200 Subject: 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 --- layers/param_checker.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'layers/param_checker.cpp') diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp index 4d05ba17..822cb42d 100644 --- a/layers/param_checker.cpp +++ b/layers/param_checker.cpp @@ -644,18 +644,14 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults(VkDevice device, VkQueryPoo 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 @@ void PreCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo) return; } + /* VkFormatProperties properties; size_t size = sizeof(properties); VkResult result = device_dispatch_table(device)->GetFormatInfo(device, pCreateInfo->format, @@ -742,6 +739,7 @@ void PreCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo) 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 @@ void PreCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateI continue; } + /* VkFormatProperties properties; size_t size = sizeof(properties); VkResult result = device_dispatch_table(device)->GetFormatInfo(device, pCreateInfo->pColorFormats[i], @@ -1589,6 +1588,7 @@ void PreCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateI layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", ss.str().c_str()); continue; } + */ } @@ -1696,6 +1696,7 @@ void PreCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateI return; } + /* VkFormatProperties properties; size_t size = sizeof(properties); VkResult result = device_dispatch_table(device)->GetFormatInfo(device, pCreateInfo->depthStencilFormat, @@ -1715,6 +1716,7 @@ void PreCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateI layerCbMsg(VK_DBG_REPORT_ERROR_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str); return; } + */ if(!validate_VkImageLayout(pCreateInfo->depthStencilLayout)) { @@ -1948,8 +1950,6 @@ static inline void* layer_intercept_proc(const char *name) 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 @@ static inline void* layer_intercept_instance_proc(const char *name) return (void*) vkGetGlobalExtensionInfo; if (!strcmp(name, "GetPhysicalDeviceExtensionInfo")) return (void*) vkGetPhysicalDeviceExtensionInfo; + if (!strcmp(name, "GetPhysicalDeviceFormatInfo")) + return (void*) vkGetPhysicalDeviceFormatInfo; return NULL; } -- cgit v1.2.3