Skip to content

Commit 5333f3b

Browse files
vkconfig: Fix global vk_layer_settings.txt being written when layers are not configured
Change-Id: If49d47f966efc011a9633dd3ca92c06359331c00
1 parent 80f9f07 commit 5333f3b

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

vkconfig_core/configurator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ QJsonObject Configurator::CreateJsonSettingObject(const Configurator::LoaderSett
196196
json_settings.insert("app_keys", json_app_keys);
197197
}
198198

199-
if (this->layers_override_enabled) {
199+
if (this->layers_override_enabled || this->mode == CONFIGURATOR_MODE_CMD) {
200200
json_settings.insert("layers", json_layers);
201201
}
202202

vkconfig_core/generate_layers_settings_file.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
// Create and write vk_layer_settings.txt file
2424
bool GenerateSettingsTXT(Configurator& configurator, OverrideArea override_area, const Path& layers_settings_path) {
25-
if (override_area & OVERRIDE_AREA_LAYERS_SETTINGS_BIT) {
25+
if (configurator.mode == CONFIGURATOR_MODE_CMD ||
26+
(configurator.layers_override_enabled && (override_area & OVERRIDE_AREA_LAYERS_SETTINGS_BIT))) {
2627
std::vector<LayersSettings> layers_settings_array;
2728

2829
switch (configurator.GetExecutableScope()) {

vkconfig_gui/tab_configurations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ void TabConfigurations::on_configurations_override_toggled() {
12081208
void TabConfigurations::on_configurations_override_toggled(bool checked) {
12091209
Configurator &configurator = Configurator::Get();
12101210
configurator.layers_override_enabled = checked;
1211-
configurator.Override(OVERRIDE_AREA_LOADER_SETTINGS_BIT);
1211+
configurator.Override(OVERRIDE_AREA_ALL);
12121212

12131213
this->UpdateUI(UPDATE_REBUILD_UI);
12141214
}

0 commit comments

Comments
 (0)