mirror of
https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
synced 2025-05-24 21:49:23 +00:00
Move vk_safe_struct to VUL
This code was being generated in both Vulkan-ValidationLayers and Vulkan-ExtensionLayer. Further uses are on the horizon so lets stop the copypasta. Also, add functions to manipulate extension lists and pNext chains, since many client layers have been doing that themselves.
This commit is contained in:
parent
d90f5c7eb1
commit
cdd0e00cff
26 changed files with 91119 additions and 68 deletions
scripts/generators
|
@ -44,9 +44,9 @@ typedef struct VkuInstanceDispatchTable_ {
|
|||
''')
|
||||
guard_helper = PlatformGuardHelper()
|
||||
for command in [x for x in self.vk.commands.values() if x.instance]:
|
||||
out.extend(guard_helper.addGuard(command.protect))
|
||||
out.extend(guard_helper.add_guard(command.protect))
|
||||
out.append(f' PFN_{command.name} {command.name[2:]};\n')
|
||||
out.extend(guard_helper.addGuard(None))
|
||||
out.extend(guard_helper.add_guard(None))
|
||||
out.append('} VkuInstanceDispatchTable;\n')
|
||||
|
||||
out.append('''
|
||||
|
@ -54,9 +54,9 @@ typedef struct VkuInstanceDispatchTable_ {
|
|||
typedef struct VkuDeviceDispatchTable_ {
|
||||
''')
|
||||
for command in [x for x in self.vk.commands.values() if x.device]:
|
||||
out.extend(guard_helper.addGuard(command.protect))
|
||||
out.extend(guard_helper.add_guard(command.protect))
|
||||
out.append(f' PFN_{command.name} {command.name[2:]};\n')
|
||||
out.extend(guard_helper.addGuard(None))
|
||||
out.extend(guard_helper.add_guard(None))
|
||||
out.append('} VkuDeviceDispatchTable;\n')
|
||||
|
||||
out.append('''
|
||||
|
@ -67,9 +67,9 @@ static inline void vkuInitDeviceDispatchTable(VkDevice device, VkuDeviceDispatch
|
|||
''')
|
||||
|
||||
for command in [x for x in self.vk.commands.values() if x.device and x.name != 'vkGetDeviceProcAddr']:
|
||||
out.extend(guard_helper.addGuard(command.protect))
|
||||
out.extend(guard_helper.add_guard(command.protect))
|
||||
out.append(f' table->{command.name[2:]} = (PFN_{command.name})gdpa(device, "{command.name}");\n')
|
||||
out.extend(guard_helper.addGuard(None))
|
||||
out.extend(guard_helper.add_guard(None))
|
||||
out.append('}\n')
|
||||
|
||||
out.append('''
|
||||
|
@ -89,9 +89,9 @@ static inline void vkuInitInstanceDispatchTable(VkInstance instance, VkuInstance
|
|||
'vkEnumerateInstanceVersion',
|
||||
'vkGetInstanceProcAddr',
|
||||
]]:
|
||||
out.extend(guard_helper.addGuard(command.protect))
|
||||
out.extend(guard_helper.add_guard(command.protect))
|
||||
out.append(f' table->{command.name[2:]} = (PFN_{command.name})gipa(instance, "{command.name}");\n')
|
||||
out.extend(guard_helper.addGuard(None))
|
||||
out.extend(guard_helper.add_guard(None))
|
||||
out.append('}\n')
|
||||
|
||||
out.append('// clang-format on')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue