diff options
author | Lenny Komow <lenny@lunarg.com> | 2018-08-02 17:24:14 -0600 |
---|---|---|
committer | Lenny Komow <lenny@lunarg.com> | 2018-08-03 11:07:43 -0600 |
commit | 4b858b5b90eac5cd4b35c9d4c15fb220703dc50e (patch) | |
tree | bb7aa0fdddfe324a9025473d893bca01ae3baee2 | |
parent | dbf8f2cd85190ac902f1da57482a6e340f05e860 (diff) | |
download | Vulkan-Loader-4b858b5b90eac5cd4b35c9d4c15fb220703dc50e.tar.gz Vulkan-Loader-4b858b5b90eac5cd4b35c9d4c15fb220703dc50e.tar.bz2 Vulkan-Loader-4b858b5b90eac5cd4b35c9d4c15fb220703dc50e.zip |
loader: Fix VK_EXT_debug_utils crash
Fix a crash where the debug utils extension would crash if no layers
were present that implemented a given entry point.
Change-Id: Ied1da23dfdc952893a5aaad4ae01f69bd6010523
-rw-r--r-- | scripts/loader_extension_generator.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/loader_extension_generator.py b/scripts/loader_extension_generator.py index 30442c90..827c4598 100644 --- a/scripts/loader_extension_generator.py +++ b/scripts/loader_extension_generator.py @@ -48,6 +48,8 @@ ADD_INST_CMDS = ['vkCreateInstance', AVOID_EXT_NAMES = ['VK_EXT_debug_report'] +NULL_CHECK_EXT_NAMES= ['VK_EXT_debug_utils'] + AVOID_CMD_NAMES = ['vkCreateDebugUtilsMessengerEXT', 'vkDestroyDebugUtilsMessengerEXT', 'vkSubmitDebugUtilsMessageEXT'] @@ -1016,6 +1018,8 @@ class LoaderExtensionOutputGenerator(OutputGenerator): funcs += ' local_tag_info.objectHandle = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n' funcs += ' }\n' + if ext_cmd.ext_name in NULL_CHECK_EXT_NAMES: + funcs += ' if (disp->' + base_name + ' != NULL) {\n' funcs += return_prefix funcs += 'disp->' funcs += base_name @@ -1036,6 +1040,11 @@ class LoaderExtensionOutputGenerator(OutputGenerator): count += 1 funcs += ');\n' + if ext_cmd.ext_name in NULL_CHECK_EXT_NAMES: + if ext_cmd.return_type != None: + funcs += ' } else {\n' + funcs += ' return VK_SUCCESS;\n' + funcs += ' }\n' funcs += '}\n\n' funcs += term_header @@ -1250,6 +1259,8 @@ class LoaderExtensionOutputGenerator(OutputGenerator): funcs += ext_cmd.params[0].name funcs += ');\n' + if ext_cmd.ext_name in NULL_CHECK_EXT_NAMES: + funcs += ' if (disp->' + base_name + ' != NULL) {\n' funcs += return_prefix funcs += 'disp->' funcs += base_name @@ -1261,6 +1272,11 @@ class LoaderExtensionOutputGenerator(OutputGenerator): funcs += param.name count += 1 funcs += ');\n' + if ext_cmd.ext_name in NULL_CHECK_EXT_NAMES: + if ext_cmd.return_type != None: + funcs += ' } else {\n' + funcs += ' return VK_SUCCESS;\n' + funcs += ' }\n' funcs += '}\n\n' if ext_cmd.protect is not None: |