Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 279ccc00 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

vulkan: ignore device-only layers

Ignore device layers that have no matching instance layers.

Change-Id: I6460f8f0c3c1288c23843e0875fa6a90f7f6cb8d
parent 5f093bf1
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -226,16 +226,21 @@ bool LayerLibrary::EnumerateLayers(size_t library_idx,

        instance_layers.push_back(layer);
        ALOGV("  added instance layer '%s'", props.layerName);

        bool is_global = false;
        for (size_t j = 0; j < num_device_layers; j++) {
            const auto& dev_props = properties[num_instance_layers + j];
            if (memcmp(&props, &dev_props, sizeof(props)) == 0) {
                is_global = true;
                break;
            }
        }
    for (size_t i = 0; i < num_device_layers; i++) {
        const VkLayerProperties& props = properties[num_instance_layers + i];

        Layer layer;
        layer.properties = props;
        layer.library_idx = library_idx;
        if (!is_global)
            continue;

        layer.extensions.clear();
        if (enumerate_device_extensions) {
            uint32_t count;
            result = enumerate_device_extensions(
                VK_NULL_HANDLE, props.layerName, &count, nullptr);
            if (result != VK_SUCCESS) {