Vulkan: remove redundant function definitions in null_driver

When deprecating the old gen scripts, there's some duplicate entries get added,
which is fixed by this change.

This change also reorders the extension constants in the gen scripts so that
future modification is less likely to put duplicate entries.

Bug: 134185757
Test: ./scripts/code_generator.py && build
Change-Id: I6c8356b01e8a9c042293804eb628ed0a72da4a5c
diff --git a/vulkan/scripts/driver_generator.py b/vulkan/scripts/driver_generator.py
index ef36f8c..4868ac0 100644
--- a/vulkan/scripts/driver_generator.py
+++ b/vulkan/scripts/driver_generator.py
@@ -27,17 +27,17 @@
   'VK_EXT_swapchain_colorspace',
   'VK_GOOGLE_display_timing',
   'VK_KHR_android_surface',
+  'VK_KHR_get_surface_capabilities2',
   'VK_KHR_incremental_present',
   'VK_KHR_shared_presentable_image',
   'VK_KHR_surface',
   'VK_KHR_swapchain',
-  'VK_KHR_get_surface_capabilities2'
 ]
 
 knownExtensions = interceptedExtensions + [
-  'VK_KHR_get_physical_device_properties2',
   'VK_ANDROID_external_memory_android_hardware_buffer',
-  'VK_KHR_bind_memory2'
+  'VK_KHR_bind_memory2',
+  'VK_KHR_get_physical_device_properties2',
 ]
 
 def defineProcHookType(f):
diff --git a/vulkan/scripts/generator_common.py b/vulkan/scripts/generator_common.py
index fe9dab4..f1f09d5 100644
--- a/vulkan/scripts/generator_common.py
+++ b/vulkan/scripts/generator_common.py
@@ -40,41 +40,46 @@
 warning = '// WARNING: This file is generated. See ../README.md for instructions.\n\n'
 
 blacklistedExtensions = [
-    'VK_KHR_display',
-    'VK_KHR_display_swapchain',
-    'VK_KHR_mir_surface',
-    'VK_KHR_xcb_surface',
-    'VK_KHR_xlib_surface',
-    'VK_KHR_wayland_surface',
-    'VK_KHR_win32_surface',
-    'VK_KHR_external_memory_win32',
-    'VK_KHR_win32_keyed_mutex',
-    'VK_KHR_external_semaphore_win32',
-    'VK_KHR_external_fence_win32',
     'VK_EXT_acquire_xlib_display',
     'VK_EXT_direct_mode_display',
-    'VK_EXT_display_surface_counter',
     'VK_EXT_display_control',
+    'VK_EXT_display_surface_counter',
+    'VK_EXT_full_screen_exclusive',
+    'VK_EXT_headless_surface',
+    'VK_EXT_metal_surface',
     'VK_FUCHSIA_imagepipe_surface',
+    'VK_GGP_stream_descriptor_surface',
+    'VK_KHR_display',
+    'VK_KHR_display_swapchain',
+    'VK_KHR_external_fence_win32',
+    'VK_KHR_external_memory_win32',
+    'VK_KHR_external_semaphore_win32',
+    'VK_KHR_mir_surface',
+    'VK_KHR_wayland_surface',
+    'VK_KHR_win32_keyed_mutex',
+    'VK_KHR_win32_surface',
+    'VK_KHR_xcb_surface',
+    'VK_KHR_xlib_surface',
     'VK_MVK_ios_surface',
     'VK_MVK_macos_surface',
     'VK_NN_vi_surface',
+    'VK_NV_cooperative_matrix',
+    'VK_NV_coverage_reduction_mode',
     'VK_NV_external_memory_win32',
     'VK_NV_win32_keyed_mutex',
-    'VK_EXT_metal_surface', #not present in vulkan.api
-    'VK_NVX_image_view_handle', #not present in vulkan.api
-    'VK_NV_cooperative_matrix', #not present in vulkan.api
-    'VK_EXT_headless_surface', #not present in vulkan.api
-    'VK_GGP_stream_descriptor_surface', #not present in vulkan.api
-    'VK_NV_coverage_reduction_mode', #not present in vulkan.api
-    'VK_EXT_full_screen_exclusive' #not present in vulkan.api
+    'VK_NVX_image_view_handle',
 ]
 
 exportedExtensions = [
+    'VK_ANDROID_external_memory_android_hardware_buffer',
+    'VK_KHR_android_surface',
     'VK_KHR_surface',
     'VK_KHR_swapchain',
-    'VK_KHR_android_surface',
-    'VK_ANDROID_external_memory_android_hardware_buffer'
+]
+
+optionalCommands = [
+    'vkGetSwapchainGrallocUsageANDROID',
+    'vkGetSwapchainGrallocUsage2ANDROID',
 ]
 
 def runClangFormat(args):
@@ -241,7 +246,7 @@
 
   if name in versionDict and versionDict[name] == 'VK_VERSION_1_1':
     f.write('false, ')
-  elif name == 'vkGetSwapchainGrallocUsageANDROID' or name == 'vkGetSwapchainGrallocUsage2ANDROID': # optional in vulkan.api
+  elif name in optionalCommands:
     f.write('false, ')
   else:
     f.write('true, ')
diff --git a/vulkan/scripts/null_generator.py b/vulkan/scripts/null_generator.py
index ee8762e..3a761ce 100644
--- a/vulkan/scripts/null_generator.py
+++ b/vulkan/scripts/null_generator.py
@@ -78,9 +78,6 @@
       if isDriverFunction(cmds):
         paramList = [''.join(i) for i in gencom.paramDict[cmds]]
         f.write ('VKAPI_ATTR ' + gencom.returnTypeDict[cmds] + ' ' + cmds[2:] + '(' +', '.join(paramList) + ');\n')
-    f.write ("""VKAPI_ATTR VkResult GetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
-VKAPI_ATTR VkResult AcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore, VkFence fence);
-VKAPI_ATTR VkResult QueueSignalReleaseImageANDROID(VkQueue queue, uint32_t waitSemaphoreCount, const VkSemaphore* pWaitSemaphores, VkImage image, int* pNativeFenceFd);\n""")
     gencom.clang_on(f,0)
 
     f.write ('\n}  // namespace null_driver\n')