loader: Cleanup 1.0.25 extension work
authorMark Young <marky@lunarg.com>
Wed, 7 Sep 2016 14:50:32 +0000 (08:50 -0600)
committerMark Young <marky@lunarg.com>
Wed, 7 Sep 2016 23:23:15 +0000 (17:23 -0600)
Remove adding extensions from being exported from loader by
default.  Add in logic to only export entry points if extensions
are enabled.

Change-Id: I56e0c673925869e0d4482ee401ea19e43a05267f

loader/debug_report.c
loader/extensions.c
loader/extensions.h
loader/loader.c
loader/loader.h
vulkan.py

index 83c5a6a..667ef47 100644 (file)
@@ -49,12 +49,12 @@ void debug_report_add_instance_extensions(
 
 void debug_report_create_instance(struct loader_instance *ptr_instance,
                                   const VkInstanceCreateInfo *pCreateInfo) {
-    ptr_instance->debug_report_enabled = false;
+    ptr_instance->enabled_known_extensions.ext_debug_report = 0;
 
     for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
         if (strcmp(pCreateInfo->ppEnabledExtensionNames[i],
                    VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) {
-            ptr_instance->debug_report_enabled = true;
+            ptr_instance->enabled_known_extensions.ext_debug_report = 1;
             return;
         }
     }
@@ -97,9 +97,10 @@ util_CreateDebugReportCallback(struct loader_instance *inst,
     return VK_SUCCESS;
 }
 
-static VKAPI_ATTR VkResult VKAPI_CALL debug_report_CreateDebugReportCallback(
-    VkInstance instance, VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
-    VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) {
+static VKAPI_ATTR VkResult VKAPI_CALL debug_report_CreateDebugReportCallbackEXT(
+    VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
+    const VkAllocationCallbacks *pAllocator,
+    VkDebugReportCallbackEXT *pCallback) {
     struct loader_instance *inst = loader_get_instance(instance);
     loader_platform_thread_lock_mutex(&loader_lock);
     VkResult result = inst->disp->CreateDebugReportCallbackEXT(
@@ -275,9 +276,9 @@ void util_DestroyDebugReportCallbacks(struct loader_instance *inst,
 }
 
 static VKAPI_ATTR void VKAPI_CALL
-debug_report_DestroyDebugReportCallback(VkInstance instance,
-                                        VkDebugReportCallbackEXT callback,
-                                        VkAllocationCallbacks *pAllocator) {
+debug_report_DestroyDebugReportCallbackEXT(
+    VkInstance instance, VkDebugReportCallbackEXT callback,
+    const VkAllocationCallbacks *pAllocator) {
     struct loader_instance *inst = loader_get_instance(instance);
     loader_platform_thread_lock_mutex(&loader_lock);
 
@@ -288,7 +289,7 @@ debug_report_DestroyDebugReportCallback(VkInstance instance,
     loader_platform_thread_unlock_mutex(&loader_lock);
 }
 
-static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessage(
+static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessageEXT(
     VkInstance instance, VkDebugReportFlagsEXT flags,
     VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location,
     int32_t msgCode, const char *pLayerPrefix, const char *pMsg) {
@@ -467,20 +468,20 @@ bool debug_report_instance_gpa(struct loader_instance *ptr_instance,
     *addr = NULL;
 
     if (!strcmp("vkCreateDebugReportCallbackEXT", name)) {
-        *addr = ptr_instance->debug_report_enabled
-                    ? (void *)debug_report_CreateDebugReportCallback
+        *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1)
+                    ? (void *)debug_report_CreateDebugReportCallbackEXT
                     : NULL;
         return true;
     }
     if (!strcmp("vkDestroyDebugReportCallbackEXT", name)) {
-        *addr = ptr_instance->debug_report_enabled
-                    ? (void *)debug_report_DestroyDebugReportCallback
+        *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1)
+                    ? (void *)debug_report_DestroyDebugReportCallbackEXT
                     : NULL;
         return true;
     }
     if (!strcmp("vkDebugReportMessageEXT", name)) {
-        *addr = ptr_instance->debug_report_enabled
-                    ? (void *)debug_report_DebugReportMessage
+        *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1)
+                    ? (void *)debug_report_DebugReportMessageEXT
                     : NULL;
         return true;
     }
index e14ceb1..4749e20 100644 (file)
 #include "extensions.h"
 #include <vulkan/vk_icd.h>
 
- // Definitions for the VK_NV_external_memory_capabilities extension
+// Definitions for EXT_debug_marker extension
+
+VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectTagEXT(
+    VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) {
+    struct loader_dev_dispatch_table *disp = loader_get_dev_dispatch(device);
+    if (0 == disp->enabled_known_extensions.ext_debug_marker ||
+        NULL == disp->core_dispatch.DebugMarkerSetObjectTagEXT) {
+        return VK_ERROR_EXTENSION_NOT_PRESENT;
+    } else {
+        return disp->core_dispatch.DebugMarkerSetObjectTagEXT(device, pTagInfo);
+    }
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL vkDebugMarkerSetObjectNameEXT(
+    VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) {
+    struct loader_dev_dispatch_table *disp = loader_get_dev_dispatch(device);
+    if (0 == disp->enabled_known_extensions.ext_debug_marker ||
+        NULL == disp->core_dispatch.DebugMarkerSetObjectNameEXT) {
+        return VK_ERROR_EXTENSION_NOT_PRESENT;
+    } else {
+        return disp->core_dispatch.DebugMarkerSetObjectNameEXT(device,
+                                                               pNameInfo);
+    }
+}
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerBeginEXT(
+    VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) {
+    struct loader_dev_dispatch_table *disp =
+        loader_get_dev_dispatch(commandBuffer);
+    if (1 == disp->enabled_known_extensions.ext_debug_marker &&
+        NULL != disp->core_dispatch.CmdDebugMarkerBeginEXT) {
+        disp->core_dispatch.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo);
+    }
+}
+
+VKAPI_ATTR void VKAPI_CALL
+vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) {
+    struct loader_dev_dispatch_table *disp =
+        loader_get_dev_dispatch(commandBuffer);
+    if (1 == disp->enabled_known_extensions.ext_debug_marker &&
+        NULL != disp->core_dispatch.CmdDebugMarkerEndEXT) {
+        disp->core_dispatch.CmdDebugMarkerEndEXT(commandBuffer);
+    }
+}
 
-static const VkExtensionProperties
-    nv_external_memory_capabilities_extension_info = {
-        .extensionName = VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME,
-        .specVersion = VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION,
-};
+VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT(
+    VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) {
+    struct loader_dev_dispatch_table *disp =
+        loader_get_dev_dispatch(commandBuffer);
+    if (1 == disp->enabled_known_extensions.ext_debug_marker &&
+        NULL != disp->core_dispatch.CmdDebugMarkerInsertEXT) {
+        disp->core_dispatch.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo);
+    }
+}
+
+// Definitions for the VK_NV_external_memory_capabilities extension
 
 LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
 vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
@@ -43,13 +92,25 @@ vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
     VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) {
 
     const VkLayerInstanceDispatchTable *disp;
+    struct loader_physical_device_tramp *phys_dev =
+        (struct loader_physical_device_tramp *)physicalDevice;
+    struct loader_instance *inst = phys_dev->this_instance;
     VkPhysicalDevice unwrapped_phys_dev =
         loader_unwrap_physical_device(physicalDevice);
     disp = loader_get_instance_dispatch(physicalDevice);
 
-    return disp->GetPhysicalDeviceExternalImageFormatPropertiesNV(
-        unwrapped_phys_dev, format, type, tiling, usage, flags,
-        externalHandleType, pExternalImageFormatProperties);
+    if (0 == inst->enabled_known_extensions.nv_external_memory_capabilities ||
+        NULL == disp->GetPhysicalDeviceExternalImageFormatPropertiesNV) {
+        loader_log(
+            inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
+            "vkGetPhysicalDeviceExternalImageFormatPropertiesNV called without"
+            " NV_external_memory_capabilities extension being enabled");
+        return VK_ERROR_EXTENSION_NOT_PRESENT;
+    } else {
+        return disp->GetPhysicalDeviceExternalImageFormatPropertiesNV(
+            unwrapped_phys_dev, format, type, tiling, usage, flags,
+            externalHandleType, pExternalImageFormatProperties);
+    }
 }
 
 VKAPI_ATTR VkResult VKAPI_CALL
@@ -87,50 +148,49 @@ terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV(
 
 // Definitions for the VK_AMD_draw_indirect_count extension
 
-static const VkExtensionProperties amd_draw_indirect_count_extension_info = {
-    .extensionName = VK_AMD_EXTENSION_DRAW_INDIRECT_COUNT_EXTENSION_NAME,
-    .specVersion = VK_AMD_EXTENSION_DRAW_INDIRECT_COUNT_SPEC_VERSION,
-};
-
 VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectCountAMD(
     VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
     VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
     uint32_t stride) {
-    const VkLayerDispatchTable *disp;
-
-    disp = loader_get_dispatch(commandBuffer);
-    disp->CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer,
-                                  countBufferOffset, maxDrawCount, stride);
+    struct loader_dev_dispatch_table *disp =
+        loader_get_dev_dispatch(commandBuffer);
+    if (1 == disp->enabled_known_extensions.amd_draw_indirect_count &&
+        NULL != disp->core_dispatch.CmdDrawIndirectCountAMD) {
+        disp->core_dispatch.CmdDrawIndirectCountAMD(
+            commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+            maxDrawCount, stride);
+    }
 }
 
 VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD(
     VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
     VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount,
     uint32_t stride) {
-    const VkLayerDispatchTable *disp;
-
-    disp = loader_get_dispatch(commandBuffer);
-    disp->CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset,
-                                         countBuffer, countBufferOffset,
-                                         maxDrawCount, stride);
+    struct loader_dev_dispatch_table *disp =
+        loader_get_dev_dispatch(commandBuffer);
+    if (1 == disp->enabled_known_extensions.amd_draw_indirect_count &&
+        NULL != disp->core_dispatch.CmdDrawIndexedIndirectCountAMD) {
+        disp->core_dispatch.CmdDrawIndexedIndirectCountAMD(
+            commandBuffer, buffer, offset, countBuffer, countBufferOffset,
+            maxDrawCount, stride);
+    }
 }
 
 #ifdef VK_USE_PLATFORM_WIN32_KHR
 
 // Definitions for the VK_NV_external_memory_win32 extension
 
-static const VkExtensionProperties nv_external_memory_win32_extension_info = {
-    .extensionName = VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME,
-    .specVersion = VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION,
-};
-
 VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
     VkDevice device, VkDeviceMemory memory,
     VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) {
-    const VkLayerDispatchTable *disp;
-
-    disp = loader_get_dispatch(device);
-    return disp->GetMemoryWin32HandleNV(device, memory, handleType, pHandle);
+    struct loader_dev_dispatch_table *disp = loader_get_dev_dispatch(device);
+    if (0 == disp->enabled_known_extensions.nv_external_memory_win32 ||
+        NULL == disp->core_dispatch.GetMemoryWin32HandleNV) {
+        return VK_ERROR_EXTENSION_NOT_PRESENT;
+    } else {
+        return disp->core_dispatch.GetMemoryWin32HandleNV(device, memory,
+                                                          handleType, pHandle);
+    }
 }
 
 #endif // VK_USE_PLATFORM_WIN32_KHR
@@ -141,10 +201,36 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance,
                             const char *name, void **addr) {
     *addr = NULL;
 
+    // Functions for the EXT_debug_marker extension
+
+    if (!strcmp("vkDebugMarkerSetObjectTagEXT", name)) {
+        *addr = (void *)vkDebugMarkerSetObjectTagEXT;
+        return true;
+    }
+    if (!strcmp("vkDebugMarkerSetObjectNameEXT", name)) {
+        *addr = (void *)vkDebugMarkerSetObjectNameEXT;
+        return true;
+    }
+    if (!strcmp("vkCmdDebugMarkerBeginEXT", name)) {
+        *addr = (void *)vkCmdDebugMarkerBeginEXT;
+        return true;
+    }
+    if (!strcmp("vkCmdDebugMarkerEndEXT", name)) {
+        *addr = (void *)vkCmdDebugMarkerEndEXT;
+        return true;
+    }
+    if (!strcmp("vkCmdDebugMarkerInsertEXT", name)) {
+        *addr = (void *)vkCmdDebugMarkerInsertEXT;
+        return true;
+    }
+
     // Functions for the VK_NV_external_memory_capabilities extension
 
     if (!strcmp("vkGetPhysicalDeviceExternalImageFormatPropertiesNV", name)) {
-        *addr = (void *)vkGetPhysicalDeviceExternalImageFormatPropertiesNV;
+        *addr = (ptr_instance->enabled_known_extensions
+                     .nv_external_memory_capabilities == 1)
+                    ? (void *)vkGetPhysicalDeviceExternalImageFormatPropertiesNV
+                    : NULL;
         return true;
     }
 
@@ -176,24 +262,43 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance,
 
 void extensions_create_instance(struct loader_instance *ptr_instance,
                                 const VkInstanceCreateInfo *pCreateInfo) {
+    ptr_instance->enabled_known_extensions.nv_external_memory_capabilities = 0;
 
     for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
         if (strcmp(pCreateInfo->ppEnabledExtensionNames[i],
                    VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) == 0) {
-            // Nothing to do;
+            ptr_instance->enabled_known_extensions
+                .nv_external_memory_capabilities = 1;
+            return;
+        }
+    }
+}
+
+void extensions_create_device(struct loader_device *dev,
+                              const VkDeviceCreateInfo *pCreateInfo) {
+    dev->loader_dispatch.enabled_known_extensions.ext_debug_marker = 0;
+    dev->loader_dispatch.enabled_known_extensions.amd_draw_indirect_count = 0;
+    dev->loader_dispatch.enabled_known_extensions.nv_external_memory_win32 = 0;
+
+    for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
+        if (strcmp(pCreateInfo->ppEnabledExtensionNames[i],
+                   VK_EXT_DEBUG_MARKER_EXTENSION_NAME) == 0) {
+            dev->loader_dispatch.enabled_known_extensions.ext_debug_marker = 1;
             return;
         }
 
         if (strcmp(pCreateInfo->ppEnabledExtensionNames[i],
                    VK_AMD_EXTENSION_DRAW_INDIRECT_COUNT_EXTENSION_NAME) == 0) {
-            // Nothing to do;
+            dev->loader_dispatch.enabled_known_extensions
+                .amd_draw_indirect_count = 1;
             return;
         }
 
 #ifdef VK_USE_PLATFORM_WIN32_KHR
         if (strcmp(pCreateInfo->ppEnabledExtensionNames[i],
                    VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) {
-            // Nothing to do;
+            dev->loader_dispatch.enabled_known_extensions
+                .nv_external_memory_win32 = 1;
             return;
         }
 #endif // VK_USE_PLATFORM_WIN32_KHR
index bbccc17..c84fd86 100644 (file)
 #include "loader.h"
 
 bool extension_instance_gpa(struct loader_instance *ptr_instance,
-    const char *name, void **addr);
+                            const char *name, void **addr);
 
 void extensions_create_instance(struct loader_instance *ptr_instance,
                                 const VkInstanceCreateInfo *pCreateInfo);
 
+void extensions_create_device(struct loader_device *dev,
+                              const VkDeviceCreateInfo *pCreateInfo);
+
 // Definitions for the VK_NV_external_memory_capabilities extension
 
 VKAPI_ATTR VkResult VKAPI_CALL
index fba9343..ac8f4fc 100644 (file)
@@ -1268,9 +1268,6 @@ void loader_destroy_logical_device(const struct loader_instance *inst,
     if (pAllocator) {
         dev->alloc_callbacks = *pAllocator;
     }
-    if (NULL != dev->app_extension_props) {
-        loader_device_heap_free(dev, dev->app_extension_props);
-    }
     if (NULL != dev->activated_layer_list.list) {
         loader_deactivate_layers(inst, dev, &dev->activated_layer_list);
     }
@@ -4327,6 +4324,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(
         }
     }
 
+    extensions_create_device(dev, pCreateInfo);
+
     // TODO: Why does fpCreateDevice behave differently than
     // this_icd->CreateDevice?
     //    VkResult res = fpCreateDevice(phys_dev->phys_dev, &localCreateInfo,
index cc9c98f..9b57372 100644 (file)
@@ -158,19 +158,26 @@ struct loader_dev_ext_dispatch_table {
     PFN_vkDevExt dev_ext[MAX_NUM_DEV_EXTS];
 };
 
+union loader_device_extension_enables {
+    struct {
+        uint8_t ext_debug_marker            : 1;
+        uint8_t amd_draw_indirect_count     : 1;
+        uint8_t nv_external_memory_win32    : 1;
+    };
+    uint64_t padding[4];
+};
+
 struct loader_dev_dispatch_table {
     VkLayerDispatchTable core_dispatch;
     struct loader_dev_ext_dispatch_table ext_dispatch;
+    union loader_device_extension_enables enabled_known_extensions;
 };
 
-/* per CreateDevice structure */
+// per CreateDevice structure
 struct loader_device {
     struct loader_dev_dispatch_table loader_dispatch;
     VkDevice device; // device object from the icd
 
-    uint32_t app_extension_count;
-    VkExtensionProperties *app_extension_props;
-
     struct loader_layer_list activated_layer_list;
 
     VkAllocationCallbacks alloc_callbacks;
@@ -245,14 +252,22 @@ struct loader_icd {
     struct loader_icd *next;
 };
 
-/* per ICD library structure */
+// per ICD library structure
 struct loader_icd_libs {
     size_t capacity;
     uint32_t count;
     struct loader_scanned_icds *list;
 };
 
-/* per instance structure */
+union loader_instance_extension_enables {
+    struct {
+        uint8_t ext_debug_report                : 1;
+        uint8_t nv_external_memory_capabilities : 1;
+    };
+    uint64_t padding[4];
+};
+
+// per instance structure
 struct loader_instance {
     VkLayerInstanceDispatchTable *disp; // must be first entry in structure
 
@@ -264,6 +279,7 @@ struct loader_instance {
     struct loader_icd *icds;
     struct loader_instance *next;
     struct loader_extension_list ext_list; // icds and loaders extensions
+    union loader_instance_extension_enables enabled_known_extensions;
     struct loader_icd_libs icd_libs;
     struct loader_layer_list instance_layer_list;
     struct loader_dispatch_hash_entry disp_hash[MAX_NUM_DEV_EXTS];
@@ -274,7 +290,6 @@ struct loader_instance {
     bool activated_layers_are_std_val;
     VkInstance instance; // layers/ICD instance returned to trampoline
 
-    bool debug_report_enabled;
     VkLayerDbgFunctionNode *DbgFunctionHead;
     uint32_t num_tmp_callbacks;
     VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos;
index 7551be4..6d85080 100644 (file)
--- a/vulkan.py
+++ b/vulkan.py
@@ -1372,9 +1372,7 @@ import sys
 if sys.argv[1] == 'AllPlatforms':
     extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_win32_surface, ext_khr_xcb_surface,
                          ext_khr_xlib_surface, ext_khr_wayland_surface, ext_khr_mir_surface, ext_khr_display,
-                         ext_khr_android_surface, ext_amd_extension_draw_indirect_count,
-                         ext_nv_external_memory_capabilities, ext_nv_external_memory_win32,
-                         ext_khr_display_swapchain]
+                         ext_khr_android_surface, ext_khr_display_swapchain]
     extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_win32_surface,
                              ext_khr_xcb_surface, ext_khr_xlib_surface, ext_khr_wayland_surface, ext_khr_mir_surface,
                              ext_khr_display, ext_khr_android_surface, ext_amd_extension_draw_indirect_count,
@@ -1384,9 +1382,7 @@ else :
     if len(sys.argv) > 3:
         if (sys.platform.startswith('win32') or sys.platform.startswith('msys')) and sys.argv[1] != 'Android':
             extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_win32_surface,
-                                 ext_khr_display, ext_amd_extension_draw_indirect_count,
-                                 ext_nv_external_memory_capabilities, ext_nv_external_memory_win32,
-                                 ext_khr_display_swapchain]
+                                 ext_khr_display, ext_khr_display_swapchain]
             extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_win32_surface,
                                       ext_khr_display, ext_amd_extension_draw_indirect_count,
                                       ext_nv_external_memory_capabilities, ext_nv_external_memory_win32,
@@ -1394,7 +1390,6 @@ else :
         elif sys.platform.startswith('linux') and sys.argv[1] != 'Android':
             extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_xcb_surface,
                                  ext_khr_xlib_surface, ext_khr_wayland_surface, ext_khr_mir_surface, ext_khr_display,
-                                 ext_amd_extension_draw_indirect_count, ext_nv_external_memory_capabilities,
                                  ext_khr_display_swapchain]
             extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_xcb_surface,
                                       ext_khr_xlib_surface, ext_khr_wayland_surface, ext_khr_mir_surface,
@@ -1403,7 +1398,6 @@ else :
                                       ext_debug_report, ext_debug_marker]
         else: # android
             extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_android_surface,
