Skip to content

Commit

Permalink
vkconfig3: Unordered layers has only 'auto' and 'discard' control
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Nov 18, 2024
1 parent e4126bd commit c4e2dda
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 344 deletions.
231 changes: 0 additions & 231 deletions vkconfig/configurator.cpp

This file was deleted.

80 changes: 0 additions & 80 deletions vkconfig/main_gui.cpp

This file was deleted.

9 changes: 8 additions & 1 deletion vkconfig_core/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,15 @@ bool Configuration::Load(const Path& full_path, const LayerManager& layers) {
const std::string& version = ReadStringValue(json_layer_object, "version");
parameter.api_version = version == "latest" ? Version::LATEST : Version(version.c_str());
}
if (json_layer_object.value("type") != QJsonValue::Undefined) {
parameter.type = GetLayerType(json_layer_object.value("type").toString().toStdString().c_str());
}

const Layer* layer = layers.Find(parameter.key, parameter.api_version);

if (layer != nullptr) {
parameter.manifest = layer->manifest_path;
parameter.type = layer->type;
}

if (json_layer_object.value("manifest") != QJsonValue::Undefined) {
Expand Down Expand Up @@ -247,6 +251,7 @@ bool Configuration::Save(const Path& full_path, bool exporter) const {

QJsonObject json_layer;
json_layer.insert("name", parameter.key.c_str());
json_layer.insert("type", ::GetToken(parameter.type));
if (parameter.builtin != LAYER_BUILTIN_NONE) {
json_layer.insert("builtin", GetToken(parameter.builtin));
}
Expand Down Expand Up @@ -433,6 +438,7 @@ void Configuration::SwitchLayerVersion(const LayerManager& layers, const std::st

const Layer* new_layer = layers.FindFromManifest(manifest_path);
parameter->api_version = new_layer->api_version;
parameter->type = new_layer->type;
parameter->manifest = new_layer->manifest_path;
::CollectDefaultSettingData(new_layer->settings, parameter->settings);
}
Expand All @@ -442,8 +448,8 @@ void Configuration::SwitchLayerLatest(const LayerManager& layers, const std::str
assert(parameter != nullptr);

const Layer* new_layer = layers.Find(layer_key, Version::LATEST);

parameter->api_version = Version::LATEST;
parameter->type = new_layer->type;
parameter->manifest = new_layer->manifest_path;
::CollectDefaultSettingData(new_layer->settings, parameter->settings);
}
Expand Down Expand Up @@ -473,6 +479,7 @@ void Configuration::GatherParameters(const LayerManager& layers) {

Parameter parameter;
parameter.key = layer->key;
parameter.type = layer->type;
parameter.control = this->default_control;
parameter.api_version = Version::LATEST;
parameter.manifest = layer->manifest_path;
Expand Down
4 changes: 2 additions & 2 deletions vkconfig_core/configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,8 @@ std::string Configurator::GenerateVulkanStatus() const {
log += this->layers.Log();
log += this->configurations.Log();
log += this->executables.Log();
log += "Vulkan Loader Log:\n";
log += ::GenerateLoaderLog();
// log += "Vulkan Loader Log:\n";
// log += ::GenerateLoaderLog();

return log;
}
1 change: 1 addition & 0 deletions vkconfig_core/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct Parameter {
bool ApplyPresetSettings(const LayerPreset& preset);

std::string key;
LayerType type = LAYER_TYPE_EXPLICIT;
LayerControl control = LAYER_CONTROL_AUTO;
LayerBuiltin builtin = LAYER_BUILTIN_NONE;
int platform_flags = PLATFORM_DESKTOP_BIT;
Expand Down
Loading

0 comments on commit c4e2dda

Please sign in to comment.