vulkan: Drop vk_android_native_buffer.xml
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 10 Apr 2018 05:01:14 +0000 (22:01 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 11 Apr 2018 02:29:49 +0000 (19:29 -0700)
All the information in vk_android_native_buffer.xml is now in vk.xml.
The only exception is the extension type attribute which we can work
around in the generators while we wait for the XML to be fixed.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
12 files changed:
src/Makefile.am
src/amd/vulkan/Makefile.am
src/amd/vulkan/meson.build
src/amd/vulkan/radv_extensions.py
src/intel/Android.vulkan.mk
src/intel/Makefile.vulkan.am
src/intel/vulkan/anv_extensions_gen.py
src/intel/vulkan/meson.build
src/vulkan/Android.mk
src/vulkan/Makefile.am
src/vulkan/meson.build
src/vulkan/registry/vk_android_native_buffer.xml [deleted file]

index 014ffaf3e29c8a0247729e8140503e6be35195b1..fd5ae445502c710c726e9c4ec30427f66b60b841 100644 (file)
@@ -67,7 +67,6 @@ SUBDIRS += vulkan
 endif
 
 EXTRA_DIST += vulkan/registry/vk.xml
-EXTRA_DIST += vulkan/registry/vk_android_native_buffer.xml
 
 if HAVE_AMD_DRIVERS
 SUBDIRS += amd
index 00b808229fa52531877e68ad67af524377fa97ea..18f263ab44746f6fe095246aa5ab6d51af4c7740 100644 (file)
@@ -117,13 +117,11 @@ nodist_EXTRA_libvulkan_radeon_la_SOURCES = dummy.cpp
 libvulkan_radeon_la_SOURCES = $(VULKAN_GEM_FILES)
 
 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
-vk_android_native_buffer_xml = $(top_srcdir)/src/vulkan/registry/vk_android_native_buffer.xml
 
 radv_entrypoints.c: radv_entrypoints_gen.py radv_extensions.py $(vulkan_api_xml)
        $(MKDIR_GEN)
        $(AM_V_GEN)$(PYTHON2) $(srcdir)/radv_entrypoints_gen.py \
                --xml $(vulkan_api_xml) \
-               --xml $(vk_android_native_buffer_xml) \
                --outdir $(builddir)
 radv_entrypoints.h: radv_entrypoints.c
 
@@ -132,7 +130,6 @@ radv_extensions.c: radv_extensions.py \
        $(MKDIR_GEN)
        $(AM_V_GEN)$(PYTHON2) $(srcdir)/radv_extensions.py \
                --xml $(vulkan_api_xml) \
-               --xml $(vk_android_native_buffer_xml) \
                --out-c radv_extensions.c \
                --out-h radv_extensions.h
 radv_extensions.h: radv_extensions.c
index c3a6a8182b817a9c500e7878e3d91a76402bd61c..b5a99fe91e126bd002b1e2c3582b8f2e22998056 100644 (file)
@@ -31,10 +31,10 @@ radv_entrypoints = custom_target(
 
 radv_extensions_c = custom_target(
   'radv_extensions.c',
-  input : ['radv_extensions.py', vk_api_xml, vk_android_native_buffer_xml],
+  input : ['radv_extensions.py', vk_api_xml],
   output : ['radv_extensions.c', 'radv_extensions.h'],
   command : [
-    prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--xml', '@INPUT2@', '--out-c', '@OUTPUT0@',
+    prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
     '--out-h', '@OUTPUT1@'
   ],
 )
index a25db637e2b84d817266926266421fb69599d024..a680f42dec75afc834cd8bf7227b4d9263239b8c 100644 (file)
@@ -159,18 +159,13 @@ def _init_exts_from_xml(xml):
         if ext_name not in ext_name_map:
             continue
 
-        # Workaround for VK_ANDROID_native_buffer. Its <extension> element in
-        # vk.xml lists it as supported="disabled" and provides only a stub
-        # definition.  Its <extension> element in Mesa's custom
-        # vk_android_native_buffer.xml, though, lists it as
-        # supported='android-vendor' and fully defines the extension. We want
-        # to skip the <extension> element in vk.xml.
-        if ext_elem.attrib['supported'] == 'disabled':
-            assert ext_name == 'VK_ANDROID_native_buffer'
-            continue
-
         ext = ext_name_map[ext_name]
-        ext.type = ext_elem.attrib['type']
+        if ext_name == 'VK_ANDROID_native_buffer':
+            # VK_ANDROID_native_buffer is missing the type specifier.  Just
+            # hard-code it to be a device extension for now.
+            ext.type = 'device'
+        else:
+            ext.type = ext_elem.attrib['type']
 
 _TEMPLATE_H = Template(COPYRIGHT + """
 #ifndef RADV_EXTENSIONS_H
index 0ec0d78a2f03f6518f58b543d7bc69598d087fcd..09dc22875a1f3c1da9b32492de43a3b951516acd 100644 (file)
@@ -67,8 +67,7 @@ $(intermediates)/vulkan/dummy.c:
 $(intermediates)/vulkan/anv_entrypoints.h: $(intermediates)/vulkan/dummy.c
        $(VK_ENTRYPOINTS_SCRIPT) \
                --outdir $(dir $@) \
-               --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \
-               --xml $(MESA_TOP)/src/vulkan/registry/vk_android_native_buffer.xml
+               --xml $(MESA_TOP)/src/vulkan/registry/vk.xml
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
         $(intermediates)
@@ -245,21 +244,18 @@ $(intermediates)/vulkan/anv_entrypoints.c:
        @mkdir -p $(dir $@)
        $(VK_ENTRYPOINTS_SCRIPT) \
                --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \
-               --xml $(MESA_TOP)/src/vulkan/registry/vk_android_native_buffer.xml \
                --outdir $(dir $@)
 
 $(intermediates)/vulkan/anv_extensions.c:
        @mkdir -p $(dir $@)
        $(VK_EXTENSIONS_SCRIPT) \
                --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \
-               --xml $(MESA_TOP)/src/vulkan/registry/vk_android_native_buffer.xml \
                --out-c $@
 
 $(intermediates)/vulkan/anv_extensions.h:
        @mkdir -p $(dir $@)
        $(VK_EXTENSIONS_SCRIPT) \
                --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \
-               --xml $(MESA_TOP)/src/vulkan/registry/vk_android_native_buffer.xml \
                --out-h $@
 
 LOCAL_SHARED_LIBRARIES := $(ANV_SHARED_LIBRARIES)
index 3d5e8e5cfdda59ff71c6a197ac84dd92f9154628..0bcbf0419ca6fdfe6ed991d126e9c5f43de2b556 100644 (file)
 # rules must be outside of any AM_CONDITIONALs. Otherwise they will be commented
 # out and we'll fail at `make dist'
 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
-vk_android_native_buffer_xml = $(top_srcdir)/src/vulkan/registry/vk_android_native_buffer.xml
 
 vulkan/anv_entrypoints.c: vulkan/anv_entrypoints_gen.py \
                          vulkan/anv_extensions.py \
-                         $(vulkan_api_xml) \
-                         $(vk_android_native_buffer_xml)
+                         $(vulkan_api_xml)
        $(MKDIR_GEN)
        $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_entrypoints_gen.py \
                --xml $(vulkan_api_xml) \
-               --xml $(vk_android_native_buffer_xml) \
                --outdir $(builddir)/vulkan
 vulkan/anv_entrypoints.h: vulkan/anv_entrypoints.c
 
 vulkan/anv_extensions.c: vulkan/anv_extensions_gen.py \
                         vulkan/anv_extensions.py \
-                        $(vulkan_api_xml) \
-                        $(vk_android_native_buffer_xml)
+                        $(vulkan_api_xml)
        $(MKDIR_GEN)
        $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_extensions_gen.py \
                --xml $(vulkan_api_xml) \
-               --xml $(vk_android_native_buffer_xml) \
                --out-c $@
 
 vulkan/anv_extensions.h: vulkan/anv_extensions_gen.py \
                         vulkan/anv_extensions.py \
-                        $(vulkan_api_xml) \
-                        $(vk_android_native_buffer_xml)
+                        $(vulkan_api_xml)
        $(MKDIR_GEN)
        $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_extensions_gen.py \
                --xml $(vulkan_api_xml) \
-               --xml $(vk_android_native_buffer_xml) \
                --out-h $@
 
 BUILT_SOURCES += $(VULKAN_GENERATED_FILES)
index 9bcb631b1243830f85bd38941479ad7a8f250452..57a528563eda8336f3b9af63080506bc4892a5d7 100644 (file)
@@ -45,18 +45,13 @@ def _init_exts_from_xml(xml):
         if ext_name not in ext_name_map:
             continue
 
-        # Workaround for VK_ANDROID_native_buffer. Its <extension> element in
-        # vk.xml lists it as supported="disabled" and provides only a stub
-        # definition.  Its <extension> element in Mesa's custom
-        # vk_android_native_buffer.xml, though, lists it as
-        # supported='android-vendor' and fully defines the extension. We want
-        # to skip the <extension> element in vk.xml.
-        if ext_elem.attrib['supported'] == 'disabled':
-            assert ext_name == 'VK_ANDROID_native_buffer'
-            continue
-
         ext = ext_name_map[ext_name]
-        ext.type = ext_elem.attrib['type']
+        if ext_name == 'VK_ANDROID_native_buffer':
+            # VK_ANDROID_native_buffer is missing the type specifier.  Just
+            # hard-code it to be a device extension for now.
+            ext.type = 'device'
+        else:
+            ext.type = ext_elem.attrib['type']
 
 _TEMPLATE_H = Template(COPYRIGHT + """
 
index ef50134636e6c6a432a51252d8dbc52dfafdea02..2dce0a1515b2deb930913493d37dd11690cb6ddd 100644 (file)
@@ -22,10 +22,10 @@ anv_extensions_py = files('anv_extensions.py')
 
 anv_entrypoints = custom_target(
   'anv_entrypoints.[ch]',
-  input : ['anv_entrypoints_gen.py', vk_api_xml, vk_android_native_buffer_xml],
+  input : ['anv_entrypoints_gen.py', vk_api_xml],
   output : ['anv_entrypoints.h', 'anv_entrypoints.c'],
   command : [
-    prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--xml', '@INPUT2@',
+    prog_python2, '@INPUT0@', '--xml', '@INPUT1@',
     '--outdir', meson.current_build_dir(),
   ],
   depend_files : anv_extensions_py,
@@ -33,10 +33,10 @@ anv_entrypoints = custom_target(
 
 anv_extensions_c = custom_target(
   'anv_extensions.c',
-  input : ['anv_extensions_gen.py', vk_api_xml, vk_android_native_buffer_xml],
+  input : ['anv_extensions_gen.py', vk_api_xml],
   output : 'anv_extensions.c',
   command : [
-    prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--xml', '@INPUT2@',
+    prog_python2, '@INPUT0@', '--xml', '@INPUT1@',
     '--out-c', '@OUTPUT@',
   ],
   depend_files : anv_extensions_py,
@@ -44,10 +44,10 @@ anv_extensions_c = custom_target(
 
 anv_extensions_h = custom_target(
   'anv_extensions.h',
-  input : ['anv_extensions_gen.py', vk_api_xml, vk_android_native_buffer_xml],
+  input : ['anv_extensions_gen.py', vk_api_xml],
   output : 'anv_extensions.h',
   command : [
-    prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--xml', '@INPUT2@',
+    prog_python2, '@INPUT0@', '--xml', '@INPUT1@',
     '--out-h', '@OUTPUT@',
   ],
   depend_files : anv_extensions_py,
index 70b23eae08fd6b1e8a0565d651bec4a3f917de8c..6253f1c3be9faa17badef784a1ac4c056af1ea36 100644 (file)
@@ -45,15 +45,13 @@ LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/, \
 LOCAL_SRC_FILES := $(VULKAN_UTIL_FILES) $(VULKAN_WSI_FILES)
 
 vulkan_api_xml = $(MESA_TOP)/src/vulkan/registry/vk.xml
-vk_android_native_buffer_xml = $(MESA_TOP)/src/vulkan/registry/vk_android_native_buffer.xml
 
 $(LOCAL_GENERATED_SOURCES): $(MESA_TOP)/src/vulkan/util/gen_enum_to_str.py \
-               $(vulkan_api_xml) $(vk_android_native_buffer_xml)
+               $(vulkan_api_xml)
        @echo "target Generated: $(PRIVATE_MODULE) <= $(notdir $(@))"
        @mkdir -p $(dir $@)
        $(hide) $(MESA_PYTHON2) $(MESA_TOP)/src/vulkan/util/gen_enum_to_str.py \
            --xml $(vulkan_api_xml) \
-           --xml $(vk_android_native_buffer_xml) \
            --outdir $(dir $@)
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
index bbcf7d0cc6482019d735fcd3e9f46c8a8d2dbf97..3da03ed09e1ad2fb281577831b978d8c29dfa2f4 100644 (file)
@@ -4,13 +4,11 @@ noinst_LTLIBRARIES = libvulkan_wsi.la libvulkan_util.la
 
 vulkan_includedir = $(includedir)/vulkan
 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
-vk_android_native_buffer_xml = $(top_srcdir)/src/vulkan/registry/vk_android_native_buffer.xml
 
 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
 PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
 
 EXTRA_DIST = \
-       $(top_srcdir)/include/vulkan/vk_android_native_buffer.h \
        util/gen_enum_to_str.py \
        util/meson.build \
        wsi/meson.build \
@@ -21,11 +19,10 @@ VULKAN_UTIL_SOURCES = \
        $(VULKAN_UTIL_GENERATED_FILES)
 
 util/vk_enum_to_str.c util/vk_enum_to_str.h: util/gen_enum_to_str.py \
-               $(vulkan_api_xml) $(vk_android_native_buffer_xml)
+               $(vulkan_api_xml)
        $(MKDIR_GEN)
        $(PYTHON_GEN) $(srcdir)/util/gen_enum_to_str.py \
            --xml $(vulkan_api_xml) \
-           --xml $(vk_android_native_buffer_xml) \
            --outdir $(top_builddir)/src/vulkan/util
 
 libvulkan_util_la_SOURCES = $(VULKAN_UTIL_SOURCES)
index 3908005b8a01e4caa847f710b70aeb16c298e0c9..59e1fd1fabef7d8663077b5398a7df5fe6819dea 100644 (file)
@@ -19,7 +19,6 @@
 # SOFTWARE.
 
 vk_api_xml = files('registry/vk.xml')
-vk_android_native_buffer_xml = files('registry/vk_android_native_buffer.xml')
 
 inc_vulkan_util = include_directories('util')
 inc_vulkan_wsi = include_directories('wsi')
diff --git a/src/vulkan/registry/vk_android_native_buffer.xml b/src/vulkan/registry/vk_android_native_buffer.xml
deleted file mode 100644 (file)
index 2738908..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<registry>
-    <types>
-        <type category="struct" name="VkNativeBufferANDROID">
-            <member values="VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID"><type>VkStructureType</type> <name>sType</name></member>
-            <member>const <type>void</type>* <name>pNext</name></member>
-            <member><type>buffer_handle_t</type> <name>handle</name></member>
-            <member><type>int</type> <name>stride</name></member>
-            <member><type>int</type> <name>format</name></member>
-            <member><type>int</type> <name>usage</name></member>
-        </type>
-    </types>
-    <commands>
-        <command>
-            <proto><type>VkResult</type> <name>vkGetSwapchainGrallocUsageANDROID</name></proto>
-            <param><type>VkDevice</type> <name>device</name></param>
-            <param><type>VkFormat</type> <name>format</name></param>
-            <param><type>VkImageUsageFlags</type> <name>imageUsage</name></param>
-            <param><type>int</type>* <name>grallocUsage</name></param>
-        </command>
-        <command>
-            <proto><type>VkResult</type> <name>vkAcquireImageANDROID</name></proto>
-            <param><type>VkDevice</type> <name>device</name></param>
-            <param><type>VkImage</type> <name>image</name></param>
-            <param><type>int</type> <name>nativeFenceFd</name></param>
-            <param><type>VkSemaphore</type> <name>semaphore</name></param>
-            <param><type>VkFence</type> <name>fence</name></param>
-        </command>
-        <command>
-            <proto><type>VkResult</type> <name>vkQueueSignalReleaseImageANDROID</name></proto>
-            <param><type>VkQueue</type> <name>queue</name></param>
-            <param><type>uint32_t</type> <name>waitSemaphoreCount</name></param>
-            <param>const <type>VkSemaphore</type>* <name>pWaitSemaphores</name></param>
-            <param><type>VkImage</type> <name>image</name></param>
-            <param><type>int</type>* <name>pNativeFenceFd</name></param>
-        </command>
-    </commands>
-    <extensions>
-        <extension name="VK_ANDROID_native_buffer" number="11" type="device" protect="ANDROID" supported="vulkan">
-            <require>
-                <enum value="5"                                         name="VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION"/>
-                <enum value="11"                                        name="VK_ANDROID_NATIVE_BUFFER_NUMBER"/>
-                <enum value="&quot;VK_ANDROID_native_buffer&quot;"      name="VK_ANDROID_NATIVE_BUFFER_NAME"/>
-                <enum offset="0" extends="VkStructureType"              name="VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID"/>
-                <type name="VkNativeBufferANDROID"/>
-                <command name="vkGetSwapchainGrallocUsageANDROID"/>
-                <command name="vkAcquireImageANDROID"/>
-                <command name="vkQueueSignalReleaseImageANDROID"/>
-            </require>
-        </extension>
-    </extensions>
-</registry>