From: Jason Ekstrand Date: Wed, 8 Jul 2015 01:51:53 +0000 (-0700) Subject: vk/vulkan.h: Switch to the split ProcAddr functions in 130 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7acdda184de2d2d21a2413097cf11b2c489b387;p=mesa.git vk/vulkan.h: Switch to the split ProcAddr functions in 130 --- diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 96695e37acd..ee8e4114509 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -1194,6 +1194,7 @@ typedef struct { bool32_t supportsPinning; } VkPhysicalDeviceMemoryProperties; +typedef void (VKAPI *PFN_vkVoidFunction)(void); typedef struct { uint32_t queueNodeIndex; uint32_t queueCount; @@ -1898,7 +1899,8 @@ typedef VkResult (VKAPI *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCrea typedef VkResult (VKAPI *PFN_vkDestroyInstance)(VkInstance instance); typedef VkResult (VKAPI *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceInfo)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceInfoType infoType, size_t* pDataSize, void* pData); -typedef void * (VKAPI *PFN_vkGetProcAddr)(VkPhysicalDevice physicalDevice, const char * pName); +typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); +typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); typedef VkResult (VKAPI *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice); typedef VkResult (VKAPI *PFN_vkDestroyDevice)(VkDevice device); typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionInfo)(VkExtensionInfoType infoType, uint32_t extensionIndex, size_t* pDataSize, void* pData); @@ -2021,8 +2023,12 @@ VkResult VKAPI vkGetPhysicalDeviceInfo( size_t* pDataSize, void* pData); -void * VKAPI vkGetProcAddr( - VkPhysicalDevice physicalDevice, +PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr( + VkInstance instance, + const char* pName); + +PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr( + VkDevice device, const char* pName); VkResult VKAPI vkCreateDevice( diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 53c29cafb3d..22fbb0e6431 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -274,8 +274,15 @@ VkResult anv_GetPhysicalDeviceInfo( } -void * vkGetProcAddr( - VkPhysicalDevice physicalDevice, +PFN_vkVoidFunction anv_GetInstanceProcAddr( + VkInstance instance, + const char* pName) +{ + return anv_lookup_entrypoint(pName); +} + +PFN_vkVoidFunction anv_GetDeviceProcAddr( + VkDevice device, const char* pName) { return anv_lookup_entrypoint(pName); diff --git a/src/vulkan/vk_gen.py b/src/vulkan/vk_gen.py index 9b50dbd766e..d481af74ef0 100644 --- a/src/vulkan/vk_gen.py +++ b/src/vulkan/vk_gen.py @@ -67,6 +67,8 @@ i = 0 for line in fileinput.input(): m = p.match(line) if (m): + if m.group(2) == 'VoidFunction': + continue fullname = "vk" + m.group(2) h = hash(fullname) entrypoints.append((m.group(1), m.group(2), m.group(3), i, h))