-                                 ext_amd_extension_draw_indirect_count, ext_nv_external_memory_capabilities,
                                  ext_khr_display_swapchain]
             extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_android_surface,
                                       ext_amd_extension_draw_indirect_count, ext_nv_external_memory_capabilities,
@@ -1411,16 +1405,13 @@ else :
     else :
         if sys.argv[1] == 'Win32' or sys.argv[1] == 'msys':
             extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_win32_surface,
-                                 ext_khr_display, ext_amd_extension_draw_indirect_count,
-                                 ext_nv_external_memory_capabilities, ext_nv_external_memory_win32,
-                                 ext_khr_display_swapchain]
+                                 ext_khr_display, ext_khr_display_swapchain]
             extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_win32_surface,
                                       ext_khr_display, ext_amd_extension_draw_indirect_count,
                                       ext_nv_external_memory_capabilities, ext_nv_external_memory_win32,
                                       ext_khr_display_swapchain, ext_debug_report, ext_debug_marker]
         elif sys.argv[1] == 'Android':
             extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_android_surface,
-                                 ext_amd_extension_draw_indirect_count, ext_nv_external_memory_capabilities,
                                  ext_khr_display_swapchain]
             extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_android_surface,
                                       ext_amd_extension_draw_indirect_count, ext_nv_external_memory_capabilities,
@@ -1428,8 +1419,7 @@ else :
         elif sys.argv[1] == 'Xcb' or sys.argv[1] == 'Xlib' or sys.argv[1] == 'Wayland' or sys.argv[1] == 'Mir' or sys.argv[1] == 'Display':
             extensions = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_xcb_surface,
                                  ext_khr_xlib_surface, ext_khr_wayland_surface, ext_khr_mir_surface,
-                                 ext_khr_display, ext_amd_extension_draw_indirect_count,
-                                 ext_nv_external_memory_capabilities, ext_khr_display_swapchain]
+                                 ext_khr_display, ext_khr_display_swapchain]
             extensions_all = [core, ext_khr_surface, ext_khr_device_swapchain, ext_khr_xcb_surface,
                                       ext_khr_xlib_surface, ext_khr_wayland_surface, ext_khr_mir_surface,
                                       ext_khr_display, ext_amd_extension_draw_indirect_count,