This not an exhaustive list but should better clarify the behavior of the
loader in complex situations.
-* The API version specified by an implicit layer is used to determine whether
-the layer should be enabled.
-If the layer's API version is less than the version given by the application in `VkApplicationInfo`, the implicit layer is not enabled.
-Thus, any implicit layers must have an API version that is the same or higher
-than the application.
-This applies to implicit meta layers and the override layer.
-Therefore, an application which supports an API version that is newer than any
-implicit meta layers will prevent the meta layer from activating.
+* The Vulkan Loader in versions 1.3.228 and above will enable implicit layers
+regardless of the API version specified by the application in
+`VkApplicationInfo::apiVersion`.
+Previous loader versions (1.3.227 and below) used to have a requirement where
+implicit layer's API version must be equal to or greater than the API version
+of the application for the layer to be enabled.
+The change relaxed the implicit layer loading requirements because it was
+determined that the perceived protection of preventing older layers running
+with newer applications wasn't enough to justify the friction it caused.
+This was due to older layers no longer working with newer applications
+for no apparent reason, as well as older layers having to update the manifest
+to work with newer applications.
+The layer didn't need to do anything else to get their layer working again,
+which meant that a layer didn't need to prove that their layer worked with
+newer API versions.
+Thus, the disabling caused confusion for users but didn't protect them from
+potentially badly behaving layers.
* An implicit layer will ignore its disable environment variable being set if
it is a component in an active meta layer.
<td>Optional field which specifies the architecture of the binary associated
with "library_path". <br />
Allows the loader to quickly determine if the architecture of the layer
- matches that of the running application. <br />
+ matches that of the running application. <br />
The only valid values are "32" and "64".</td>
<td><small>N/A</small></td>
</tr>
ASSERT_TRUE(string_eq(layer_props[0].layerName, regular_layer_name));
ASSERT_TRUE(string_eq(layer_props[1].layerName, lunarg_meta_layer_name));
}
- { // 1.2 instance
+ { // 1.3 instance
InstWrapper inst{env.vulkan_functions};
- FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
-
- inst.create_info.api_version = VK_API_VERSION_1_2;
+ inst.create_info.api_version = VK_API_VERSION_1_3;
inst.CheckCreate();
- ASSERT_TRUE(env.debug_log.find(std::string("loader_add_implicit_layer: Disabling implicit layer ") +
- lunarg_meta_layer_name +
- " for using an old API version 1.1 versus application requested 1.2"));
+ VkPhysicalDevice phys_dev = inst.GetPhysDev();
+
+ uint32_t count = 0;
+ env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
+ ASSERT_EQ(2U, count);
+ std::array<VkLayerProperties, 2> layer_props;
+
+ env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, layer_props.data());
+ ASSERT_EQ(2U, count);
+ ASSERT_TRUE(string_eq(layer_props[0].layerName, regular_layer_name));
+ ASSERT_TRUE(string_eq(layer_props[1].layerName, lunarg_meta_layer_name));
}
}
}
{
- // 1.2 instance
+ // 1.3 instance
InstWrapper inst{env.vulkan_functions};
- FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
- inst.create_info.set_api_version(1, 2, 0);
+ inst.create_info.set_api_version(1, 3, 0);
inst.CheckCreate();
VkPhysicalDevice phys_dev = inst.GetPhysDev();
- ASSERT_TRUE(
- env.debug_log.find("loader_add_implicit_layer: Disabling implicit layer VK_LAYER_LUNARG_override for using an old API "
- "version 1.1 versus application requested 1.2"));
+
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- ASSERT_EQ(0U, count);
+ ASSERT_EQ(2U, count);
std::array<VkLayerProperties, 2> layer_props;
+
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, layer_props.data());
- ASSERT_EQ(0U, count);
+ ASSERT_EQ(2U, count);
+ ASSERT_TRUE(string_eq(layer_props[0].layerName, regular_layer_name));
+ ASSERT_TRUE(string_eq(layer_props[1].layerName, lunarg_meta_layer_name));
}
}
}
{
- // 1.2 instance
+ // 1.3 instance
InstWrapper inst{env.vulkan_functions};
FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
- inst.create_info.set_api_version(1, 2, 0);
+ inst.create_info.set_api_version(1, 3, 0);
inst.CheckCreate();
VkPhysicalDevice phys_dev = inst.GetPhysDev();
- // Meta layer should be disabled since its less than the apiVersion of the instance
- EXPECT_TRUE(
- env.debug_log.find("loader_add_implicit_layer: Disabling implicit layer VK_LAYER_LUNARG_override for using an old API "
- "version 1.1 versus application requested 1.2"));
+ // Newer component is allowed now
+ EXPECT_TRUE(env.debug_log.find(std::string("Insert instance layer ") + regular_layer_name));
env.debug_log.clear();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- EXPECT_EQ(0U, count);
+ EXPECT_EQ(2U, count);
std::array<VkLayerProperties, 2> layer_props;
- count = 2;
+
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, layer_props.data());
- EXPECT_EQ(0U, count);
+ EXPECT_EQ(2U, count);
+ EXPECT_TRUE(check_permutation({regular_layer_name, lunarg_meta_layer_name}, layer_props));
}
}
{ // 1.1 instance - should find the implicit layer
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 1, 0);
+ FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
inst.CheckCreate();
+ EXPECT_TRUE(env.debug_log.find(std::string("Insert instance layer ") + regular_layer_name));
+ env.debug_log.clear();
VkPhysicalDevice phys_dev = inst.GetPhysDev();
uint32_t count = 0;
EXPECT_EQ(1U, count);
ASSERT_TRUE(string_eq(regular_layer_name, layer_props.layerName));
}
- { // 1.2 instance -- instance layer shouldn't be found
- DebugUtilsLogger log;
+ { // 1.2 instance -- instance layer should be found
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 2, 0);
- FillDebugUtilsCreateDetails(inst.create_info, log);
+ FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
inst.CheckCreate();
- VkPhysicalDevice phys_dev = inst.GetPhysDev();
-
- ASSERT_TRUE(log.find(std::string("loader_add_implicit_layer: Disabling implicit layer ") + regular_layer_name +
- " for using an old API version 1.1 versus application requested 1.2"));
+ EXPECT_TRUE(env.debug_log.find(std::string("Insert instance layer ") + regular_layer_name));
+ env.debug_log.clear();
+ VkPhysicalDevice phys_dev = inst.GetPhysDev();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
VkLayerProperties layer_props{};
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, &layer_props);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
+ ASSERT_TRUE(string_eq(regular_layer_name, layer_props.layerName));
}
}
EXPECT_EQ(layer_count, 1U);
EXPECT_TRUE(string_eq(layer_props[0].layerName, regular_layer_name));
}
- { // 1.0 instance -- instance layer should be found
+ { // 1.0 instance
DebugUtilsLogger log;
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 0, 0);
FillDebugUtilsCreateDetails(inst.create_info, log);
inst.CheckCreate();
- ASSERT_TRUE(log.find(std::string("loader_add_implicit_layer: Disabling implicit layer ") + regular_layer_name +
- " for using an old API version 0.1 versus application requested 1.0"));
+ EXPECT_TRUE(log.find(std::string("Insert instance layer ") + regular_layer_name));
VkPhysicalDevice phys_dev = inst.GetPhysDev();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
VkLayerProperties layer_props{};
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, &layer_props);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
+ ASSERT_TRUE(string_eq(regular_layer_name, layer_props.layerName));
}
- { // 1.1 instance -- instance layer should be found
+ { // 1.1 instance
DebugUtilsLogger log;
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 1, 0);
FillDebugUtilsCreateDetails(inst.create_info, log);
inst.CheckCreate();
- ASSERT_TRUE(log.find(std::string("loader_add_implicit_layer: Disabling implicit layer ") + regular_layer_name +
- " for using an old API version 0.1 versus application requested 1.1"));
+ EXPECT_TRUE(log.find(std::string("Insert instance layer ") + regular_layer_name));
VkPhysicalDevice phys_dev = inst.GetPhysDev();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
VkLayerProperties layer_props{};
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, &layer_props);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
+ ASSERT_TRUE(string_eq(regular_layer_name, layer_props.layerName));
}
- { // 1.2 instance -- instance layer shouldn't be found
+ { // 1.2 instance
DebugUtilsLogger log;
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 2, 0);
FillDebugUtilsCreateDetails(inst.create_info, log);
inst.CheckCreate();
VkPhysicalDevice phys_dev = inst.GetPhysDev();
- ASSERT_TRUE(log.find(std::string("loader_add_implicit_layer: Disabling implicit layer ") + regular_layer_name +
- " for using an old API version 0.1 versus application requested 1.2"));
-
+ EXPECT_TRUE(log.find(std::string("Insert instance layer ") + regular_layer_name));
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
VkLayerProperties layer_props{};
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, &layer_props);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
+ ASSERT_TRUE(string_eq(regular_layer_name, layer_props.layerName));
}
{ // application doesn't state its API version
DebugUtilsLogger log;
inst.create_info.set_fill_in_application_info(false);
FillDebugUtilsCreateDetails(inst.create_info, log);
inst.CheckCreate();
- EXPECT_TRUE(log.find(std::string("loader_add_implicit_layer: Disabling implicit layer ") + regular_layer_name +
- " for using an old API version 0.1 versus application requested 1.0"));
+ EXPECT_TRUE(log.find(std::string("Insert instance layer ") + regular_layer_name));
VkPhysicalDevice phys_dev = inst.GetPhysDev();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
VkLayerProperties layer_props{};
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, &layer_props);
- ASSERT_EQ(0U, count);
+ EXPECT_EQ(1U, count);
+ ASSERT_TRUE(string_eq(regular_layer_name, layer_props.layerName));
}
}