Allow meta layers to have newer component layers

Relax the requirement that all component layers in a meta layer must equal the version of the meta layer.
This allows enabling layers that do not have the same API version as the meta layer.
This commit is contained in:
Charles Giessen 2022-03-30 15:02:30 -06:00 committed by Charles Giessen
parent a06dd5484a
commit 469aead205
2 changed files with 11 additions and 11 deletions

View File

@ -111,9 +111,9 @@ loader_api_version loader_make_version(uint32_t version) {
loader_api_version loader_combine_version(uint32_t major, uint32_t minor, uint32_t patch) {
loader_api_version out_version;
out_version.major = major;
out_version.minor = minor;
out_version.patch = patch;
out_version.major = (uint16_t)major;
out_version.minor = (uint16_t)minor;
out_version.patch = (uint16_t)patch;
return out_version;
}
@ -1739,12 +1739,12 @@ static bool verify_meta_layer_component_layers(const struct loader_instance *ins
break;
}
// Check the version of each layer, they need to be equal
// Check the version of each layer, they need to be at least MAJOR and MINOR
loader_api_version comp_prop_version = loader_make_version(comp_prop->info.specVersion);
if (meta_layer_version.major != comp_prop_version.major || meta_layer_version.minor != comp_prop_version.minor) {
if (!loader_check_version_meets_required(meta_layer_version, comp_prop_version)) {
loader_log(inst, VULKAN_LOADER_WARN_BIT, 0,
"verify_meta_layer_component_layers: Meta-layer uses API version %d.%d, but component "
"layer %d uses API version %d.%d. Skipping this layer.",
"layer %d has API version %d.%d that is lower. Skipping this layer.",
meta_layer_version.major, meta_layer_version.minor, comp_layer, comp_prop_version.major,
comp_prop_version.minor);

View File

@ -857,9 +857,9 @@ TEST(OverrideMetaLayer, OlderComponentLayerInMetaLayer) {
inst.create_info.set_api_version(1, 1, 0);
inst.CheckCreate();
VkPhysicalDevice phys_dev = inst.GetPhysDev();
ASSERT_TRUE(
env.debug_log.find("verify_meta_layer_component_layers: Meta-layer uses API version 1.1, but component layer 0 uses "
"API version 1.0. Skipping this layer."));
EXPECT_TRUE(
env.debug_log.find("verify_meta_layer_component_layers: Meta-layer uses API version 1.1, but component layer 0 has API "
"version 1.0 that is lower. Skipping this layer."));
env.debug_log.clear();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);
@ -877,8 +877,8 @@ TEST(OverrideMetaLayer, OlderComponentLayerInMetaLayer) {
inst.CheckCreate();
VkPhysicalDevice phys_dev = inst.GetPhysDev();
ASSERT_TRUE(
env.debug_log.find("verify_meta_layer_component_layers: Meta-layer uses API version 1.1, but component layer 0 uses "
"API version 1.0. Skipping this layer."));
env.debug_log.find("verify_meta_layer_component_layers: Meta-layer uses API version 1.1, but component layer 0 has API "
"version 1.0 that is lower. Skipping this layer."));
env.debug_log.clear();
uint32_t count = 0;
env.vulkan_functions.vkEnumerateDeviceLayerProperties(phys_dev, &count, nullptr);