% if e.params[0].type == 'VkDevice':
ANV_FROM_HANDLE(anv_device, anv_device, ${e.params[0].name});
return anv_device->dispatch.${e.name}(${e.call_params()});
- % else:
+ % elif e.params[0].type == 'VkCommandBuffer':
ANV_FROM_HANDLE(anv_cmd_buffer, anv_cmd_buffer, ${e.params[0].name});
return anv_cmd_buffer->device->dispatch.${e.name}(${e.call_params()});
+ % elif e.params[0].type == 'VkQueue':
+ ANV_FROM_HANDLE(anv_queue, anv_queue, ${e.params[0].name});
+ return anv_queue->device->dispatch.${e.name}(${e.call_params()});
+ % else:
+ assert(!"Unhandled device child trampoline case: ${e.params[0].type}");
% endif
}
% if e.guard is not None:
case ${e.num}:
/* ${e.name} */
% if e.core_version:
- return ${e.core_version.c_vk_version()} <= core_version;
+ % if e.is_device_entrypoint():
+ return ${e.core_version.c_vk_version()} <= core_version;
+ % else:
+ return !device && ${e.core_version.c_vk_version()} <= core_version;
+ % endif
% elif e.extensions:
% for ext in e.extensions:
% if ext.type == 'instance':
self.guard = guard
def is_device_entrypoint(self):
- return self.params[0].type in ('VkDevice', 'VkCommandBuffer')
+ return self.params[0].type in ('VkDevice', 'VkCommandBuffer', 'VkQueue')
def prefixed_name(self, prefix):
assert self.name.startswith('vk')
if ext_name not in supported_exts:
continue
- if extension.attrib['supported'] != 'vulkan':
- continue
-
ext = supported_exts[ext_name]
ext.type = extension.attrib['type']
"""Maps entry points to extension defines."""
entrypoints_to_defines = {}
- for extension in doc.findall('./extensions/extension[@protect]'):
- define = extension.attrib['protect']
+ for extension in doc.findall('./extensions/extension[@platform]'):
+ platform = extension.attrib['platform']
+ define = 'VK_USE_PLATFORM_' + platform.upper() + '_KHR'
for entrypoint in extension.findall('./require/command'):
fullname = entrypoint.attrib['name']