diff --git a/include/vulkan/utility/vk_dispatch_table.h b/include/vulkan/utility/vk_dispatch_table.h index 11eb5b3..f85fb55 100644 --- a/include/vulkan/utility/vk_dispatch_table.h +++ b/include/vulkan/utility/vk_dispatch_table.h @@ -15,7 +15,7 @@ typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName); // Instance function pointer dispatch table -typedef struct VulInstanceDispatchTable_ { +typedef struct VkuInstanceDispatchTable_ { PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; PFN_vkCreateInstance CreateInstance; @@ -176,10 +176,10 @@ typedef struct VulInstanceDispatchTable_ { PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX GetPhysicalDeviceScreenPresentationSupportQNX; #endif // VK_USE_PLATFORM_SCREEN_QNX PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV GetPhysicalDeviceOpticalFlowImageFormatsNV; -} VulInstanceDispatchTable; +} VkuInstanceDispatchTable; // Device function pointer dispatch table -typedef struct VulDeviceDispatchTable_ { +typedef struct VkuDeviceDispatchTable_ { PFN_vkGetDeviceProcAddr GetDeviceProcAddr; PFN_vkDestroyDevice DestroyDevice; PFN_vkGetDeviceQueue GetDeviceQueue; @@ -794,9 +794,9 @@ typedef struct VulDeviceDispatchTable_ { PFN_vkCmdDrawMeshTasksEXT CmdDrawMeshTasksEXT; PFN_vkCmdDrawMeshTasksIndirectEXT CmdDrawMeshTasksIndirectEXT; PFN_vkCmdDrawMeshTasksIndirectCountEXT CmdDrawMeshTasksIndirectCountEXT; -} VulDeviceDispatchTable; +} VkuDeviceDispatchTable; -static inline void vulInitDeviceDispatchTable(VkDevice device, VulDeviceDispatchTable *table, PFN_vkGetDeviceProcAddr gdpa) { +static inline void vkuInitDeviceDispatchTable(VkDevice device, VkuDeviceDispatchTable *table, PFN_vkGetDeviceProcAddr gdpa) { memset(table, 0, sizeof(*table)); // Device function pointers table->GetDeviceProcAddr = gdpa; @@ -1415,7 +1415,7 @@ static inline void vulInitDeviceDispatchTable(VkDevice device, VulDeviceDispatch table->CmdDrawMeshTasksIndirectCountEXT = (PFN_vkCmdDrawMeshTasksIndirectCountEXT)gdpa(device, "vkCmdDrawMeshTasksIndirectCountEXT"); } -static inline void vulInitInstanceDispatchTable(VkInstance instance, VulInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gipa) { +static inline void vkuInitInstanceDispatchTable(VkInstance instance, VkuInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gipa) { memset(table, 0, sizeof(*table)); // Instance function pointers table->GetInstanceProcAddr = gipa; diff --git a/scripts/generators/dispatch_table_generator.py b/scripts/generators/dispatch_table_generator.py index 95e0680..2df5e20 100644 --- a/scripts/generators/dispatch_table_generator.py +++ b/scripts/generators/dispatch_table_generator.py @@ -35,7 +35,7 @@ typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance ''') out.append(''' // Instance function pointer dispatch table -typedef struct VulInstanceDispatchTable_ { +typedef struct VkuInstanceDispatchTable_ { PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; ''') @@ -43,20 +43,20 @@ typedef struct VulInstanceDispatchTable_ { out.extend([f'#ifdef {command.protect}\n'] if command.protect else []) out.append(f' PFN_{command.name} {command.name[2:]};\n') out.extend([f'#endif // {command.protect}\n'] if command.protect else []) - out.append('} VulInstanceDispatchTable;\n') + out.append('} VkuInstanceDispatchTable;\n') out.append(''' // Device function pointer dispatch table -typedef struct VulDeviceDispatchTable_ { +typedef struct VkuDeviceDispatchTable_ { ''') for command in [x for x in self.vk.commands.values() if x.device]: out.extend([f'#ifdef {command.protect}\n'] if command.protect else []) out.append(f' PFN_{command.name} {command.name[2:]};\n') out.extend([f'#endif // {command.protect}\n'] if command.protect else []) - out.append('} VulDeviceDispatchTable;\n') + out.append('} VkuDeviceDispatchTable;\n') out.append(''' -static inline void vulInitDeviceDispatchTable(VkDevice device, VulDeviceDispatchTable *table, PFN_vkGetDeviceProcAddr gdpa) { +static inline void vkuInitDeviceDispatchTable(VkDevice device, VkuDeviceDispatchTable *table, PFN_vkGetDeviceProcAddr gdpa) { memset(table, 0, sizeof(*table)); // Device function pointers table->GetDeviceProcAddr = gdpa; @@ -69,7 +69,7 @@ static inline void vulInitDeviceDispatchTable(VkDevice device, VulDeviceDispatch out.append('}\n') out.append(''' -static inline void vulInitInstanceDispatchTable(VkInstance instance, VulInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gipa) { +static inline void vkuInitInstanceDispatchTable(VkInstance instance, VkuInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gipa) { memset(table, 0, sizeof(*table)); // Instance function pointers table->GetInstanceProcAddr = gipa; diff --git a/tests/add_subdirectory/vk_dispatch_table.c b/tests/add_subdirectory/vk_dispatch_table.c index 4145340..34b4693 100644 --- a/tests/add_subdirectory/vk_dispatch_table.c +++ b/tests/add_subdirectory/vk_dispatch_table.c @@ -18,14 +18,14 @@ PFN_vkVoidFunction VKAPI_PTR local_vkGetDeviceProcAddr(VkDevice device, const ch } void vk_dispatch_table() { - VulDeviceDispatchTable device_dispatch_table; - VulInstanceDispatchTable instance_dispatch_table; + VkuDeviceDispatchTable device_dispatch_table; + VkuInstanceDispatchTable instance_dispatch_table; VkInstance instance = VK_NULL_HANDLE; - vulInitInstanceDispatchTable(instance, &instance_dispatch_table, local_vkGetInstanceProcAddr); + vkuInitInstanceDispatchTable(instance, &instance_dispatch_table, local_vkGetInstanceProcAddr); VkDevice device = VK_NULL_HANDLE; - vulInitDeviceDispatchTable(device, &device_dispatch_table, local_vkGetDeviceProcAddr); + vkuInitDeviceDispatchTable(device, &device_dispatch_table, local_vkGetDeviceProcAddr); } diff --git a/tests/vk_dispatch_table/test_interface.cpp b/tests/vk_dispatch_table/test_interface.cpp index 8bafa7e..1cbbc21 100644 --- a/tests/vk_dispatch_table/test_interface.cpp +++ b/tests/vk_dispatch_table/test_interface.cpp @@ -28,18 +28,18 @@ inline PFN_vkVoidFunction local_vkGetDeviceProcAddr(VkDevice device, const char } TEST(test_vk_dispatch_table, cpp_interface) { - VulDeviceDispatchTable device_dispatch_table{}; - VulInstanceDispatchTable instance_dispatch_table{}; + VkuDeviceDispatchTable device_dispatch_table{}; + VkuInstanceDispatchTable instance_dispatch_table{}; VkInstance instance{}; - vulInitInstanceDispatchTable(instance, &instance_dispatch_table, local_vkGetInstanceProcAddr); + vkuInitInstanceDispatchTable(instance, &instance_dispatch_table, local_vkGetInstanceProcAddr); ASSERT_EQ(instance_dispatch_table.GetInstanceProcAddr, local_vkGetInstanceProcAddr); VkDevice device{}; - vulInitDeviceDispatchTable(device, &device_dispatch_table, local_vkGetDeviceProcAddr); + vkuInitDeviceDispatchTable(device, &device_dispatch_table, local_vkGetDeviceProcAddr); ASSERT_EQ(device_dispatch_table.GetDeviceProcAddr, local_vkGetDeviceProcAddr); }