Skip to content

Commit

Permalink
vkconfig3: Fix adding new layers
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Dec 5, 2024
1 parent 612daa7 commit bc305a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vkconfig_core/configuration_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ void ConfigurationManager::LoadDefaultConfigurations(const LayerManager &layers)
}
}

void ConfigurationManager::UpdateLayers(const LayerManager &layers) {
for (std::size_t i = 0, n = this->available_configurations.size(); i < n; ++i) {
this->available_configurations[i].GatherParameters(layers);
}
}

void ConfigurationManager::SortConfigurations() {
struct Compare {
bool operator()(const Configuration &a, const Configuration &b) const {
Expand Down
2 changes: 2 additions & 0 deletions vkconfig_core/configuration_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class ConfigurationManager : public Serialize {
void LoadAllConfigurations(const LayerManager& layers);
void SaveAllConfigurations() const;

void UpdateLayers(const LayerManager& layers);

Configuration& CreateConfiguration(const LayerManager& layers, const std::string& configuration_name);
Configuration& DuplicateConfiguration(const LayerManager& layers, const std::string& configuration_name);
void RemoveConfiguration(const std::string& configuration_name);
Expand Down
2 changes: 2 additions & 0 deletions vkconfig_gui/tab_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ void TabLayers::on_layers_reload_pressed() {
std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::milliseconds(10));
}

configurator.configurations.UpdateLayers(configurator.layers);

std::string last_layers_path = configurator.layers.last_layers_path.AbsolutePath();

if (!configurator.Get(HIDE_MESSAGE_NOTIFICATION_LAYERS_LOADED)) {
Expand Down

0 comments on commit bc305a1

Please sign in to comment.