vk/vulkan.h: Switch to the split ProcAddr functions in 130
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 01:51:53 +0000 (18:51 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 01:51:53 +0000 (18:51 -0700)
include/vulkan/vulkan.h
src/vulkan/device.c
src/vulkan/vk_gen.py

index 96695e37acd32e9f7cde932f7b11eeee14898e9a..ee8e41145092350292f33ca8a733af35ca00e37c 100644 (file)
@@ -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(
index 53c29cafb3d3a39f924328e029450e5c4737b397..22fbb0e6431f379e3559b5215e1240bc2ef798b5 100644 (file)
@@ -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);
index 9b50dbd766ee36606b4fa8d2e0da4587ff297b3f..d481af74ef08c34f0dee64bde38b5d651d15e175 100644 (file)
@@ -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))