android: enable VK_ANDROID_native_buffer
[mesa.git] / src / intel / vulkan / anv_entrypoints_gen.py
index fbbbf896a6ce6a2eb25af40e2217d08832857235..230671d36aeaedcd12cc9c871231c39512765097 100644 (file)
@@ -233,9 +233,14 @@ string_map_lookup(const char *str)
     % 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:
@@ -274,7 +279,11 @@ anv_entrypoint_is_enabled(int index, uint32_t core_version,
    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':
@@ -423,7 +432,7 @@ class Entrypoint(EntrypointBase):
         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')
@@ -486,9 +495,6 @@ def get_entrypoints(doc, entrypoints_to_defines, start_index):
         if ext_name not in supported_exts:
             continue
 
-        if extension.attrib['supported'] != 'vulkan':
-            continue
-
         ext = supported_exts[ext_name]
         ext.type = extension.attrib['type']
 
@@ -505,8 +511,9 @@ def get_entrypoints_defines(doc):
     """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']