Ignore layers with non zero variant value
authorCharles Giessen <charles@lunarg.com>
Fri, 28 Jan 2022 18:28:23 +0000 (11:28 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Fri, 28 Jan 2022 23:24:27 +0000 (16:24 -0700)
Layers which contain an API version where the variant value is non zero are not
designed for the Vulkan-Loader, so it should be ignored.

loader/loader.c

index a5fd1659b2c905761325e79463111265dcd573fe..dbf7a51ed368d2ffa877071191f9d4ca0f791385 100644 (file)
@@ -2265,6 +2265,15 @@ static VkResult loader_read_layer_json(const struct loader_instance *inst, struc
         props->disable_env_var.value[sizeof(props->disable_env_var.value) - 1] = '\0';
     }
 
+    // Make sure the layer's manifest doesn't contain a non zero variant value
+    if (VK_API_VERSION_VARIANT(props->info.specVersion) != 0) {
+        loader_log(inst, VULKAN_LOADER_INFO_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
+                   "Layer %s has an \'api_version\' field which contains a non-zero variant value of %d. "
+                   " Skipping Layer.",
+                   props->info.layerName, VK_API_VERSION_VARIANT(props->info.specVersion));
+        goto out;
+    }
+
 // Now get all optional items and objects and put in list:
 // functions
 // instance_extensions