Skip ICD's with non zero variant value
authorCharles Giessen <charles@lunarg.com>
Wed, 26 Jan 2022 22:42:21 +0000 (15:42 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 28 Jan 2022 23:24:27 +0000 (16:24 -0700)
If the JSON ICD Manifest contains an api_version that has a non zero variant
value, then the ICD should be skipped since it corresponds to a Vulkan variant.

loader/loader.c

index 302e61339a2316f75ee133e118b315bc3fe64ccd..735a3cbd6a5633c447ff0599f9e86ee5c04aee00 100644 (file)
@@ -3513,6 +3513,16 @@ VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_t
                     loader_log(inst, VULKAN_LOADER_WARN_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
                                "loader_icd_scan: ICD JSON %s does not have an \'api_version\' field.", file_str);
                 }
+                if (VK_API_VERSION_VARIANT(vers) != 0) {
+                    loader_log(
+                        inst, VULKAN_LOADER_INFO_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
+                        "loader_icd_scan: Driver's ICD JSON %s \'api_version\' field contains a non-zero variant value of %d. "
+                        " Skipping ICD JSON.",
+                        file_str, VK_API_VERSION_VARIANT(vers));
+                    cJSON_Delete(inst, json);
+                    json = NULL;
+                    continue;
+                }
                 VkResult icd_add_res = VK_SUCCESS;
                 icd_add_res = loader_scanned_icd_add(inst, icd_tramp_list, fullpath, vers);
                 if (VK_ERROR_OUT_OF_HOST_MEMORY == icd_add_res) {