struct loader_extension_list *inst_exts) {
struct loader_extension_list icd_exts;
VkResult res = VK_SUCCESS;
+ char *env_value;
+ bool filter_extensions = true;
loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, "Build ICD instance extension list");
+ // Check if a user wants to disable the instance extension filtering behavior
+ env_value = loader_getenv("VK_LOADER_DISABLE_INST_EXT_FILTER", inst);
+ if (NULL != env_value && atoi(env_value) != 0) {
+ filter_extensions = false;
+ }
+ loader_free_getenv(env_value, inst);
+
// traverse scanned icd list adding non-duplicate extensions to the list
for (uint32_t i = 0; i < icd_tramp_list->count; i++) {
res = loader_init_generic_list(inst, (struct loader_generic_list *)&icd_exts, sizeof(VkExtensionProperties));
res = loader_add_instance_extensions(inst, icd_tramp_list->scanned_list[i].EnumerateInstanceExtensionProperties,
icd_tramp_list->scanned_list[i].lib_name, &icd_exts);
if (VK_SUCCESS == res) {
- // Remove any extensions not recognized by the loader
- for (int32_t j = 0; j < (int32_t)icd_exts.count; j++) {
- // See if the extension is in the list of supported extensions
- bool found = false;
- for (uint32_t k = 0; LOADER_INSTANCE_EXTENSIONS[k] != NULL; k++) {
- if (strcmp(icd_exts.list[j].extensionName, LOADER_INSTANCE_EXTENSIONS[k]) == 0) {
- found = true;
- break;
+ if (filter_extensions) {
+ // Remove any extensions not recognized by the loader
+ for (int32_t j = 0; j < (int32_t)icd_exts.count; j++) {
+ // See if the extension is in the list of supported extensions
+ bool found = false;
+ for (uint32_t k = 0; LOADER_INSTANCE_EXTENSIONS[k] != NULL; k++) {
+ if (strcmp(icd_exts.list[j].extensionName, LOADER_INSTANCE_EXTENSIONS[k]) == 0) {
+ found = true;
+ break;
+ }
}
- }
- // If it isn't in the list, remove it
- if (!found) {
- for (uint32_t k = j + 1; k < icd_exts.count; k++) {
- icd_exts.list[k - 1] = icd_exts.list[k];
+ // If it isn't in the list, remove it
+ if (!found) {
+ for (uint32_t k = j + 1; k < icd_exts.count; k++) {
+ icd_exts.list[k - 1] = icd_exts.list[k];
+ }
+ --icd_exts.count;
+ --j;
}
- --icd_exts.count;
- --j;
}
}