+/** Return true if the core version or extension in which the given entrypoint
+ * is defined is enabled.
+ *
+ * If device is NULL, all device extensions are considered enabled.
+ */
+bool
+anv_device_entrypoint_is_enabled(int index, uint32_t core_version,
+ const struct anv_instance_extension_table *instance,
+ const struct anv_device_extension_table *device)
+{
+ switch (index) {
+% for e in device_entrypoints:
+ case ${e.num}:
+ /* ${e.name} */
+ % if e.core_version:
+ return ${e.core_version.c_vk_version()} <= core_version;
+ % elif e.extensions:
+ % for ext in e.extensions:
+ % if ext.type == 'instance':
+ <% assert False %>
+ % else:
+ if (!device || device->${ext.name[3:]}) return true;
+ % endif
+ % endfor
+ return false;
+ % else:
+ return true;
+ % endif
+% endfor
+ default:
+ return false;
+ }
+}
+
+int
+anv_get_instance_entrypoint_index(const char *name)
+{
+ return instance_string_map_lookup(name);
+}
+
+int
+anv_get_physical_device_entrypoint_index(const char *name)
+{
+ return physical_device_string_map_lookup(name);
+}
+
+int
+anv_get_device_entrypoint_index(const char *name)
+{
+ return device_string_map_lookup(name);
+}
+
+const char *
+anv_get_instance_entry_name(int index)
+{
+ return instance_entry_name(index);
+}
+
+const char *
+anv_get_physical_device_entry_name(int index)
+{
+ return physical_device_entry_name(index);
+}
+
+const char *
+anv_get_device_entry_name(int index)
+{
+ return device_entry_name(index);
+}
+
+void * __attribute__ ((noinline))
+anv_resolve_device_entrypoint(const struct gen_device_info *devinfo, uint32_t index)
+{
+ const struct anv_device_dispatch_table *genX_table;