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

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

vulkan: add a constructor for LayerLibrary

There is no functional change.

Change-Id: I77b6c7c6a697cb25cee42cda3b5683885186545a
parent 9461b93f
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -58,12 +58,16 @@ struct Layer {


namespace {
namespace {


std::mutex g_library_mutex;
struct LayerLibrary {
struct LayerLibrary {
    LayerLibrary(const std::string& path_)
        : path(path_), dlhandle(nullptr), refcount(0) {}

    std::string path;
    std::string path;
    void* dlhandle;
    void* dlhandle;
    size_t refcount;
    size_t refcount;
};
};

std::mutex g_library_mutex;
std::vector<LayerLibrary> g_layer_libraries;
std::vector<LayerLibrary> g_layer_libraries;
std::vector<Layer> g_instance_layers;
std::vector<Layer> g_instance_layers;
std::vector<Layer> g_device_layers;
std::vector<Layer> g_device_layers;
@@ -238,7 +242,7 @@ void AddLayerLibrary(const std::string& path) {


    dlclose(dlhandle);
    dlclose(dlhandle);


    g_layer_libraries.push_back(LayerLibrary{path, nullptr, 0});
    g_layer_libraries.emplace_back(path);
}
}


void DiscoverLayersInDirectory(const std::string& dir_path) {
void DiscoverLayersInDirectory(const std::string& dir_path) {