mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-05-10 19:21:42 +00:00
dynamically unload layer and remove excess logging
This commit is contained in:
parent
7a460c7faf
commit
cfdf4e1d1b
5 changed files with 418 additions and 594 deletions
|
|
@ -11,9 +11,6 @@
|
||||||
"vkGetInstanceProcAddr": "layer_vkGetInstanceProcAddr",
|
"vkGetInstanceProcAddr": "layer_vkGetInstanceProcAddr",
|
||||||
"vkGetDeviceProcAddr": "layer_vkGetDeviceProcAddr"
|
"vkGetDeviceProcAddr": "layer_vkGetDeviceProcAddr"
|
||||||
},
|
},
|
||||||
"enable_environment": {
|
|
||||||
"ENABLE_LSFG": "1"
|
|
||||||
},
|
|
||||||
"disable_environment": {
|
"disable_environment": {
|
||||||
"DISABLE_LSFG": "1"
|
"DISABLE_LSFG": "1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ namespace Config {
|
||||||
std::shared_ptr<std::atomic_bool> valid;
|
std::shared_ptr<std::atomic_bool> valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Active configuration. Must be set in main.cpp.
|
||||||
|
extern Configuration activeConf;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Load the config file and create a file watcher.
|
/// Load the config file and create a file watcher.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ namespace {
|
||||||
std::optional<std::unordered_map<std::string, Configuration>> gameConfs;
|
std::optional<std::unordered_map<std::string, Configuration>> gameConfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Configuration Config::activeConf{};
|
||||||
|
|
||||||
bool Config::loadAndWatchConfig(const std::string& file) {
|
bool Config::loadAndWatchConfig(const std::string& file) {
|
||||||
if (!std::filesystem::exists(file))
|
if (!std::filesystem::exists(file))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
1000
src/layer.cpp
1000
src/layer.cpp
File diff suppressed because it is too large
Load diff
|
|
@ -73,9 +73,8 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string name = getProcessName();
|
const std::string name = getProcessName();
|
||||||
Config::Configuration conf{};
|
|
||||||
try {
|
try {
|
||||||
conf = Config::getConfig(name);
|
Config::activeConf = Config::getConfig(name);
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
std::cerr << "lsfg-vk: The configuration for " << name << " is invalid, exiting.\n";
|
std::cerr << "lsfg-vk: The configuration for " << name << " is invalid, exiting.\n";
|
||||||
std::cerr << e.what() << '\n';
|
std::cerr << e.what() << '\n';
|
||||||
|
|
@ -83,6 +82,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
// exit silently if not enabled
|
// exit silently if not enabled
|
||||||
|
auto& conf = Config::activeConf;
|
||||||
if (!conf.enable)
|
if (!conf.enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue