diff --git a/CMakeLists.txt b/CMakeLists.txt index ee99f65c88..c49e6d9278 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ find_package(valijson REQUIRED CONFIG) option(BUILD_TESTS "Build tests") option(RUN_ON_GITHUB "Build only tests that can run on Github" OFF) -option(BUILD_EXPERIMENTAL "Build tests for debugging layers" OFF) if(BUILD_TESTS) enable_testing() @@ -116,8 +115,6 @@ if(BUILD_LAYERMGR) endif() add_subdirectory(vkconfig_core) - add_subdirectory(vkconfig) - if(BUILD_EXPERIMENTAL) - add_subdirectory(vkconfig3) - endif() + add_subdirectory(vkconfig_cmd) + add_subdirectory(vkconfig_gui) endif() diff --git a/scripts/github_ci_linux.py b/scripts/github_ci_linux.py index 42710d3b90..752dbb849e 100644 --- a/scripts/github_ci_linux.py +++ b/scripts/github_ci_linux.py @@ -85,7 +85,7 @@ def BuildVT(args): print("Run Vulkan Tools Tests") os.chdir(VT_BUILD_DIR) - test_cmd = 'ctest --parallel %s --output-on-failure --config %s' % (os.cpu_count(), args.configuration) + test_cmd = 'ctest --parallel %s --output-on-failure' % (os.cpu_count()) RunShellCmd(test_cmd, VT_BUILD_DIR) print("Build Vulkan Configurator with QtCreator") diff --git a/vkconfig/README.md b/vkconfig/README.md deleted file mode 100644 index 1c574998fd..0000000000 --- a/vkconfig/README.md +++ /dev/null @@ -1,161 +0,0 @@ - -

LunarG

-

Copyright © 2015-2024 LunarG, Inc.

- -[![Creative Commons][3]][4] - -[3]: https://i.creativecommons.org/l/by-nd/4.0/88x31.png "Creative Commons License" -[4]: https://creativecommons.org/licenses/by-nd/4.0/ - -

- -*Vulkan Configurator* allows overriding the [layers configuration](https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderInterfaceArchitecture.md#layers) used by Vulkan applications at runtime. - -A Vulkan application may configure layers when creating a Vulkan Instance. This layers configuration may be overridden using *Vulkan Configurator* globally or for a selected list of Vulkan applications. - -Finally *Vulkan Configurator* allows using layers from user-defined directories. - -* **[Change Log](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/CHANGELOG.md)**: The history of *Vulkan Configurator* releases. -* **[Bug reports](https://github.com/LunarG/VulkanTools/issues)**: Open a GitHub issue when you encounter a bug. -* **[Roadmap](https://github.com/LunarG/VulkanTools/projects/2)**: Follow *Vulkan Configurator* future developments. -* **[Contributing](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/CONTRIBUTING.md)**: Submit a fix or a feature to *Vulkan Configurator*. - --------------- -## Platforms Support - -| OS | Windows | Linux | macOS | iOS | Android | -| --------| ------------------ | ------------------- | ------------------ | ------- | ------- | -| Support | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | - --------------- -## Downloads - -*Vulkan Configurator* is delivered with the [Vulkan SDK](https://vulkan.lunarg.com/sdk/home). - --------------- -## Using the Vulkan Configurator - -Vulkan Configurator is a graphical user interface (GUI) that may be launched from the console using `vkconfig`. - -The tool is distributed differently, depending on the platform: -- Ubuntu packages: Upon installing the `lunarg-vkconfig` package, the tools will be available from the command line as `vkconfig`. -- Linux tarball: The vkconfig executable comes pre-built; be sure Qt is installed to run it. Run vkconfig on the command line. - - On Ubuntu 20.04 Qt can be installed by running `sudo apt install qt5-default` -- Windows: The tool will be present on the start menu, in the Vulkan SDK menu. User can also invoke from a command line. -- macOS: The tool is provided as an application bundle. Run it by double-clicking the bundle from a Finder window. - -Vulkan Configurator may be used with command line arguments to override layers. Use `vkconfig --help` in the console for more information. - -On Windows 10, Vulkan Configurator can't output to 'Command Prompt' without a redirection to a file because it's a win32 application. -As a workaround, we can run Vulkan Configurator from 'MSYS'. - -![Vulkan Configurator Animated Presentation](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/presentation.gif) - - -### Selecting an Application - -The typical use-case for VkConfig is to make changes and run applications while the tool is still open so -that any changes made are not carried over when the tool exits. -Because of this, VkConfig has an application launcher built in which allows you to select which -application to run. - -![Application Selection](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vkconfig_applications_collapsed.png) - -Select between any previously-defined applications by clicking the down-facing error on the right of -the application line. -The application selection can also be expanded so the application name, executable path, command-line -arguments, and even the log file can be edited. -To edit these fields in-place, expand the application area by simply expanding the arrow to the left of -the word "Application". - -![Application Selection Expanded](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vkconfig_applications_expanded.png) - -To add or further edit an application in the launcher, click the 3 periods (`...`) to the far right -of the application field. -This will expand to an application dialog where applications can be added, edited, or removed. - -![Application Dialog](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vkconfig_applications_dialog.png) - - -### Applications Listed by Name - -Applications are now listed by name so the same application can be added with different names and -different command-line arguments. - -For example, "Rise of the Tomb Raider" and "Half-Life 2" are both available through Valve's Steam -store. -In order to run both application's, the `steam` executable must first be run, but with different -arguments. -Because applications are now listed by name, it is now possible to add both to the Application list so -they can be triggered individually. -This removes the need to edit the command-line when switching between them previously. - -This may also prove useful if running the same application with one or more different command-line -arguments. - - --------------- -## Terminology - -***[Vulkan Layer](https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderInterfaceArchitecture.md#layers)***: A layer is an optional library that can intercept Vulkan functions on their way from the Vulkan application down to the Vulkan drivers. Multiple layers can be chained together to use multiple layer functionalities simultaneously. - -***Vulkan Layers Configuration***: A collection of Vulkan Layers executed in [a specific order](#vulkan-layers-execution-order-overview) with specific settings for each layer. - -***[Vulkan Explicit Layers vs Implicit Layer](https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderApplicationInterface.md#implicit-vs-explicit-layers)***: An explicit layer has to be explicitly activated by the user from source in `vkCreateInstance`, using Vulkan Configurator or `VK_INSTANCE_LAYERS` environment variable. Implicit layers are enabled by their existence on the system by default. - -***[Vulkan Meta-Layer](https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderLayerInterface.md#override-meta-layer)***: Meta-layers are a special kind of layer which is only available through the desktop [Vulkan Loader](https://github.com/KhronosGroup/Vulkan-Loader). While usual layers are associated with one particular library, a meta-layer is actually a collection layer which contains an ordered list of other layers called *component layers*. - -***Vulkan Override Layer***: The Vulkan Override Layer is an implicit meta-layer found on the system with the name `VK_LAYER_LUNARG_override`. It is the mechanism used by *Vulkan Configurator* to override Vulkan applications layers. This layer contains: -- The ordered list of layers to activate -- The list of layers to exclude from execution -- The list of paths to executables that the layers override applies to. If this list is empty, the override is applied to every application upon startup. - -***Vulkan Layer settings***: Per-layer settings loaded by each layer library and stored in the `vk_layer_settings.txt` file. This file is located either next to the Vulkan application executable or set globally and applied to all Vulkan applications thanks to *Vulkan Configurator*. These settings are described [here for VK_LAYER_KHRONOS_validation](https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/layers/vk_layer_settings.txt) and [here for other layers created by LunarG](https://github.com/LunarG/VulkanTools/blob/main/layersvt/vk_layer_settings.txt). - --------------- -## Vulkan Layers execution order overview - -[ ![Vulkan Loader](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vulkan_layers_order_small.png) ](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vulkan_layers_order.png) - --------------- -## Vulkan Loader and Layers implementation overview - -[ ![Vulkan Loader](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vulkan_loader_640px.png) ](https://github.com/LunarG/VulkanTools/blob/main/vkconfig/images/vulkan_loader.png) - -For detailed information, read the [Architecture of the Vulkan Loader Interfaces](https://github.com/KhronosGroup/Vulkan-Loader/blob/main/loader/LoaderAndLayerInterface.md) document. - -## Vulkan Layers Settings - -### `vk_layer_settings.txt` - -The layer settings are stored into the `vk_layer_settings.txt` file and read directly by the layers. - -When *Vulkan Configurator is used to override layers, the Vulkan application local `vk_layer_settings.txt` file is ignored by layer ecosystem convention. - -*Vulkan Configurator* does not make any system-wide changes to a system, but it does make user-specific changes. -These changes are documented below: - -#### Linux and macOS - -Unix systems store files in the following paths: - -- `$HOME/.local/share/vulkan/implicit_layer.d/VkLayer_override.json` tells a Vulkan application which layers to use -- `$HOME/.local/share/vulkan/settings.d/vk_layer_settings.txt` tells Vulkan layers which settings to use - -#### Windows - -Windows systems store files in the following paths: - -- `%HOME%\AppData\Local\LunarG\vkconfig\override\VkLayerOverride.json` tells a Vulkan application which layers to use -- `%HOME%\AppData\Local\LunarG\vkconfig\override\vk_layer_settings.txt` tells Vulkan layers which settings to use - -In addition, Windows system create registry entries in the following locations: - -- `HKEY_CURRENT_USER\Software\Khronos\Vulkan\ImplicitLayers` will have an entry that points to the JSON file above -- `HKEY_CURRENT_USER\Software\Khronos\Vulkan\Settings` will have an entry that points to the text file above -- `HKEY_CURRENT_USER\Software\LunarG\vkconfig` stores the application settings for `vkconfig` - -### Environment Variables (Deprecated) - -OS Environment Variables are the legacy approach to configure layers however they should be considered deprecated in favor of using `vk_layer_settings.txt` either locally, next to the Vulkan Applications or globally, generated from *Vulkan Configurator*. - diff --git a/vkconfig/configurator.cpp b/vkconfig/configurator.cpp deleted file mode 100644 index ed757d51c6..0000000000 --- a/vkconfig/configurator.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Lenny Komow - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "configurator.h" -#include "vulkan_util.h" - -#include "dialog_layers.h" - -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/path.h" -#include "../vkconfig_core/override.h" -#include "../vkconfig_core/alert.h" - -#include -#include -#include -#include -#include - -#include -#include -#include - -Configurator &Configurator::Get(const std::string &VULKAN_SDK) { - static Configurator configurator(VULKAN_SDK); - return configurator; -} - -Configurator::Configurator(const std::string &VULKAN_SDK) - : path(VULKAN_SDK, SUPPORTED_CONFIG_FILES), environment(path), layers(environment), configurations(environment) {} - -Configurator::~Configurator() { - configurations.SaveAllConfigurations(layers.selected_layers); - - SurrenderConfiguration(environment); -} - -bool Configurator::Init() { - std::string selected_configuration = this->environment.GetSelectedConfiguration(); - - this->ActivateConfiguration(""); - - this->UpdateDevices(); - - // Load simple app settings, the additional search paths, and the - // override app list. - this->layers.LoadAllInstalledLayers(); - - QSettings settings; - if (settings.value("crashed", QVariant(false)).toBool()) { - settings.setValue("crashed", false); - - if (Alert::ConfiguratorCrashed() == QMessageBox::No) { - this->configurations.LoadAllConfigurations(this->layers.selected_layers); - } - } else { - this->configurations.LoadAllConfigurations(this->layers.selected_layers); - } - - if (this->configurations.Empty()) { - this->configurations.ResetDefaultsConfigurations(layers.selected_layers); - } else { - this->configurations.FirstDefaultsConfigurations(layers.selected_layers); - } - - this->ActivateConfiguration(selected_configuration); - - return true; -} - -void Configurator::ActivateConfiguration(const std::string &configuration_name) { - Configuration *configuration = nullptr; - if (!configuration_name.empty()) { - configuration = FindByKey(this->configurations.available_configurations, configuration_name.c_str()); - } - - if (configuration_name.empty()) { - this->environment.SetSelectedConfiguration(""); - this->configurations.Configure(this->layers.selected_layers); - } else if (configuration == nullptr) { - QMessageBox alert; - alert.QDialog::setWindowTitle("Vulkan layers configuration is missing..."); - const std::string text = format("%s couldn't find '%s' layers configuration.", VKCONFIG_NAME, configuration_name.c_str()); - alert.setText(text.c_str()); - alert.setInformativeText("Vulkan Configurator is switching to Layers Controlled by Vulkan Application mode"); - alert.setIcon(QMessageBox::Critical); - alert.exec(); - - this->environment.SetSelectedConfiguration(""); - this->environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - this->configurations.Configure(this->layers.selected_layers); - } else { - // If the layers paths are differents, we need to reload the layers and the configurations - const std::vector paths = this->environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_GUI); - if (configuration->user_defined_paths != paths) { - this->configurations.SaveAllConfigurations(this->layers.selected_layers); - this->environment.SetPerConfigUserDefinedLayersPaths(configuration->user_defined_paths); - this->layers.LoadAllInstalledLayers(); - this->configurations.LoadAllConfigurations(this->layers.selected_layers); - } - - this->environment.SetSelectedConfiguration(configuration_name.c_str()); - - std::string missing_layer; - if (::HasMissingLayer(configuration->parameters, layers.selected_layers, missing_layer)) { - QMessageBox alert; - alert.QDialog::setWindowTitle("Vulkan layer missing..."); - alert.setText(format("%s couldn't find '%s' layer required by '%s' configuration:", VKCONFIG_NAME, - missing_layer.c_str(), configuration->key.c_str()) - .c_str()); - alert.setInformativeText("Do you want to edit the configuration to locate the layer?"); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Warning); - if (alert.exec() == QMessageBox::Yes) { - LayersDialog dlg(nullptr, *configuration); - dlg.exec(); - - ActivateConfiguration(configuration->key); - } - } else { - this->configurations.Configure(this->layers.selected_layers); - } - } -} - -void Configurator::UpdateDevices() { - QLibrary library(GetVulkanLibrary()); - - VkInstance instance = VK_NULL_HANDLE; - VkResult err = CreateInstance(library, instance, false); - - if (err != VK_SUCCESS) { - err = CreateInstance(library, instance, true); - if (err != VK_SUCCESS) { - return; - } - } - - PFN_vkEnumeratePhysicalDevices pfnEnumeratePhysicalDevices = - (PFN_vkEnumeratePhysicalDevices)library.resolve("vkEnumeratePhysicalDevices"); - PFN_vkDestroyInstance pfnDestroyInstance = (PFN_vkDestroyInstance)library.resolve("vkDestroyInstance"); - PFN_vkGetPhysicalDeviceProperties pfnGetPhysicalDeviceProperties = - (PFN_vkGetPhysicalDeviceProperties)library.resolve("vkGetPhysicalDeviceProperties"); - - if (pfnEnumeratePhysicalDevices == nullptr || pfnDestroyInstance == nullptr || pfnGetPhysicalDeviceProperties == nullptr) { - return; - } - - uint32_t gpu_count = 0; - err = pfnEnumeratePhysicalDevices(instance, &gpu_count, NULL); - assert(!err); - - std::vector devices; - if (gpu_count > 0) { - devices.resize(gpu_count); - - err = pfnEnumeratePhysicalDevices(instance, &gpu_count, &devices[0]); - assert(!err); - } - - this->device_names.clear(); - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - VkPhysicalDeviceProperties properties; - pfnGetPhysicalDeviceProperties(devices[i], &properties); - - this->device_names.push_back(properties.deviceName); - } - - pfnDestroyInstance(instance, NULL); -} - -bool Configurator::SupportDifferentLayerVersions(Version *return_loader_version) const { - // Check loader version - const Version version = GetVulkanLoaderVersion(); - assert(version != Version::VERSION_NULL); - - if (return_loader_version) { - *return_loader_version = version; - } - - return version >= Version("1.3.212"); -} - -bool Configurator::SupportApplicationList(Version *return_loader_version) const { - // Check loader version - const Version version = GetVulkanLoaderVersion(); - assert(version != Version::VERSION_NULL); - - if (return_loader_version) { - *return_loader_version = version; - } - - return version >= Version("1.2.141"); -} - -void Configurator::ResetToDefault(bool hard) { - if (hard) { - this->environment.Reset(Environment::CLEAR); - this->layers.LoadAllInstalledLayers(); - this->configurations.ResetDefaultsConfigurations(this->layers.selected_layers); - - this->ActivateConfiguration(this->environment.GetSelectedConfiguration()); - } else { - this->configurations.ReloadDefaultsConfigurations(this->layers.selected_layers); - } -} - -std::vector Configurator::GetDeviceNames() const { return device_names; } diff --git a/vkconfig/dialog_about.cpp b/vkconfig/dialog_about.cpp deleted file mode 100644 index 982058e889..0000000000 --- a/vkconfig/dialog_about.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "dialog_about.h" - -AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::dialog_about) { - ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - connect(ui->pbAboutQt, SIGNAL(clicked()), this, SLOT(aboutQt())); -} - -void AboutDialog::aboutQt() { qApp->aboutQt(); } diff --git a/vkconfig/dialog_about.ui b/vkconfig/dialog_about.ui deleted file mode 100644 index 399364cc8a..0000000000 --- a/vkconfig/dialog_about.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - dialog_about - - - - 0 - 0 - 417 - 195 - - - - - 0 - 0 - - - - - 417 - 195 - - - - - 417 - 195 - - - - - Arial - 10 - - - - About Vulkan Configurator - - - - - 80 - 150 - 301 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - 180 - 20 - 241 - 41 - - - - - Arial - 10 - 50 - false - - - - Qt::LeftToRight - - - Copyright (c) 2020-2024 LunarG, Inc. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - 180 - 50 - 251 - 31 - - - - - Arial - 10 - 50 - false - - - - Licensed under Apache 2.0 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - 20 - 10 - 161 - 71 - - - - - - - :/resourcefiles/lunarg_logo.png - - - - - - 130 - 100 - 231 - 41 - - - - - Arial - 10 - 50 - false - - - - Qt licensed under LGPL 3.0 - - - true - - - - - - 130 - 150 - 81 - 32 - - - - About Qt - - - - - - 20 - 100 - 91 - 81 - - - - - - - :/resourcefiles/qt_logo.png - - - - - - - - - buttonBox - accepted() - dialog_about - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - dialog_about - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/vkconfig/dialog_applications.cpp b/vkconfig/dialog_applications.cpp deleted file mode 100644 index 07053cc16e..0000000000 --- a/vkconfig/dialog_applications.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "dialog_applications.h" -#include "configurator.h" - -#include "../vkconfig_core/alert.h" - -#include -#include -#include -#include - -#include - -ApplicationsDialog::ApplicationsDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::dialog_applications()), _last_selected_application_index(-1) { - ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - Configurator &configurator = Configurator::Get(); - - // The header is hidden by default and stays hidden when no checkboxes are used. - if (!configurator.environment.GetUseApplicationList()) - setWindowTitle("Vulkan Applications Launcher Shortcuts"); - else { - ui->treeWidget->setHeaderHidden(false); - ui->treeWidget->setHeaderLabel("Check to override Vulkan layers"); - } - - // Show the current list - const std::vector &applications = configurator.environment.GetApplications(); - for (std::size_t i = 0, n = applications.size(); i < n; ++i) { - CreateApplicationItem(applications[i]); - } - - ui->treeWidget->installEventFilter(this); - - connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, - SLOT(selectedPathChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(itemChanged(QTreeWidgetItem *, int))); - connect(ui->lineEditAppName, SIGNAL(textEdited(const QString &)), this, SLOT(editAppName(const QString &))); - connect(ui->lineEditExecutable, SIGNAL(textEdited(const QString &)), this, SLOT(editExecutable(const QString &))); - connect(ui->lineEditCmdArgs, SIGNAL(textEdited(const QString &)), this, SLOT(editCommandLine(const QString &))); - connect(ui->lineEditWorkingFolder, SIGNAL(textEdited(const QString &)), this, SLOT(editWorkingFolder(const QString &))); - connect(ui->lineEditLogFile, SIGNAL(textEdited(const QString &)), this, SLOT(editLogFile(const QString &))); - - // If there is an item in the tree (nullptr is okay here), make it the currently selected item. - // This is a work around for macOS, where the currentItemChanged() signal is being emitted (by something) - // after this constructor, without actually selecting the first row. The effect there is, the remove button is - // enabled, and the first item is selected, but not visibly so. Repainting does not fix the issue either. This - // is a macOS only fix, but is put in for all platforms so that the GUI behavior is consistent across all - // platforms. - QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0); - ui->treeWidget->setCurrentItem(item); -} - -bool ApplicationsDialog::eventFilter(QObject *target, QEvent *event) { - // Launch tree does some fancy resizing and since it's down in - // layouts and splitters, we can't just rely on the resize method - // of this window. - if (target == ui->treeWidget) { - if (event->type() == QEvent::Resize) { - ui->treeWidget->resizeColumnToContents(1); - int nLastColumnWidth = ui->treeWidget->columnWidth(1); - QRect rect = ui->treeWidget->geometry(); - ui->treeWidget->setColumnWidth(0, rect.width() - nLastColumnWidth); - } - } - return false; -} - -/// Make sure any changes are saved -void ApplicationsDialog::closeEvent(QCloseEvent *event) { - Environment &environment = Configurator::Get().environment; - - event->accept(); - - // When we don't use overridden list only, no need to alert the user about empty list cases. - if (!environment.GetUseApplicationList()) return; - - if (environment.GetApplications().empty() || !environment.HasOverriddenApplications()) { - environment.SetUseApplicationList(false); - - Alert::ApplicationListEmpty(); - } -} - -/// Browse for and select an executable file to add to the list. -void ApplicationsDialog::on_pushButtonAdd_clicked() // Pick the test application -{ - Configurator &configurator = Configurator::Get(); - - const std::string suggested_path(configurator.path.GetPath(PATH_EXECUTABLE).c_str()); - std::string executable_full_path = configurator.path.SelectPath(this, PATH_EXECUTABLE, suggested_path).c_str(); - - // If they have selected something! - if (!executable_full_path.empty()) { - // On macOS, they may have selected a binary, or they may have selected an app bundle. - // If the later, we need to drill down to the actuall applicaiton - if (executable_full_path.find(".app") != std::string::npos) { - // Start by drilling down - ExactExecutableFromAppBundle(executable_full_path); - } - - std::string app_name; - if (executable_full_path.find(GetNativeSeparator()) != std::string::npos) { - app_name = executable_full_path.substr(executable_full_path.rfind(GetNativeSeparator()) + 1); - } else { - app_name = executable_full_path; - } - - Application new_application(app_name, executable_full_path, ""); - configurator.environment.AppendApplication(new_application); - - QTreeWidgetItem *item = CreateApplicationItem(new_application); - - // To update the application list configuration - configurator.configurations.Configure(configurator.layers.selected_layers); - - ui->treeWidget->setCurrentItem(item); - configurator.environment.SelectActiveApplication(ui->treeWidget->indexOfTopLevelItem(item)); - } -} - -QTreeWidgetItem *ApplicationsDialog::CreateApplicationItem(const Application &application) const { - Configurator &configurator = Configurator::Get(); - - QTreeWidgetItem *item = new QTreeWidgetItem(); - ui->treeWidget->addTopLevelItem(item); - - if (configurator.environment.GetUseApplicationList()) { - QCheckBox *check_box = new QCheckBox(application.app_name.c_str()); - check_box->setChecked(application.layers_mode != LAYERS_MODE_BY_APPLICATIONS); - ui->treeWidget->setItemWidget(item, 0, check_box); - connect(check_box, SIGNAL(stateChanged(int)), this, SLOT(OnStateChanged(int))); - } else { - item->setText(0, application.app_name.c_str()); - } - - return item; -} - -/// Easy enough, just remove the selected program from the list -void ApplicationsDialog::on_pushButtonRemove_clicked() { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - int selection = ui->treeWidget->indexOfTopLevelItem(current); - assert(selection >= 0 && selection < ui->treeWidget->topLevelItemCount()); - - Configurator &configurator = Configurator::Get(); - - ui->treeWidget->takeTopLevelItem(selection); - ui->treeWidget->setCurrentItem(nullptr); - configurator.environment.RemoveApplication(selection); - - ui->groupLaunchInfo->setEnabled(false); - ui->pushButtonRemove->setEnabled(false); - ui->pushButtonSelect->setEnabled(false); - ui->lineEditAppName->setText(""); - ui->lineEditExecutable->setText(""); - ui->lineEditCmdArgs->setText(""); - ui->lineEditWorkingFolder->setText(""); - ui->lineEditLogFile->setText(""); - - // Update the application list configuration - configurator.configurations.Configure(configurator.layers.selected_layers); - - ui->treeWidget->update(); -} - -// Dismiss the dialog, and preserve app information so it can be set to -// the launcher. -void ApplicationsDialog::on_pushButtonSelect_clicked() { - Configurator &configurator = Configurator::Get(); - QTreeWidgetItem *item = ui->treeWidget->currentItem(); - if (item != nullptr) { - configurator.environment.SelectActiveApplication(ui->treeWidget->indexOfTopLevelItem(item)); - } - - close(); -} - -/// The remove button is disabled until/unless something is selected that can -/// be removed. Also the working folder and command line arguments are updated -void ApplicationsDialog::selectedPathChanged(QTreeWidgetItem *current_item, QTreeWidgetItem *previous_item) { - (void)previous_item; - int application_index = ui->treeWidget->indexOfTopLevelItem(current_item); - - ui->groupLaunchInfo->setEnabled(application_index >= 0); - ui->pushButtonRemove->setEnabled(application_index >= 0); - ui->pushButtonSelect->setEnabled(application_index >= 0); - - if (application_index < 0) { - ui->lineEditAppName->setText(""); - ui->lineEditExecutable->setText(""); - ui->lineEditCmdArgs->setText(""); - ui->lineEditWorkingFolder->setText(""); - ui->lineEditLogFile->setText(""); - return; - } - - const Application &application = Configurator::Get().environment.GetApplication(application_index); - - ui->lineEditAppName->setText(application.app_name.c_str()); - ui->lineEditExecutable->setText(application.executable_path.c_str()); - ui->lineEditExecutable->setToolTip(ReplaceBuiltInVariable(application.executable_path.c_str()).c_str()); - ui->lineEditWorkingFolder->setText(application.working_folder.c_str()); - ui->lineEditWorkingFolder->setToolTip(ReplaceBuiltInVariable(application.working_folder.c_str()).c_str()); - ui->lineEditCmdArgs->setText(application.arguments.c_str()); - ui->lineEditLogFile->setText(application.log_file.c_str()); - ui->lineEditLogFile->setToolTip(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); -} - -void ApplicationsDialog::itemChanged(QTreeWidgetItem *item, int column) { - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(item); - QCheckBox *check_box = dynamic_cast(ui->treeWidget->itemWidget(item, column)); - if (check_box != nullptr) { - Configurator::Get().environment.GetApplication(_last_selected_application_index).layers_mode = - check_box->isChecked() ? LAYERS_MODE_BY_CONFIGURATOR_RUNNING : LAYERS_MODE_BY_APPLICATIONS; - } -} - -/// Something was clicked. We don't know what, and short of setting up a new -/// signal/slot for each button, this seemed a reasonable approach. Just poll -/// all of them. There aren't that many, so KISS (keep it simple stupid) -/// If one of them had their state flipped, that's the one that was checked, make -/// it the currently selected one. -void ApplicationsDialog::OnStateChanged(int) { - Environment &environment = Configurator::Get().environment; - const bool need_checkbox = environment.GetUseApplicationList(); - if (!need_checkbox) return; - - // Loop through the whole list and reset the checkboxes - for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++) { - QTreeWidgetItem *item = ui->treeWidget->topLevelItem(i); - QCheckBox *check_box = dynamic_cast(ui->treeWidget->itemWidget(item, 0)); - assert(check_box != nullptr); - environment.GetApplication(i).layers_mode = - check_box->isChecked() ? LAYERS_MODE_BY_CONFIGURATOR_RUNNING : LAYERS_MODE_BY_APPLICATIONS; - } -} - -void ApplicationsDialog::editAppName(const QString &name) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).app_name = name.toStdString(); -} - -void ApplicationsDialog::editExecutable(const QString &executable) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).executable_path = executable.toStdString(); -} - -void ApplicationsDialog::editCommandLine(const QString &cmdLine) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).arguments = cmdLine.toStdString(); -} - -void ApplicationsDialog::editWorkingFolder(const QString &workingFolder) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).working_folder = workingFolder.toStdString(); -} - -void ApplicationsDialog::editLogFile(const QString &logFile) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).log_file = logFile.toStdString(); -} diff --git a/vkconfig/dialog_applications.h b/vkconfig/dialog_applications.h deleted file mode 100644 index e676324ce2..0000000000 --- a/vkconfig/dialog_applications.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "ui_dialog_applications.h" - -#include "../vkconfig_core/application.h" - -#include - -class ApplicationsDialog : public QDialog { - Q_OBJECT - - public: - explicit ApplicationsDialog(QWidget *parent = nullptr); - - int GetSelectedLaunchApplicationIndex() const { return _last_selected_application_index; } - - private: - QTreeWidgetItem *CreateApplicationItem(const Application &application) const; - - void closeEvent(QCloseEvent *) override; - bool eventFilter(QObject *target, QEvent *event) override; - - public Q_SLOTS: - void on_pushButtonAdd_clicked(); // Pick the application - void on_pushButtonRemove_clicked(); // Remove - void on_pushButtonSelect_clicked(); // Make this the current launcher app - void selectedPathChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); // Used to enable remove button - void itemChanged(QTreeWidgetItem *item, int column_index); - - void OnStateChanged(int); - - void editAppName(const QString &name); - void editExecutable(const QString &name); - void editCommandLine(const QString &cmd_line); - void editWorkingFolder(const QString &working_folder); - void editLogFile(const QString &log_file); - - private: - ApplicationsDialog(const ApplicationsDialog &) = delete; - ApplicationsDialog &operator=(const ApplicationsDialog &) = delete; - - std::unique_ptr ui; - int _last_selected_application_index; -}; diff --git a/vkconfig/dialog_applications.ui b/vkconfig/dialog_applications.ui deleted file mode 100644 index dd52a4b9d8..0000000000 --- a/vkconfig/dialog_applications.ui +++ /dev/null @@ -1,176 +0,0 @@ - - - dialog_applications - - - - 0 - 0 - 606 - 375 - - - - - Arial - 10 - - - - Vulkan Applications with overridden Vulkan Layers - - - - - - Add... - - - - - - - false - - - Remove - - - - - - - false - - - Ok - - - - - - - - Arial - 10 - - - - - - - Qt::ScrollBarAlwaysOff - - - 4 - - - true - - - 1 - - - false - - - false - - - - 1 - - - - - - - - false - - - - 0 - 60 - - - - This information is used only when the application is launched manually from vkconfig. - - - Monitored Launch Info - - - - - - Application: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Executable: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Working Folder: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Command Line Arguments: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Log File - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - diff --git a/vkconfig/dialog_layers.cpp b/vkconfig/dialog_layers.cpp deleted file mode 100644 index 448bdbf19e..0000000000 --- a/vkconfig/dialog_layers.cpp +++ /dev/null @@ -1,744 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "dialog_layers.h" - -#include "configurator.h" - -#include "../vkconfig_core/alert.h" -#include "../vkconfig_core/platform.h" -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/doc.h" - -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include - -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS -// From Stack Overflow. -#define MKPTR(p1, p2) ((DWORD_PTR)(p1) + (DWORD_PTR)(p2)) - -typedef enum _pe_architecture { - PE_ARCHITECTURE_UNKNOWN = 0x0000, - PE_ARCHITECTURE_ANYCPU = 0x0001, - PE_ARCHITECTURE_X86 = 0x010B, - PE_ARCHITECTURE_x64 = 0x020B -} PE_ARCHITECTURE; - -static PE_ARCHITECTURE GetImageArchitecture(void *pImageBase) { - // Parse and validate the DOS header - IMAGE_DOS_HEADER *pDosHd = (IMAGE_DOS_HEADER *)pImageBase; - if (IsBadReadPtr(pDosHd, sizeof(pDosHd->e_magic)) || pDosHd->e_magic != IMAGE_DOS_SIGNATURE) return PE_ARCHITECTURE_UNKNOWN; - - // Parse and validate the NT header - IMAGE_NT_HEADERS *pNtHd = (IMAGE_NT_HEADERS *)MKPTR(pDosHd, pDosHd->e_lfanew); - if (IsBadReadPtr(pNtHd, sizeof(pNtHd->Signature)) || pNtHd->Signature != IMAGE_NT_SIGNATURE) return PE_ARCHITECTURE_UNKNOWN; - - // First, naive, check based on the 'Magic' number in the Optional Header. - PE_ARCHITECTURE architecture = (PE_ARCHITECTURE)pNtHd->OptionalHeader.Magic; - - return architecture; -} - -// End Stack Overflow -#endif - -/// Utility function to see if the file is 32-bit -static bool IsDLL32Bit(const std::string full_path) { -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS - if (full_path.empty()) return false; - - QFile file(full_path.c_str()); - if (!file.open(QIODevice::ReadOnly)) { - return false; // punt... - } - - // Not gonna lie, just guessed 1024 and it was enough. - // This is the minimum page size on any OS (I might be wrong, - // it could be 4096), so going lower is not really helpful. - // Changed to 4096 on a whim; looking for crashing bug I can't debug - void *header = file.map(0, 4096, QFileDevice::MapPrivateOption); - - // Another punt as we may not be able to map the file - if (header == nullptr) return false; - - PE_ARCHITECTURE arch = GetImageArchitecture(header); - - file.unmap((uchar *)header); - file.close(); - - return (PE_ARCHITECTURE_X86 == arch); -#else - (void)full_path; - return false; -#endif -} - -LayersDialog::LayersDialog(QWidget *parent, const Configuration &configuration) - : QDialog(parent), configuration(configuration), ui(new Ui::dialog_layers) { - ui->setupUi(this); - - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - Configurator &configurator = Configurator::Get(); - configurator.configurations.SaveAllConfigurations(configurator.layers.selected_layers); - - ui->lineEditName->setText(configuration.key.c_str()); - ui->lineEditName->setFocus(); - ui->lineEditDescription->setText(configuration.description.c_str()); - ui->buttonBox->setEnabled(!configurator.layers.Empty()); - ui->pushButtonRemove->setEnabled(false); - - Environment &environment = configurator.environment; - restoreGeometry(environment.Get(LAYOUT_LAYER_GEOMETRY)); - - const QByteArray &restore_splitter_state = environment.Get(LAYOUT_LAYER_SPLITTER); - if (restore_splitter_state.isEmpty()) { - ui->splitter->setSizes(QList({300, 30})); - } else { - ui->splitter->restoreState(environment.Get(LAYOUT_LAYER_SPLITTER)); - } - - QTreeWidgetItem *header_item = ui->layerTree->headerItem(); - - header_item->setText(0, "Layers"); - header_item->setText(1, "Usage"); - - connect(ui->layerTree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, - SLOT(currentLayerChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - - connect(ui->layerTreeSorted, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, - SLOT(OnLayerTreeSortedClicked(QTreeWidgetItem *, int))); - - this->Reinit(); -} - -LayersDialog::~LayersDialog() { - Environment &environment = Configurator::Get().environment; - - environment.Set(LAYOUT_LAYER_SPLITTER, ui->splitter->saveState()); - environment.Set(LAYOUT_LAYER_GEOMETRY, saveGeometry()); -} - -void LayersDialog::Reinit() { - this->BuildParameters(); - - this->LoadAvailableLayersUI(); - this->LoadSortedLayersUI(); - this->LoadUserDefinedPaths(); - - this->UpdateUI(); -} - -struct ParameterState { - std::string key; - LayerState state; -}; - -static std::vector StoreParameterStates(const std::vector ¶meters) { - std::vector ParameterStates; - for (std::size_t i = 0, n = parameters.size(); i < n; ++i) { - ParameterState state; - state.key = parameters[i].key; - state.state = parameters[i].state; - ParameterStates.push_back(state); - } - return ParameterStates; -} - -static void RestoreParameterStates(std::vector &Parameters, const std::vector &states) { - for (std::size_t i = 0, n = states.size(); i < n; ++i) { - Parameter *saved_parameter = FindByKey(Parameters, states[i].key.c_str()); - if (saved_parameter == nullptr) continue; - - saved_parameter->state = states[i].state; - } -} - -void LayersDialog::Reload() { - std::string configuration_name = this->configuration.key; - const std::vector &ParameterStates = StoreParameterStates(this->configuration.parameters); - std::vector user_defined_paths = this->configuration.user_defined_paths; - - Configurator &configurator = Configurator::Get(); - configurator.configurations.SaveAllConfigurations(configurator.layers.selected_layers); - configurator.configurations.available_configurations.clear(); - configurator.environment.SetPerConfigUserDefinedLayersPaths(this->configuration.user_defined_paths); - - configurator.layers.LoadAllInstalledLayers(); - configurator.configurations.LoadAllConfigurations(configurator.layers.selected_layers); - - Configuration *saved_configuration = - FindByKey(configurator.configurations.available_configurations, configuration_name.c_str()); - if (saved_configuration != nullptr) { - this->configuration = *saved_configuration; - this->BuildParameters(); - } - - RestoreParameterStates(this->configuration.parameters, ParameterStates); - this->configuration.user_defined_paths = user_defined_paths; - - configurator.environment.SetSelectedConfiguration(configuration_name); - configurator.configurations.Configure(configurator.layers.selected_layers); -} - -void LayersDialog::UpdateUI() { - this->UpdateButtons(); - - if (!selected_available_layer_name.empty()) { - for (int i = 0, n = ui->layerTree->topLevelItemCount(); i < n; ++i) { - TreeWidgetItemParameter *layer_item = dynamic_cast(ui->layerTree->topLevelItem(i)); - if (layer_item->layer_name != selected_available_layer_name) continue; - - ui->layerTree->setCurrentItem(layer_item); - } - } else if (ui->layerTree->topLevelItemCount() > 0) { - ui->layerTree->setCurrentItem(ui->layerTree->topLevelItem(0)); - } - - if (!selected_sorted_layer_name.empty() && ui->layerTreeSorted->topLevelItemCount() > 1) { - for (int i = 0, n = ui->layerTreeSorted->topLevelItemCount(); i < n; ++i) { - TreeWidgetItemParameter *layer_item = dynamic_cast(ui->layerTreeSorted->topLevelItem(i)); - if (layer_item->layer_name != selected_sorted_layer_name) continue; - - ui->layerTreeSorted->setCurrentItem(layer_item); - } - } else if (ui->layerTreeSorted->topLevelItemCount() > 1) { - ui->layerTreeSorted->setCurrentItem(ui->layerTreeSorted->topLevelItem(0)); - } - - ui->layerTreeSorted->setEnabled(ui->layerTreeSorted->topLevelItemCount() > 1); - - QTreeWidgetItem *current_sorted_layers = ui->layerTreeSorted->currentItem(); - const bool has_selected_sorted_item = current_sorted_layers != nullptr; - - const bool has_above_sorted_item = ui->layerTreeSorted->itemAbove(current_sorted_layers) != nullptr; - ui->pushButtonUp->setEnabled(has_selected_sorted_item && has_above_sorted_item); - - const bool has_below_sorted_item = ui->layerTreeSorted->itemBelow(current_sorted_layers) != nullptr; - ui->pushButtonDown->setEnabled(has_selected_sorted_item && has_below_sorted_item); -} - -void LayersDialog::OnLayerTreeSortedClicked(QTreeWidgetItem *item, int column) { - (void)column; - - TreeWidgetItemParameter *selected_sorted_item = dynamic_cast(item); - assert(selected_sorted_item); - - this->selected_available_layer_name = this->selected_sorted_layer_name = selected_sorted_item->layer_name; - - UpdateUI(); -} - -void LayersDialog::AddLayerItem(const Parameter ¶meter) { - assert(!parameter.key.empty()); - - std::vector &available_layers = Configurator::Get().layers.selected_layers; - - const Layer *layer = FindByKey(available_layers, parameter.key.c_str()); - - std::string decorated_name(parameter.key); - - bool is_implicit_layer = false; - if (layer != nullptr) { - if (layer->status != STATUS_STABLE) { - decorated_name += format(" (%s)", GetToken(layer->status)); - } - - decorated_name += format(" - %s", layer->api_version.str().c_str()); - - if (IsDLL32Bit(layer->manifest_path)) { - decorated_name += " (32-bit)"; - } - - if (layer->type == LAYER_TYPE_IMPLICIT) { - is_implicit_layer = true; - decorated_name += format(" - %s layer", GetLayerTypeLabel(layer->type)); - } - } else { - // A layers configuration may have excluded layer that are misssing because they are not available on this platform - // We simply hide these layers to avoid confusing the Vulkan developers - if (parameter.state == LAYER_STATE_EXCLUDED) return; - - decorated_name += " (Missing)"; - } - - TreeWidgetItemParameter *item = new TreeWidgetItemParameter(parameter.key.c_str()); - - item->setText(0, decorated_name.c_str()); - if (layer != nullptr) { - item->setToolTip(0, layer->manifest_path.c_str()); - } - item->setFlags(item->flags() | Qt::ItemIsSelectable); - item->setDisabled(layer == nullptr); - - // Add the top level item - ui->layerTree->addTopLevelItem(item); - - // Add a combo box. Default has gray background which looks hidious - WidgetTreeFriendlyComboBox *widget = new WidgetTreeFriendlyComboBox(item); - ui->layerTree->setItemWidget(item, 1, widget); - - if (layer != nullptr) { - std::string tooltip; - - bool disable_value = false; - bool enable_value = false; - - if (!layer->disable_env.empty()) { - disable_value = !qgetenv(layer->disable_env.c_str()).isEmpty(); - - tooltip += layer->disable_env + format(": %s", disable_value ? "true" : "false"); - } - - if (!layer->enable_env.empty()) { - enable_value = qgetenv(layer->enable_env.c_str()).toStdString() == layer->enable_value; - - tooltip += "; " + layer->enable_env + format(": %s", enable_value ? "true" : "false"); - } - - const std::string implicit_string = !disable_value || (!layer->enable_env.empty() && enable_value) - ? "Env Variables Controlled: On" - : "Env Variables Controlled: Off"; - - widget->setToolTip(tooltip.c_str()); - widget->addItem(is_implicit_layer ? implicit_string.c_str() : "Application-Controlled"); - } else { - widget->addItem("Application-Controlled"); - widget->setCurrentIndex(LAYER_STATE_APPLICATION_CONTROLLED); - } - - widget->addItem("Overridden / Forced On"); - widget->addItem("Excluded / Forced Off"); - widget->setCurrentIndex(parameter.state); - - this->connect(widget, SIGNAL(selectionMade(QTreeWidgetItem *, int)), this, SLOT(layerUseChanged(QTreeWidgetItem *, int))); -} - -void LayersDialog::LoadAvailableLayersUI() { - ui->layerTree->clear(); - - for (std::size_t i = 0, n = this->configuration.parameters.size(); i < n; ++i) { - AddLayerItem(this->configuration.parameters[i]); - } - - resizeEvent(nullptr); - - ui->layerTree->update(); -} - -void LayersDialog::LoadSortedLayersUI() { - ui->layerTreeSorted->clear(); - - for (std::size_t i = 0, n = this->configuration.parameters.size(); i < n; ++i) { - if (this->configuration.parameters[i].state != LAYER_STATE_OVERRIDDEN) continue; - - TreeWidgetItemParameter *sorted_layer_item = new TreeWidgetItemParameter(this->configuration.parameters[i].key.c_str()); - sorted_layer_item->setText(0, this->configuration.parameters[i].key.c_str()); - sorted_layer_item->setFlags(sorted_layer_item->flags() | Qt::ItemIsSelectable); - - ui->layerTreeSorted->addTopLevelItem(sorted_layer_item); - } -} - -void LayersDialog::LoadUserDefinedPaths() { - Configurator &configurator = Configurator::Get(); - - // Populate the tree - ui->layerTreePath->clear(); - - // Building the list is not obvious. Each custom path may have multiple layers and there - // could be duplicates, which are not allowed. The layer paths are traversed in order, and - // layers are used on a first occurance basis. So we can't just show the layers that are - // present in the folder (because they may not be used). We have to list the custom layer paths - // and then look for layers that are already loaded that are from that path. - - for (std::size_t path_index = 0, count = this->configuration.user_defined_paths.size(); path_index < count; ++path_index) { - const std::string user_defined_path(ConvertNativeSeparators(this->configuration.user_defined_paths[path_index])); - - QTreeWidgetItem *item = new QTreeWidgetItem(); - ui->layerTreePath->addTopLevelItem(item); - item->setText(0, user_defined_path.c_str()); - item->setExpanded(true); - - // Look for layers that are loaded that are also from this folder - for (std::size_t i = 0, n = configurator.layers.selected_layers.size(); i < n; ++i) { - const Layer &layer = configurator.layers.selected_layers[i]; - - const QFileInfo file_info(layer.manifest_path.c_str()); - const std::string path(ConvertNativeSeparators(file_info.path().toStdString())); - if (path != user_defined_path) { - continue; - } - - std::string decorated_name(layer.key); - if (layer.status != STATUS_STABLE) { - decorated_name += format(" (%s)", GetToken(layer.status)); - } - decorated_name += format(" - %s", layer.api_version.str().c_str()); - - QTreeWidgetItem *child = new QTreeWidgetItem(); - child->setText(0, decorated_name.c_str()); - item->addChild(child); - } - } -} - -// The only way to catch the resize from the layouts -// (which is screwing up the spacing with the combo boxes) -void LayersDialog::showEvent(QShowEvent *event) { - (void)event; - - resizeEvent(nullptr); -} - -void LayersDialog::resizeEvent(QResizeEvent *event) { - (void)event; - - const QFontMetrics fm = ui->layerTree->fontMetrics(); - const int combo_width = (fm.size(Qt::TextSingleLine, "Env Variables Controlled: Off").width() * 1.5); - const int width = ui->layerTree->width() - combo_width; - ui->layerTree->setColumnWidth(0, width); -} - -void LayersDialog::on_button_properties_clicked() { - const std::vector &selected_layers = Configurator::Get().layers.selected_layers; - const Layer *layer = FindByKey(selected_layers, this->selected_available_layer_name.c_str()); - - Alert::LayerProperties(layer); -} - -void LayersDialog::on_button_doc_clicked() { - const std::vector &selected_layers = Configurator::Get().layers.selected_layers; - const Layer *layer = FindByKey(selected_layers, this->selected_available_layer_name.c_str()); - const std::string path = format("%s/%s.html", GetPath(BUILTIN_PATH_APPDATA).c_str(), layer->key.c_str()); - ExportHtmlDoc(*layer, path); - QDesktopServices::openUrl(QUrl(("file:///" + path).c_str())); -} - -void LayersDialog::on_button_website_clicked() { - const std::vector &selected_layers = Configurator::Get().layers.selected_layers; - const Layer *layer = FindByKey(selected_layers, this->selected_available_layer_name.c_str()); - QDesktopServices::openUrl(QUrl(layer->url.c_str())); -} - -void LayersDialog::on_button_reset_clicked() { - Configurator &configurator = Configurator::Get(); - - QMessageBox alert; - alert.QDialog::setWindowTitle(format("Resetting *%s* configuration...", this->configuration.key.c_str()).c_str()); - alert.setText(format("Are you sure you want to reset the *%s* configuration?", this->configuration.key.c_str()).c_str()); - if (this->configuration.IsBuiltIn()) - alert.setInformativeText( - format("The configuration layers and settings will be restored to default built-in *%s* configuration.", - configuration.key.c_str()) - .c_str()); - else if (configurator.configurations.HasFile(this->configuration)) - alert.setInformativeText( - format("The configuration layers and settings will be reloaded using the *%s* saved file from previous %s run.", - configuration.key.c_str(), VKCONFIG_NAME) - .c_str()); - else - alert.setInformativeText("The configuration layers and settings will be reset to zero."); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Warning); - if (alert.exec() == QMessageBox::No) return; - - selected_available_layer_name.clear(); - selected_sorted_layer_name.clear(); - - configuration.Reset(configurator.layers.selected_layers, configurator.path); - - this->Reinit(); - - ui->button_reset->setEnabled(false); -} - -void LayersDialog::OverrideOrder(const std::string layer_name, const TreeWidgetItemParameter *below, - const TreeWidgetItemParameter *above) { - assert(below != nullptr); - assert(below != above); - - Parameter *below_parameter = FindByKey(configuration.parameters, below->layer_name.c_str()); - assert(below_parameter != nullptr); - Parameter *above_parameter = FindByKey(configuration.parameters, above->layer_name.c_str()); - assert(above_parameter != nullptr); - - this->selected_sorted_layer_name = this->selected_available_layer_name = layer_name; - - std::swap(below_parameter->overridden_rank, above_parameter->overridden_rank); - - OrderParameter(configuration.parameters, Configurator::Get().layers.selected_layers); - LoadAvailableLayersUI(); - LoadSortedLayersUI(); - LoadUserDefinedPaths(); - - UpdateUI(); -} - -void LayersDialog::on_pushButtonUp_clicked() { - TreeWidgetItemParameter *selected_item = dynamic_cast(ui->layerTreeSorted->currentItem()); - assert(selected_item); - TreeWidgetItemParameter *above_item = dynamic_cast(ui->layerTreeSorted->itemAbove(selected_item)); - assert(above_item); - - OverrideOrder(selected_item->layer_name, selected_item, above_item); - - ui->button_reset->setEnabled(true); - this->UpdateButtons(); -} - -void LayersDialog::on_pushButtonDown_clicked() { - TreeWidgetItemParameter *selected_item = dynamic_cast(ui->layerTreeSorted->currentItem()); - assert(selected_item); - TreeWidgetItemParameter *below_item = dynamic_cast(ui->layerTreeSorted->itemBelow(selected_item)); - assert(below_item); - - OverrideOrder(selected_item->layer_name, below_item, selected_item); - - ui->button_reset->setEnabled(true); - this->UpdateButtons(); -} - -void LayersDialog::currentLayerChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) { - (void)previous; - - TreeWidgetItemParameter *layer_item = dynamic_cast(current); - - if (layer_item == nullptr) { - this->selected_available_layer_name.clear(); - return; - } - - assert(!layer_item->layer_name.empty()); - - this->selected_available_layer_name = layer_item->layer_name.c_str(); - - ui->button_reset->setEnabled(true); - this->UpdateButtons(); -} - -void LayersDialog::UpdateButtons() { - const bool enabled = !selected_available_layer_name.empty(); - - bool enabled_url = false; - - if (enabled) { - std::vector &available_layers = Configurator::Get().layers.selected_layers; - const Layer *layer = FindByKey(available_layers, selected_available_layer_name.c_str()); - assert(layer != nullptr); - if (!layer->url.empty()) enabled_url = true; - } - - ui->button_properties->setEnabled(enabled); - ui->button_doc->setEnabled(enabled); - ui->button_website->setEnabled(enabled && enabled_url); -} - -void LayersDialog::OverrideAllExplicitLayers() { - for (auto it = this->configuration.parameters.begin(); it != this->configuration.parameters.end(); ++it) { - if (it->state != LAYER_STATE_APPLICATION_CONTROLLED) continue; - - Configurator &configurator = Configurator::Get(); - std::vector &available_layers = configurator.layers.selected_layers; - - const Layer *layer = FindByKey(available_layers, it->key.c_str()); - if (layer == nullptr) continue; - - if (layer->type == LAYER_TYPE_IMPLICIT) continue; - - if (it->key == "VK_LAYER_KHRONOS_validation") - it->state = LAYER_STATE_OVERRIDDEN; - else - it->state = LAYER_STATE_EXCLUDED; - } -} - -// Select the layer LayerState -void LayersDialog::layerUseChanged(QTreeWidgetItem *item, int selection) { - // Combo box changed. We first need to know which tree item was selected. - // Fortunatly, changing the combo box also changes the selected item. - assert(item); - assert(selection >= LAYER_STATE_FIRST && selection <= LAYER_STATE_LAST); - - TreeWidgetItemParameter *tree_layer_item = dynamic_cast(item); - assert(tree_layer_item != nullptr); - Parameter *current_parameter = FindByKey(configuration.parameters, tree_layer_item->layer_name.c_str()); - assert(current_parameter != nullptr); - - LayerState layer_state = static_cast(selection); - - if (layer_state == LAYER_STATE_OVERRIDDEN && current_parameter->key == "VK_LAYER_KHRONOS_profiles") { - if (Alert::LayerProfiles() == QMessageBox::Yes) { - OverrideAllExplicitLayers(); - } - } else if (layer_state == LAYER_STATE_EXCLUDED) { - const std::vector &selected_layers = Configurator::Get().layers.selected_layers; - const Layer *layer = FindByKey(selected_layers, tree_layer_item->layer_name.c_str()); - - if (layer != nullptr) { - if (layer->type == LAYER_TYPE_IMPLICIT) { - if (Alert::LayerImplicitExcluded(tree_layer_item->layer_name.c_str()) == QMessageBox::No) { - layer_state = LAYER_STATE_APPLICATION_CONTROLLED; - } - } - } - } - - current_parameter->state = layer_state; - current_parameter->overridden_rank = Parameter::NO_RANK; - - OrderParameter(this->configuration.parameters, Configurator::Get().layers.selected_layers); - - ui->button_reset->setEnabled(true); - - LoadAvailableLayersUI(); - LoadSortedLayersUI(); - LoadUserDefinedPaths(); - - UpdateUI(); -} - -void LayersDialog::on_layerTreePath_itemSelectionChanged() { ui->pushButtonRemove->setEnabled(true); } - -void LayersDialog::on_pushButtonAdd_clicked() { - Configurator &configurator = Configurator::Get(); - const std::string custom_path = configurator.path.SelectPath(this, PATH_USER_DEFINED_LAYERS_GUI); - - if (!custom_path.empty()) { - std::vector &user_defined_paths = this->configuration.user_defined_paths; - - if (std::find(user_defined_paths.begin(), user_defined_paths.end(), custom_path) == user_defined_paths.end()) { - user_defined_paths.push_back(custom_path); - - this->Reload(); - this->Reinit(); - } - } - - ui->buttonBox->setEnabled(!configurator.layers.Empty()); -} - -void LayersDialog::on_pushButtonRemove_clicked() { - // Which one is selected? We need the top item too - QTreeWidgetItem *selected = ui->layerTreePath->currentItem(); - if (selected == nullptr) { - ui->pushButtonRemove->setEnabled(false); - return; - } - - while (selected->parent() != nullptr) selected = selected->parent(); - - RemoveString(this->configuration.user_defined_paths, selected->text(0).toStdString()); - - this->Reload(); - this->Reinit(); - - // Nothing is selected, so disable remove button - ui->pushButtonRemove->setEnabled(false); -} - -void LayersDialog::accept() { - if (ui->lineEditName->text().isEmpty()) { - Alert::ConfigurationNameEmpty(); - return; - } - - if (!IsPortableFilename(ui->lineEditName->text().toStdString())) { - Alert::ConfigurationNameInvalid(); - return; - } - - /* ANSI character are allowed - if (ui->lineEditName->text().contains(QRegularExpression(QStringLiteral("[^\\x{0000}-\\x{007F}]")))) { - Alert::ConfigurationNameASCII(); - return; - } - */ - - Configurator &configurator = Configurator::Get(); - if (this->configuration.key != ui->lineEditName->text().toStdString() && - IsFound(configurator.configurations.available_configurations, ui->lineEditName->text().toStdString().c_str())) { - Alert::ConfigurationRenamingFailed(); - return; - } - - Version loader_version; - if (!configurator.SupportDifferentLayerVersions(&loader_version)) { - std::string log_versions; - if (!configurator.configurations.CheckLayersVersions(configurator.layers.selected_layers, &this->configuration, - log_versions)) { - Alert::LayerIncompatibleVersions(log_versions.c_str(), loader_version); - return; - } - } - - FilterParameters(this->configuration.parameters, LAYER_STATE_APPLICATION_CONTROLLED); - - Configuration *saved_configuration = - FindByKey(configurator.configurations.available_configurations, this->configuration.key.c_str()); - assert(saved_configuration != nullptr); - - if (saved_configuration->key != ui->lineEditName->text().toStdString()) { - configurator.configurations.RemoveConfigurationFile(saved_configuration->key); - } - - const std::string active_configuration_name = ui->lineEditName->text().toStdString(); - - saved_configuration->key = active_configuration_name; - saved_configuration->description = ui->lineEditDescription->text().toStdString(); - saved_configuration->parameters = this->configuration.parameters; - saved_configuration->user_defined_paths = this->configuration.user_defined_paths; - saved_configuration->setting_tree_state.clear(); - configurator.configurations.SaveAllConfigurations(configurator.layers.selected_layers); - - QDialog::accept(); -} - -void LayersDialog::reject() { - Configurator &configurator = Configurator::Get(); - Configuration *saved_configuration = - FindByKey(configurator.configurations.available_configurations, this->configuration.key.c_str()); - assert(saved_configuration != nullptr); - - if (saved_configuration->user_defined_paths != this->configuration.user_defined_paths) { - configurator.environment.SetPerConfigUserDefinedLayersPaths(saved_configuration->user_defined_paths); - // Restore layers - this->Reload(); - } - - QDialog::reject(); -} - -void LayersDialog::BuildParameters() { - Configurator &configurator = Configurator::Get(); - this->configuration.parameters = GatherParameters(this->configuration.parameters, configurator.layers.selected_layers); -} diff --git a/vkconfig/dialog_layers.h b/vkconfig/dialog_layers.h deleted file mode 100644 index bbcc7941bd..0000000000 --- a/vkconfig/dialog_layers.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "widget_tree_friendly_combobox.h" - -#include "../vkconfig_core/configuration.h" - -#include "ui_dialog_layers.h" - -#include -#include - -class TreeWidgetItemParameter : public QTreeWidgetItem { - public: - TreeWidgetItemParameter(const char *layer_name) : layer_name(layer_name) { assert(layer_name != nullptr); } - - std::string layer_name; -}; - -class LayersDialog : public QDialog { - Q_OBJECT - - public: - explicit LayersDialog(QWidget *parent, const Configuration &configuration); - ~LayersDialog(); - - public Q_SLOTS: - void accept() override; - void reject() override; - - void currentLayerChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); - - void on_button_properties_clicked(); - void on_button_doc_clicked(); - void on_button_website_clicked(); - void on_button_reset_clicked(); - void on_pushButtonUp_clicked(); - void on_pushButtonDown_clicked(); - void on_pushButtonAdd_clicked(); - void on_pushButtonRemove_clicked(); - void on_layerTreePath_itemSelectionChanged(); - - void OnLayerTreeSortedClicked(QTreeWidgetItem *item, int column); - - void layerUseChanged(QTreeWidgetItem *item, int selection); - - private: - LayersDialog(const LayersDialog &) = delete; - LayersDialog &operator=(const LayersDialog &) = delete; - - virtual void resizeEvent(QResizeEvent *event) override; - virtual void showEvent(QShowEvent *) override; - - void UpdateUI(); - - void UpdateButtons(); - - void LoadAvailableLayersUI(); - void LoadSortedLayersUI(); - void LoadUserDefinedPaths(); - void Reload(); - void Reinit(); - void AddLayerItem(const Parameter ¶meter); - void BuildParameters(); - void OverrideAllExplicitLayers(); - void OverrideOrder(const std::string layer_name, const TreeWidgetItemParameter *below, const TreeWidgetItemParameter *above); - - Configuration configuration; - std::string selected_available_layer_name; - std::string selected_sorted_layer_name; - - std::unique_ptr ui; -}; diff --git a/vkconfig/dialog_layers.ui b/vkconfig/dialog_layers.ui deleted file mode 100644 index 8952d76e01..0000000000 --- a/vkconfig/dialog_layers.ui +++ /dev/null @@ -1,555 +0,0 @@ - - - dialog_layers - - - - 0 - 0 - 1024 - 640 - - - - - 1024 - 640 - - - - - 10000 - 10000 - - - - - 0 - 0 - - - - - Arial - 10 - - - - Edit Vulkan Layers - - - - - - - 0 - 0 - - - - - 250 - 80 - - - - - 16777215 - 80 - - - - - 0 - 1 - - - - - - - - - - Description: - - - - - - - - 0 - 24 - - - - Description of your user-defined configuration - - - - - - - - 0 - 24 - - - - - - - Name of your new user-defined configuration - - - - - - - Name: - - - - - - - - - - 1 - - - Qt::Vertical - - - false - - - 10 - - - false - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Show Properties... - - - - - - - Show Documentation... - - - - - - - Visit Website... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 120 - 0 - - - - - 1000 - 16777215 - - - - Reset - - - - - - - - - - 0 - 0 - - - - - 0 - 32 - - - - - 0 - 32 - - - - - Arial - 10 - - - - QFrame::Box - - - QFrame::Plain - - - false - - - false - - - QAbstractItemView::NoDragDrop - - - Qt::IgnoreAction - - - false - - - true - - - 0 - - - 0 - - - - 1 - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 1 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 32 - - - - - 16777215 - 16777215 - - - - - 0 - 32 - - - - - Arial - 10 - - - - Overridden layers ordering requires multiple layers - - - QFrame::Box - - - QFrame::Plain - - - false - - - - 1 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Execute Closer to the Vulkan Applications - - - - - - - Execute Closer to the Vulkan Drivers - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::Box - - - QFrame::Plain - - - 1 - - - false - - - 0 - - - 0 - - - - 1 - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Add User-Defined Path... - - - - - - - Remove User-Defined Path - - - - - - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - false - - - - - - - layerTree - - - - - buttonBox - accepted() - dialog_layers - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - dialog_layers - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/vkconfig/dialog_vulkan_analysis.cpp b/vkconfig/dialog_vulkan_analysis.cpp deleted file mode 100644 index a5b54c9aba..0000000000 --- a/vkconfig/dialog_vulkan_analysis.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "dialog_vulkan_analysis.h" - -#include "../vkconfig_core/platform.h" - -#include -#include -#include -#include -#include -#include -#include - -VulkanAnalysisDialog::VulkanAnalysisDialog(QWidget *parent) : QDialog(parent), ui(new Ui::dialog_vulkan_analysis) { - ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - // Hide the test widget as no test is actually run. - // This may be added back again later. - ui->tabWidget->removeTab(2); - - Run(); -} - -void VulkanAnalysisDialog::Run() { - ui->envTable->clear(); - ui->cleanupTable->clear(); - ui->hardwareTable->clear(); - ui->instanceTable->clear(); - ui->lunarGSDKTable->clear(); - ui->executableTable->clear(); - ui->vkRuntimesTable->clear(); - ui->externalTestsTable->clear(); - ui->layerSettingsTable->clear(); - ui->explicitLayersTable->clear(); - ui->implicitLayersTable->clear(); - ui->logicalDevicesTable->clear(); - ui->physicalDevicesTable->clear(); - - QProcess *via = new QProcess(this); -#if VKC_PLATFORM == VKC_PLATFORM_MACOS - via->setProgram("/usr/local/bin/vkvia"); -#else - via->setProgram("vkvia"); -#endif - - const QString &file_Path = QDir::temp().path() + "/vkvia.json"; - - // Remove the old one - remove(file_Path.toUtf8().constData()); - - QStringList args; - args << "--output_path" << QDir::temp().path(); - args << "--vkconfig_output"; - args << "--disable_cube_tests"; - via->setArguments(args); - via->start(); - via->waitForFinished(); - - QFile file(file_Path); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QMessageBox msgBox; - msgBox.setText(tr("Error running vkvia. Is your SDK up to date and installed properly?")); - msgBox.exec(); - return; - } - - QString json_text = file.readAll(); - file.close(); - - ////////////////////////////////////////////////////// - // Convert the text to a JSON document & validate it - QJsonParseError parse_error; - QJsonDocument json_document = QJsonDocument::fromJson(json_text.toUtf8(), &parse_error); - - if (parse_error.error != QJsonParseError::NoError) { - QMessageBox msgBox; - msgBox.setWindowTitle("Cannot parse vkvia output."); - msgBox.setText(parse_error.errorString()); - msgBox.exec(); - return; - } - - if (json_document.isEmpty() || json_document.isNull()) return; - - ///////////////////////////////////////////////////////// - // Get the instance version and set that to the header - QString output; - const QJsonObject &json_object = json_document.object(); - - ///////////////////////////////////// System Info - // Get the extensions object and process it's members - QJsonValue environmentValue = json_object.value(QString(tr("Environment"))); - QJsonObject environmentObject = environmentValue.toObject(); - LoadTable(environmentObject, ui->envTable); - - QJsonValue hardwareValue = json_object.value(QString(tr("Hardware"))); - QJsonObject hardwareObject = hardwareValue.toObject(); - LoadTable(hardwareObject, ui->hardwareTable); - - QJsonValue executableValue = json_object.value(QString(tr("Executable Info"))); - QJsonObject executableObject = executableValue.toObject(); - LoadTable(executableObject, ui->executableTable); - - QJsonValue vkDriverInfo = json_object.value(QString(tr("Vulkan Driver Info"))); - QJsonObject vkDriverObject = vkDriverInfo.toObject(); - LoadTable(vkDriverObject, ui->vkDriverInfoTable); - - QJsonValue vkRunTimeValue = json_object.value(QString(tr("Vulkan Runtimes"))); - QJsonObject vkRunTimeObject = vkRunTimeValue.toObject(); - LoadTable(vkRunTimeObject, ui->vkRuntimesTable); - - QJsonValue lunarGSDKValue = json_object.value(QString(tr("Vulkan SDKs"))); - QJsonObject lunarGSDKObject = lunarGSDKValue.toObject(); - LoadTable(lunarGSDKObject, ui->lunarGSDKTable); - - QJsonValue vkImplicitValue = json_object.value(QString(tr("Vulkan Implicit Layers"))); - QJsonObject vkImplicitObject = vkImplicitValue.toObject(); - LoadTable(vkImplicitObject, ui->implicitLayersTable); - - QJsonValue vkExplicitValue = json_object.value(QString(tr("Vulkan Explicit Layers"))); - QJsonObject vkExplicitObject = vkExplicitValue.toObject(); - LoadTable(vkExplicitObject, ui->explicitLayersTable); - - QJsonValue vkLayerSettingsValue = json_object.value(QString(tr("Vulkan Layer Settings File"))); - QJsonObject vkLayerSettingsObject = vkLayerSettingsValue.toObject(); - LoadTable(vkLayerSettingsObject, ui->layerSettingsTable); - - /////////////////////////// Vulkan API Calls - QJsonValue instanceValue = json_object.value(QString(tr("Instance"))); - QJsonObject instanceObject = instanceValue.toObject(); - LoadTable(instanceObject, ui->instanceTable); - - QJsonObject devicesObject = json_object.value(QString(tr("Physical Devices"))).toObject(); - LoadTable(devicesObject, ui->physicalDevicesTable); - - QJsonObject logicalObject = json_object.value(QString(tr("Logical Devices"))).toObject(); - LoadTable(logicalObject, ui->logicalDevicesTable); - - QJsonObject cleanupObject = json_object.value(QString(tr("Cleanup"))).toObject(); - LoadTable(cleanupObject, ui->cleanupTable); - - /////////////////////////////////// External Tests - QJsonValue cubeValue = json_object.value(QString(tr("Cube"))).toObject(); - QJsonObject cubeObject = cubeValue.toObject(); - if (!cubeObject.isEmpty()) - LoadTable(cubeObject, ui->externalTestsTable); - else { - ui->externalTestsTable->setRowCount(1); - ui->externalTestsTable->setColumnCount(1); - ui->externalTestsTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); - ui->externalTestsTable->setShowGrid(false); - QTableWidgetItem *item = new QTableWidgetItem(); - item->setText(tr("No SDK found by VIA, skipping test section")); - ui->externalTestsTable->setItem(0, 0, item); - } - - show(); -} - -void VulkanAnalysisDialog::LoadTable(QJsonObject &json_parent, QTableWidget *table) { - // How many items does this object contain? - int nHowManyRows = json_parent.size(); - table->setRowCount(nHowManyRows); - - // Get the first item in the table, and see how many items it has. This - // will be the number of columns - QJsonValue rowValue = json_parent.value("0"); - QJsonObject rowObject = rowValue.toObject(); - int nHowManyCols = rowObject.size(); - table->setColumnCount(nHowManyCols); - - table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); - - // Now just iterate and fill in the cells - for (int row = 0; row < nHowManyRows; row++) { - rowValue = json_parent.value(QString().asprintf("%d", row)); - rowObject = rowValue.toObject(); - - for (int col = 0; col < nHowManyCols; col++) { - QJsonValue colValue = rowObject.value(QString().asprintf("%d", col)); - QString text = colValue.toString(); - QTableWidgetItem *item = new QTableWidgetItem; - item->setText(text); - table->setItem(row, col, item); - } - } -} diff --git a/vkconfig/main_doc.h b/vkconfig/main_doc.h deleted file mode 100644 index ce23885758..0000000000 --- a/vkconfig/main_doc.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Valve Corporation - * Copyright (c) 2022 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - David Pinedo - */ - -#pragma once - -#include "../vkconfig_core/command_line.h" - -int run_doc(const CommandLine& commandLine); diff --git a/vkconfig/main_gui.cpp b/vkconfig/main_gui.cpp deleted file mode 100644 index f614f40584..0000000000 --- a/vkconfig/main_gui.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "main_gui.h" - -#include "mainwindow.h" - -#include "../vkconfig_core/alert.h" -#include "../vkconfig_core/version.h" -#include "../vkconfig_core/application_singleton.h" - -#include -#include - -int run_gui(int argc, char* argv[], const CommandLine& command_line) { - QCoreApplication::setOrganizationName("LunarG"); - QCoreApplication::setOrganizationDomain("lunarg.com"); - - // This is used by QSettings for .ini, registry, and .plist files. - // It needs to not have spaces in it, and by default is the same as - // the executable name. If we rename the executable at a later date, - // keeping this as 'vkconfig' will ensure that it picks up the - // settings from the previous version (assuming that's ever an issue) - QCoreApplication::setApplicationName(VKCONFIG_SHORT_NAME); - - // Older Qt versions do not have this. Dynamically check the version - // of Qt since it's just an enumerant. Versions 5.6.0 and later have - // high dpi support. We really don't need to check the 5, but for - // the sake of completeness and mabye compatibility with qt 6. - // Also ignoring the trailing point releases - const char* version = qVersion(); - int version_major, version_minor; - sscanf(version, "%d.%d", &version_major, &version_minor); - if (version_major >= 5 && version_minor >= 6) { - // Qt::AA_EnableHighDpiScaling = 20 from qnamespace.h in Qt 5.6 or later - QCoreApplication::setAttribute((Qt::ApplicationAttribute)20); - } - - QApplication app(argc, argv); - - // This has to go after the construction of QApplication in - // order to use a QMessageBox and avoid some QThread warnings. - ApplicationSingleton singleton("vkconfig_single_instance"); - - while (!singleton.IsFirstInstance()) { - if (Alert::ConfiguratorSingleton() == QMessageBox::Cancel) { - return -1; - } - } - - // We simply cannot run without any layers - Configurator& configurator = Configurator::Get(command_line.command_vulkan_sdk); - - if (!configurator.Init()) return -1; - - // The main GUI is driven here - MainWindow main_window; - main_window.show(); - - return app.exec(); -} diff --git a/vkconfig/main_gui.h b/vkconfig/main_gui.h deleted file mode 100644 index 06c17e5aca..0000000000 --- a/vkconfig/main_gui.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/command_line.h" - -int run_gui(int argc, char* argv[], const CommandLine& command_line); diff --git a/vkconfig/main_layers.cpp b/vkconfig/main_layers.cpp deleted file mode 100644 index 1e5b041607..0000000000 --- a/vkconfig/main_layers.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "main_layers.h" -#include "configurator.h" - -#include "../vkconfig_core/configuration.h" -#include "../vkconfig_core/override.h" -#include "../vkconfig_core/layer_manager.h" - -#include - -static int RunLayersOverride(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); - - Configuration configuration; - const bool load_result = configuration.Load(layers.selected_layers, command_line.layers_configuration_path.c_str()); - if (!load_result) { - printf("\nFailed to load the layers configuration file...\n"); - return -1; - } - - // With command line, don't store the application list, it's always global, save and restore the setting - const bool use_application_list = environment.HasOverriddenApplications(); - environment.SetUseApplicationList(false); - - const bool override_result = OverrideConfiguration(environment, layers.selected_layers, configuration); - - environment.SetUseApplicationList(use_application_list); - - environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit - - if (override_result) { - printf("\nLayers configuration \"%s\" applied to all Vulkan Applications, including Vulkan layers:\n", - command_line.layers_configuration_path.c_str()); - for (std::size_t i = 0, n = configuration.parameters.size(); i < n; ++i) { - const Parameter& parameter = configuration.parameters[i]; - if (parameter.state == LAYER_STATE_APPLICATION_CONTROLLED) continue; - - printf("\t%s (%s)\n", parameter.key.c_str(), parameter.state == LAYER_STATE_OVERRIDDEN ? "Overridden" : "Excluded"); - } - printf("\n (Use \"vkconfig layers --surrender\" to return Vulkan layers control to Vulkan applications.)\n"); - } else { - printf("\nFailed to override Vulkan applications layers...\n"); - } - - return override_result ? 0 : -1; -} - -static int RunLayersSurrender(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - const bool has_overridden_layers = HasOverride(); - const bool surrender_result = SurrenderConfiguration(environment); - - environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit - - if (has_overridden_layers) { - if (surrender_result) { - printf("\nFull Vulkan layers control returned to Vulkan applications.\n"); - printf("\n (Use \"vkconfig layers --override to take control of Vulkan layers.)\n"); - } else { - printf("\nFailed to surrender Vulkan applications layers...\n"); - } - } else { - printf("\nNo overridden Vulkan layers, nothing to surrender.\n"); - } - - return surrender_result ? 0 : -1; -} - -static int RunLayersList(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); - - if (layers.selected_layers.empty()) { - printf("No Vulkan layer found\n"); - } else { - for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { - const Layer& layer = layers.selected_layers[i]; - - printf("%s\n", layer.key.c_str()); - } - } - - return 0; -} - -static int RunLayersVerbose(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); - - for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { - const Layer& layer = layers.selected_layers[i]; - - printf("%s (%s) %s-%s\n", layer.key.c_str(), GetLayerTypeLabel(layer.type), layer.api_version.str().c_str(), - layer.implementation_version.c_str()); - printf("- %s\n", layer.description.c_str()); - printf("- %s\n", layer.manifest_path.c_str()); - printf("- %s\n", layer.binary_path.c_str()); - } - - return 0; -} - -int run_layers(const CommandLine& command_line) { - assert(command_line.command == COMMAND_LAYERS); - assert(command_line.error == ERROR_NONE); - - switch (command_line.command_layers_arg) { - case COMMAND_LAYERS_OVERRIDE: { - return RunLayersOverride(command_line); - } - case COMMAND_LAYERS_SURRENDER: { - return RunLayersSurrender(command_line); - } - case COMMAND_LAYERS_LIST: { - return RunLayersList(command_line); - } - case COMMAND_LAYERS_VERBOSE: { - return RunLayersVerbose(command_line); - } - default: { - assert(0); - return -1; - } - } -} diff --git a/vkconfig/main_reset.cpp b/vkconfig/main_reset.cpp deleted file mode 100644 index 3480bd9585..0000000000 --- a/vkconfig/main_reset.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "main_reset.h" - -#include "configurator.h" - -#include - -#include - -static int RunReset(int argc, char* argv[], bool hard) { - QCoreApplication::setOrganizationName("LunarG"); - QCoreApplication::setOrganizationDomain("lunarg.com"); - - // This is used by QSettings for .ini, registry, and .plist files. - // It needs to not have spaces in it, and by default is the same as - // the executable name. If we rename the executable at a later date, - // keeping this as 'vkconfig' will ensure that it picks up the - // settings from the previous version (assuming that's ever an issue) - QCoreApplication::setApplicationName(VKCONFIG_SHORT_NAME); - - // Older Qt versions do not have this. Dynamically check the version - // of Qt since it's just an enumerant. Versions 5.6.0 and later have - // high dpi support. We really don't need to check the 5, but for - // the sake of completeness and mabye compatibility with qt 6. - // Also ignoring the trailing point releases - const char* version = qVersion(); - int version_major, version_minor; - sscanf(version, "%d.%d", &version_major, &version_minor); - if (version_major >= 5 && version_minor >= 6) { - // Qt::AA_EnableHighDpiScaling = 20 from qnamespace.h in Qt 5.6 or later - QCoreApplication::setAttribute((Qt::ApplicationAttribute)20); - } - - QApplication app(argc, argv); - - Configurator::Get().ResetToDefault(hard); - - return 0; -} - -int run_reset(int argc, char* argv[], const CommandLine& command_line) { - assert(command_line.command == COMMAND_RESET); - assert(command_line.error == ERROR_NONE); - - switch (command_line.command_reset_arg) { - case COMMAND_RESET_SOFT: { - return RunReset(argc, argv, false); - } - case COMMAND_RESET_HARD: { - return RunReset(argc, argv, true); - } - default: { - assert(0); - return -1; - } - } -} diff --git a/vkconfig/mainwindow.cpp b/vkconfig/mainwindow.cpp deleted file mode 100644 index df2c8924b9..0000000000 --- a/vkconfig/mainwindow.cpp +++ /dev/null @@ -1,1897 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "mainwindow.h" - -#include "dialog_about.h" -#include "dialog_vulkan_analysis.h" -#include "dialog_vulkan_info.h" -#include "dialog_layers.h" -#include "dialog_applications.h" - -#include "configurator.h" -#include "vulkan_util.h" - -#include "../vkconfig_core/alert.h" -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/version.h" -#include "../vkconfig_core/platform.h" -#include "../vkconfig_core/help.h" -#include "../vkconfig_core/doc.h" -#include "../vkconfig_core/date.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if VKC_PLATFORM == VKC_PLATFORM_LINUX || VKC_PLATFORM == VKC_PLATFORM_MACOS -#include -#endif - -#include - -static const int LAUNCH_COLUMN0_SIZE = 220; -static const int LAUNCH_COLUMN2_SIZE = 32; -static const int LAUNCH_SPACING_SIZE = 2; -#if VKC_PLATFORM == VKC_PLATFORM_MACOS -static const int LAUNCH_ROW_HEIGHT = 26; -#else -static const int LAUNCH_ROW_HEIGHT = 28; -#endif - -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent), - _launch_application(nullptr), - _log_file(nullptr), - _launcher_apps_combo(nullptr), - _launcher_executable(nullptr), - _launcher_arguments(nullptr), - _launcher_working(nullptr), - _launcher_log_file_edit(nullptr), - _launcher_apps_browse_button(nullptr), - _launcher_executable_browse_button(nullptr), - _launcher_working_browse_button(nullptr), - _launcher_log_file_browse_button(nullptr), - _tray_icon(nullptr), - _tray_icon_menu(nullptr), - _tray_restore_action(nullptr), - _tray_layers_controlled_by_applications(nullptr), - _tray_layers_controlled_by_configurator(nullptr), - _tray_layers_disabled_by_configurator(nullptr), - _tray_quit_action(nullptr), - ui(new Ui::MainWindow), - been_warned_about_old_loader(false) { - ui->setupUi(this); - ui->launcher_tree->installEventFilter(this); - ui->configuration_tree->installEventFilter(this); - ui->settings_tree->installEventFilter(this); - - SetupLauncherTree(); - - connect(ui->action_find_more_layers, SIGNAL(triggered(bool)), this, SLOT(OnHelpFindLayers(bool))); - connect(ui->actionAbout, SIGNAL(triggered(bool)), this, SLOT(OnHelpAbout(bool))); - connect(ui->actionVulkan_Info, SIGNAL(triggered(bool)), this, SLOT(toolsVulkanInfo(bool))); - connect(ui->action_readme, SIGNAL(triggered(bool)), this, SLOT(OnHelpReadme(bool))); - connect(ui->action_changelog, SIGNAL(triggered(bool)), this, SLOT(OnHelpChangelog(bool))); - connect(ui->actionVulkan_specification, SIGNAL(triggered(bool)), this, SLOT(OnHelpVulkanSpec(bool))); - connect(ui->actionVulkan_Layer_Specification, SIGNAL(triggered(bool)), this, SLOT(OnHelpLayerSpec(bool))); - connect(ui->actionGPU_Info_Reports, SIGNAL(triggered(bool)), this, SLOT(OnHelpGPUInfo(bool))); - - connect(ui->actionVulkan_Installation, SIGNAL(triggered(bool)), this, SLOT(toolsVulkanInstallation(bool))); - connect(ui->actionRestore_Default_Configurations, SIGNAL(triggered(bool)), this, SLOT(toolsResetToDefault(bool))); - - connect(ui->configuration_tree, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, - SLOT(OnConfigurationItemChanged(QTreeWidgetItem *, int))); - connect(ui->configuration_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, - SLOT(OnConfigurationItemDoubleClicked(QTreeWidgetItem *, int))); - connect(ui->configuration_tree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, - SLOT(OnConfigurationTreeChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - connect(ui->configuration_tree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, - SLOT(OnConfigurationTreeClicked(QTreeWidgetItem *, int))); - - connect(ui->combo_box_layers_controlled, SIGNAL(currentIndexChanged(int)), this, SLOT(OnComboBoxModeChanged(int))); - - connect(ui->settings_tree, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(editorExpanded(QTreeWidgetItem *))); - // No need to do something when clicking on the setting tree, individual setting will update the configuration files - // connect(ui->settings_tree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(OnSettingsTreeClicked(QTreeWidgetItem *, - // int))); - - connect(ui->launcher_tree, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(launchItemCollapsed(QTreeWidgetItem *))); - connect(ui->launcher_tree, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(launchItemExpanded(QTreeWidgetItem *))); - - connect(ui->launcher_loader_debug, SIGNAL(currentIndexChanged(int)), this, SLOT(OnLauncherLoaderMessageChanged(int))); - - Configurator &configurator = Configurator::Get(); - Environment &environment = configurator.environment; - - // Restore window geometry from last launch - restoreGeometry(environment.Get(VKCONFIG2_LAYOUT_MAIN_GEOMETRY)); - restoreState(environment.Get(VKCONFIG2_LAYOUT_MAIN_WINDOW_STATE)); - ui->splitter_settings->restoreState(environment.Get(VKCONFIG2_LAYOUT_MAIN_SPLITTER1)); - ui->splitter_configurations->restoreState(environment.Get(VKCONFIG2_LAYOUT_MAIN_SPLITTER2)); - ui->splitter_main->restoreState(environment.Get(VKCONFIG2_LAYOUT_MAIN_SPLITTER3)); - - ui->check_box_persistent->setToolTip("Keep Vulkan Configurator running in system tray when closing the main window"); - ui->check_box_persistent->setVisible(QSystemTrayIcon::isSystemTrayAvailable()); - - LoadConfigurationList(); - - // Resetting this from the default prevents the log window (a QTextEdit) from overflowing. - // Whenever the control surpasses this block count, old blocks are discarded. - // Note: We could make this a user configurable setting down the road should this be - // insufficinet. - ui->log_browser->document()->setMaximumBlockCount(2048); - ui->configuration_tree->scrollToItem(ui->configuration_tree->topLevelItem(0), QAbstractItemView::PositionAtTop); - - this->InitTray(); - this->UpdateTray(); - this->UpdateUI(); -} - -MainWindow::~MainWindow() { ResetLaunchApplication(); } - -void MainWindow::InitTray() { - if (QSystemTrayIcon::isSystemTrayAvailable()) { - this->_tray_quit_action = new QAction("&Quit", this); - connect(this->_tray_quit_action, &QAction::triggered, qApp, &QCoreApplication::quit); - - this->_tray_restore_action = new QAction("Open &Vulkan Configurator", this); - connect(this->_tray_restore_action, &QAction::triggered, this, &MainWindow::trayActionRestore); - - this->_tray_layers_controlled_by_applications = new QAction("Layers Controlled by the Vulkan Applications", this); - this->_tray_layers_controlled_by_applications->setCheckable(true); - connect(this->_tray_layers_controlled_by_applications, &QAction::toggled, this, - &MainWindow::trayActionControlledByApplications); - - this->_tray_layers_controlled_by_configurator = new QAction("Layers Controlled by the Vulkan Configurator", this); - this->_tray_layers_controlled_by_configurator->setCheckable(true); - connect(this->_tray_layers_controlled_by_configurator, &QAction::toggled, this, - &MainWindow::trayActionControlledByConfigurator); - - this->_tray_layers_disabled_by_configurator = new QAction("Layers Disabled by the Vulkan Configurator", this); - this->_tray_layers_disabled_by_configurator->setCheckable(true); - connect(this->_tray_layers_disabled_by_configurator, &QAction::toggled, this, - &MainWindow::trayActionDisabledByApplications); - - this->_tray_icon_menu = new QMenu(this); - this->_tray_icon_menu->addAction(this->_tray_restore_action); - this->_tray_icon_menu->addSeparator(); - this->_tray_icon_menu->addAction(this->_tray_layers_controlled_by_applications); - this->_tray_icon_menu->addAction(this->_tray_layers_controlled_by_configurator); - this->_tray_icon_menu->addAction(this->_tray_layers_disabled_by_configurator); - this->_tray_icon_menu->addSeparator(); - this->_tray_icon_menu->addAction(this->_tray_quit_action); - - this->_tray_icon = new QSystemTrayIcon(this); - this->_tray_icon->setContextMenu(this->_tray_icon_menu); - - this->connect(this->_tray_icon, &QSystemTrayIcon::activated, this, &MainWindow::iconActivated); - } -} - -void MainWindow::UpdateTray() { - if (QSystemTrayIcon::isSystemTrayAvailable()) { - QApplication::setQuitOnLastWindowClosed(!ui->check_box_persistent->isChecked()); - - Configurator &configurator = Configurator::Get(); - - const Environment &environment = configurator.environment; - - const bool use_override = environment.GetMode() != LAYERS_MODE_BY_APPLICATIONS; - const bool active = configurator.configurations.HasActiveConfiguration(configurator.layers.selected_layers) && use_override; - - switch (environment.GetMode()) { - default: - case LAYERS_MODE_BY_APPLICATIONS: - this->_tray_layers_controlled_by_applications->setChecked(true); - this->_tray_layers_controlled_by_configurator->setChecked(false); - this->_tray_layers_disabled_by_configurator->setChecked(false); - break; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: - this->_tray_layers_controlled_by_applications->setChecked(false); - this->_tray_layers_controlled_by_configurator->setChecked(true); - this->_tray_layers_disabled_by_configurator->setChecked(false); - break; - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: - this->_tray_layers_controlled_by_applications->setChecked(false); - this->_tray_layers_controlled_by_configurator->setChecked(false); - this->_tray_layers_disabled_by_configurator->setChecked(true); - break; - } - - if (active) { - const QIcon icon(":/resourcefiles/vkconfig-on.png"); - - this->setWindowIcon(icon); - this->_tray_icon->setIcon(icon); - this->_tray_icon->setToolTip("Layers controlled by the Vulkan Configurator"); - } else { - const QIcon icon(":/resourcefiles/vkconfig-off.png"); - - this->setWindowIcon(icon); - this->_tray_icon->setIcon(icon); - this->_tray_icon->setToolTip("Layers controlled by the Vulkan Applications"); - } - - this->_tray_icon->show(); - } -} - -void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) { - switch (reason) { - default: - break; - case QSystemTrayIcon::Context: - break; - case QSystemTrayIcon::DoubleClick: - Qt::WindowStates window_states = this->windowState(); - - const bool is_minimized = this->isMinimized(); - const bool is_visible = this->isVisible(); - const bool is_hidden = this->isHidden(); - - if (this->isMinimized() || this->isHidden()) { - this->setVisible(true); - this->showNormal(); - this->setWindowState(Qt::WindowState::WindowActive); - } else { - this->hide(); - } - - this->UpdateTray(); - break; - } -} - -void MainWindow::trayActionRestore() { - this->hide(); - this->showNormal(); - - this->UpdateUI(); - this->UpdateTray(); -} - -void MainWindow::trayActionControlledByApplications(bool checked) { - if (checked) { - Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - configurator.configurations.Configure(configurator.layers.selected_layers); - - this->UpdateUI(); - this->UpdateTray(); - } -} - -void MainWindow::trayActionControlledByConfigurator(bool checked) { - if (checked) { - Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(LAYERS_MODE_BY_CONFIGURATOR_RUNNING); - configurator.configurations.Configure(configurator.layers.selected_layers); - - this->UpdateUI(); - this->UpdateTray(); - } -} - -void MainWindow::trayActionDisabledByApplications(bool checked) { - if (checked) { - Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED); - configurator.configurations.Configure(configurator.layers.selected_layers); - - this->UpdateUI(); - this->UpdateTray(); - } -} - -static std::string GetMainWindowTitle(bool active) { -#if VKCONFIG_DATE - std::string title = format("%s %s-%s", VKCONFIG_NAME, Version::VKCONFIG.str().c_str(), GetBuildDate().c_str()); -#else - std::string title = format("%s %s", VKCONFIG_NAME, Version::VKCONFIG.str().c_str()); -#endif - if (active) title += " "; - return title; -} - -void MainWindow::UpdateUI() { - static int check_recurse = 0; - ++check_recurse; - assert(check_recurse <= 2); - - Configurator &configurator = Configurator::Get(); - const Environment &environment = Configurator::Get().environment; - const std::string &selected_contiguration_name = environment.GetSelectedConfiguration(); - const bool has_selected_configuration = !selected_contiguration_name.empty(); - - this->blockSignals(true); - this->ClearLog(); - - ui->configuration_tree->blockSignals(true); - - ui->combo_box_layers_controlled->blockSignals(true); - ui->combo_box_layers_controlled->setCurrentIndex(environment.GetMode()); - ui->combo_box_layers_controlled->blockSignals(false); - - const bool has_active_configuration = configurator.configurations.HasActiveConfiguration(configurator.layers.selected_layers); - - // Mode states - this->UpdateTray(); - - // Update configurations - ui->group_box_configurations->setEnabled(environment.GetMode() == LAYERS_MODE_BY_CONFIGURATOR_RUNNING); - ui->configuration_tree->setCurrentItem(nullptr); - - for (int i = 0, n = ui->configuration_tree->topLevelItemCount(); i < n; ++i) { - ConfigurationListItem *item = dynamic_cast(ui->configuration_tree->topLevelItem(i)); - assert(item); - assert(!item->configuration_name.empty()); - - Configuration *configuration = - FindByKey(configurator.configurations.available_configurations, item->configuration_name.c_str()); - if (configuration == nullptr) continue; - - item->setText(1, item->configuration_name.c_str()); - item->setToolTip(1, configuration->description.c_str()); - item->radio_button->setToolTip(configuration->description.c_str()); - item->radio_button->blockSignals(true); - - if (item->configuration_name == selected_contiguration_name) { - item->radio_button->setChecked(true); - ui->configuration_tree->setCurrentItem(item); - } else { - // item->radio_button->setChecked(false); - } - - item->radio_button->blockSignals(false); - } - - // Update settings - ui->push_button_edit->setEnabled(has_selected_configuration); - ui->push_button_remove->setEnabled(has_selected_configuration); - ui->push_button_duplicate->setEnabled(has_selected_configuration); - ui->push_button_new->setEnabled(true); - if (has_selected_configuration) { - ui->group_box_settings->setTitle((selected_contiguration_name + " Settings").c_str()); - } else { - ui->group_box_settings->setTitle("Configuration Settings"); - } - - // Handle application lists states - ui->check_box_apply_list->setEnabled(!been_warned_about_old_loader && - ui->combo_box_layers_controlled->currentIndex() != LAYERS_MODE_BY_APPLICATIONS); - ui->check_box_apply_list->setChecked(!been_warned_about_old_loader && environment.GetUseApplicationList()); - ui->push_button_applications->setEnabled(!been_warned_about_old_loader && - ui->combo_box_layers_controlled->currentIndex() != LAYERS_MODE_BY_APPLICATIONS); - - _launcher_apps_combo->blockSignals(true); - _launcher_apps_combo->clear(); - - const std::vector &applications = environment.GetApplications(); - if (applications.empty()) { - _launcher_executable->setText(""); - _launcher_arguments->setText(""); - _launcher_working->setText(""); - _launcher_log_file_edit->setText(""); - } else { - for (std::size_t i = 0, n = applications.size(); i < n; ++i) { - _launcher_apps_combo->addItem(applications[i].app_name.c_str()); - } - _launcher_apps_combo->setCurrentIndex(environment.GetActiveApplicationIndex()); - - const Application &application = environment.GetActiveApplication(); - this->UpdateApplicationUI(application); - } - - _launcher_apps_combo->blockSignals(false); - - // Handle persistent states - ui->check_box_persistent->setChecked(environment.GetUseSystemTray()); - - // Launcher states - const bool has_application_list = !environment.GetApplications().empty(); - ui->push_button_launcher->setEnabled(has_application_list); - ui->push_button_launcher->setText(_launch_application ? "Terminate" : "Launch"); - ui->check_box_clear_on_launch->setChecked(environment.Get(LAYOUT_LAUNCHER_NOT_CLEAR) != "true"); - ui->launcher_loader_debug->blockSignals(true); // avoid calling again UpdateUI - ui->launcher_loader_debug->setCurrentIndex(GetLoaderMessageType(environment.GetLoaderMessageTypes())); - ui->launcher_loader_debug->blockSignals(false); - - // ui->launcher_loader_debug - if (_launcher_executable_browse_button) { - _launcher_executable_browse_button->setEnabled(has_application_list); - } - if (_launcher_working_browse_button) { - _launcher_working_browse_button->setEnabled(has_application_list); - } - if (_launcher_log_file_browse_button) { - _launcher_log_file_browse_button->setEnabled(has_application_list); - } - if (_launcher_apps_combo) { - _launcher_apps_combo->setEnabled(has_application_list); - } - if (_launcher_executable) { - _launcher_executable->setEnabled(has_application_list); - } - if (_launcher_arguments) { - _launcher_arguments->setEnabled(has_application_list); - } - if (_launcher_working) { - _launcher_working->setEnabled(has_application_list); - } - if (_launcher_log_file_edit) { - _launcher_log_file_edit->setEnabled(has_application_list); - } - - ui->settings_tree->setEnabled(environment.GetMode() == LAYERS_MODE_BY_CONFIGURATOR_RUNNING && has_selected_configuration); - if (has_selected_configuration) { - this->_settings_tree_manager.CreateGUI(ui->settings_tree); - } else { - this->_settings_tree_manager.CleanupGUI(); - } - - // Update title bar - setWindowTitle(GetMainWindowTitle(has_active_configuration).c_str()); - - ui->configuration_tree->blockSignals(false); - this->blockSignals(false); - - --check_recurse; -} - -// Load or refresh the list of configuration. Any configuration that uses a layer that -// is not detected on the system is disabled. -void MainWindow::LoadConfigurationList() { - // There are lots of ways into this, and in none of them - // can we have an active editor running. - _settings_tree_manager.CleanupGUI(); - ui->configuration_tree->blockSignals(true); // No signals firing off while we do this - ui->configuration_tree->clear(); - - Configurator &configurator = Configurator::Get(); - - for (std::size_t i = 0, n = configurator.configurations.available_configurations.size(); i < n; ++i) { - const Configuration &configuration = configurator.configurations.available_configurations[i]; - - // Hide built-in configuration when the layer is missing. The Vulkan user may have not installed the necessary layer - // if (configuration.IsBuiltIn() && HasMissingLayer(configuration.parameters, configurator.layers.available_layers)) - // continue; - - ConfigurationListItem *item = new ConfigurationListItem(configuration.key); - item->setToolTip(0, configuration.description.c_str()); - item->radio_button = new QRadioButton(); - item->radio_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - item->radio_button->setFixedSize(QSize(24, 24)); - item->radio_button->setToolTip(configuration.description.c_str()); - item->setFlags(item->flags() | Qt::ItemIsEditable); - ui->configuration_tree->addTopLevelItem(item); - ui->configuration_tree->setItemWidget(item, 0, item->radio_button); - // connect(item->radio_button, SIGNAL(clicked(bool)), this, SLOT(OnConfigurationItemClicked(bool))); - connect(item->radio_button, SIGNAL(toggled(bool)), this, SLOT(OnConfigurationItemClicked(bool))); - } - - ui->configuration_tree->blockSignals(false); - ui->configuration_tree->resizeColumnToContents(0); - ui->configuration_tree->resizeColumnToContents(1); -} - -/// Okay, because we are using custom controls, some of -/// the signaling is not happening as expected. So, we cannot -/// always get an accurate answer to the currently selected -/// item, but we do often need to know what has been checked -/// when an event occurs. This unambigously answers that question. -ConfigurationListItem *MainWindow::GetCheckedItem() { - // Just go through all the top level items - for (int i = 0, n = ui->configuration_tree->topLevelItemCount(); i < n; ++i) { - ConfigurationListItem *item = dynamic_cast(ui->configuration_tree->topLevelItem(i)); - - if (item == nullptr) continue; - if (item->radio_button->isChecked()) return item; - } - - return nullptr; -} - -void MainWindow::OnComboBoxModeChanged(int index) { - Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(static_cast(ui->combo_box_layers_controlled->currentIndex())); - - this->UpdateUI(); -} - -// We want to apply to just the app list... hang on there. Doe we have the new loader? -void MainWindow::on_check_box_apply_list_clicked() { - Configurator &configurator = Configurator::Get(); - - // Handle old loader case - Version loader_version; - if (!configurator.SupportApplicationList(&loader_version)) { - const std::string version = loader_version.str(); - const std::string message = - format("The detected Vulkan loader version is %s but version 1.2.141 or newer is required", version.c_str()); - ui->check_box_apply_list->setToolTip(message.c_str()); - - Alert::ApplicationListUnsupported(message.c_str()); - - ui->check_box_apply_list->setEnabled(false); - ui->check_box_apply_list->setChecked(false); - ui->push_button_applications->setEnabled(false); - configurator.environment.SetUseApplicationList(false); - been_warned_about_old_loader = true; - - return; - } - - configurator.environment.SetUseApplicationList(ui->check_box_apply_list->isChecked()); - - // Handle the case where no application with active override is present - const bool application_list_requires_update = !configurator.environment.HasOverriddenApplications(); - if (ui->check_box_apply_list->isChecked() && application_list_requires_update) { - ApplicationsDialog dialog(this); - dialog.exec(); - } - - configurator.configurations.Configure(configurator.layers.selected_layers); - - UpdateUI(); -} - -void MainWindow::on_check_box_persistent_clicked() { - if (!QSystemTrayIcon::isSystemTrayAvailable()) { - return; - } - - Environment &environment = Configurator::Get().environment; - - // Alert the user to the current state of the vulkan configurator and - // give them the option to not shutdown. - QSettings settings; - if (ui->check_box_persistent->isChecked() && !settings.value(VKCONFIG_KEY_MESSAGE_SYSTEM_TRAY, false).toBool()) { - const QPalette saved_palette = ui->check_box_persistent->palette(); - QPalette modified_palette = saved_palette; - modified_palette.setColor(QPalette::ColorRole::WindowText, QColor(255, 0, 0, 255)); - ui->check_box_persistent->setPalette(modified_palette); - - const std::string message = "Vulkan Layers will remain controlled by Vulkan Configurator while active in the system tray."; - - QMessageBox alert(this); - alert.setWindowTitle("Vulkan Configurator behavior when closing the main window"); - alert.setText(message.c_str()); - alert.setIcon(QMessageBox::Warning); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::No); - alert.setCheckBox(new QCheckBox("Do not show again.")); - alert.setInformativeText( - "Do you want to keep Vulkan Configurator running in the system tray when closing the main window?"); - - int ret_val = alert.exec(); - settings.setValue(VKCONFIG_KEY_MESSAGE_SYSTEM_TRAY, alert.checkBox()->isChecked()); - - ui->check_box_persistent->setPalette(saved_palette); - - if (ret_val == QMessageBox::No) { - ui->check_box_persistent->setChecked(false); - return; - } - } - - environment.SetUseSystemTray(ui->check_box_persistent->isChecked()); -} - -void MainWindow::on_check_box_clear_on_launch_clicked() { - Configurator::Get().environment.Set(LAYOUT_LAUNCHER_NOT_CLEAR, ui->check_box_clear_on_launch->isChecked() ? "false" : "true"); -} - -void MainWindow::toolsResetToDefault(bool checked) { - (void)checked; - - ResetLaunchApplication(); - - if (Alert::ConfiguratorResetAll() == QMessageBox::No) return; - - Configurator &configurator = Configurator::Get(); - configurator.ResetToDefault(true); - - LoadConfigurationList(); - - this->UpdateUI(); -} - -// Thist signal actually comes from the radio button -void MainWindow::OnConfigurationItemClicked(bool checked) { - (void)checked; - // Someone just got checked, they are now the current profile - // This pointer will only be valid if it's one of the elements with - // the radio button - ConfigurationListItem *configuration_item = GetCheckedItem(); - if (configuration_item == nullptr) { - return; - } - - // This appears redundant on Windows, but under linux it is needed - // to ensure the new item is "selected" - ui->configuration_tree->setCurrentItem(configuration_item); - - Configurator &configurator = Configurator::Get(); - if (configurator.environment.GetSelectedConfiguration() != configuration_item->configuration_name) { - configurator.ActivateConfiguration(configuration_item->configuration_name); - this->UpdateUI(); - } -} - -void MainWindow::OnConfigurationTreeClicked(QTreeWidgetItem *item, int column) { - (void)column; - - ConfigurationListItem *configuration_item = dynamic_cast(item); - if (configuration_item == nullptr) { - return; - } - - Configurator &configurator = Configurator::Get(); - if (configurator.environment.GetSelectedConfiguration() != configuration_item->configuration_name) { - configurator.ActivateConfiguration(configuration_item->configuration_name); - this->UpdateUI(); - } -} - -/// This gets called with keyboard selections and clicks that do not necessarily -/// result in a radio button change (but it may). So we need to do two checks here, one -/// for the radio button, and one to change the editor/information at lower right. -void MainWindow::OnConfigurationTreeChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) { - (void)previous; - - // This pointer will only be valid if it's one of the elements with - // the radio button - ConfigurationListItem *configuration_item = dynamic_cast(current); - if (configuration_item == nullptr) { - return; - } - configuration_item->radio_button->setChecked(true); - - Configurator &configurator = Configurator::Get(); - if (configurator.environment.GetSelectedConfiguration() != configuration_item->configuration_name) { - configurator.ActivateConfiguration(configuration_item->configuration_name); - this->UpdateUI(); - } -} - -void MainWindow::OnConfigurationItemDoubleClicked(QTreeWidgetItem *item, int column) { - ConfigurationListItem *configuration_item = dynamic_cast(item); - if (configuration_item == nullptr) { - return; - } - - EditClicked(configuration_item); -} - -/// An item has been changed. Check for edit of the items name (configuration name) -void MainWindow::OnConfigurationItemChanged(QTreeWidgetItem *item, int column) { - // This pointer will only be valid if it's one of the elements with - // the radio button - ConfigurationListItem *configuration_item = dynamic_cast(item); - if (configuration_item == nullptr) { - return; - } - - if (column == 1) { // configuration name - _settings_tree_manager.CleanupGUI(); - Configurator &configurator = Configurator::Get(); - - // We are renaming the file. Things can go wrong here... - // This is the name of the configuratin we are changing - // const std::string full_path = - // ConvertNativeSeparators(GetPath(BUILTIN_PATH_CONFIG_LAST) + "/" + configuration_item->configuration_name + ".json"); - - // This is the new name we want to use for the configuration - const std::string &new_name = configuration_item->text(1).toStdString(); - bool valid_new_name = true; - - if (new_name.empty()) { - valid_new_name = false; - Alert::ConfigurationNameEmpty(); - } else { - if (!IsPortableFilename(new_name)) { - valid_new_name = false; - Alert::ConfigurationNameInvalid(); - } - } - - Configuration *duplicate_configuration = FindByKey(configurator.configurations.available_configurations, new_name.c_str()); - if (duplicate_configuration != nullptr) { - valid_new_name = false; - Alert::ConfigurationRenamingFailed(); - } - - // Find existing configuration using it's old name - const std::string old_name = configuration_item->configuration_name; - Configuration *configuration = FindByKey(configurator.configurations.available_configurations, old_name.c_str()); - - if (valid_new_name) { - // Rename configuration ; Remove old configuration file ; change the name of the configuration - configurator.configurations.RemoveConfigurationFile(old_name); - configuration->key = configuration_item->configuration_name = new_name; - configurator.configurations.SaveAllConfigurations(configurator.layers.selected_layers); - - configurator.ActivateConfiguration(new_name); - - LoadConfigurationList(); - } else { - // If the configurate name is empty or the configuration name is taken, keep old configuration name - - ui->configuration_tree->blockSignals(true); - item->setText(1, old_name.c_str()); - ui->configuration_tree->blockSignals(false); - - configurator.ActivateConfiguration(old_name); - } - - this->UpdateUI(); - } -} - -// Unused flag, just display the about Qt dialog -void MainWindow::OnHelpAbout(bool checked) { - (void)checked; - - AboutDialog dlg(this); - dlg.exec(); -} - -void MainWindow::StartTool(Tool tool) { - Configurator &configurator = Configurator::Get(); - - LayersMode saved_mode = configurator.environment.GetMode(); - configurator.environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - configurator.configurations.Configure(configurator.layers.selected_layers); - - switch (tool) { - case TOOL_VULKAN_INFO: - vk_info_dialog.reset(new VulkanInfoDialog(this)); - break; - case TOOL_VULKAN_INSTALL: - vk_installation_dialog.reset(new VulkanAnalysisDialog(this)); - break; - } - - configurator.environment.SetMode(saved_mode); - configurator.configurations.Configure(configurator.layers.selected_layers); -} - -/// Create the VulkanInfo dialog if it doesn't already exits & show it. -void MainWindow::toolsVulkanInfo(bool checked) { - (void)checked; - - this->StartTool(TOOL_VULKAN_INFO); -} - -/// Create the VulkanTools dialog if it doesn't already exist & show it. -void MainWindow::toolsVulkanInstallation(bool checked) { - (void)checked; - - this->StartTool(TOOL_VULKAN_INSTALL); -} - -void MainWindow::OnHelpFindLayers(bool checked) { - (void)checked; - - ShowDoc(DOC_FIND_LAYERS); -} - -void MainWindow::OnHelpReadme(bool checked) { - (void)checked; - - ShowDoc(DOC_VKCONFIG_README); -} - -void MainWindow::OnHelpChangelog(bool checked) { - (void)checked; - - ShowDoc(DOC_VKCONFIG_CHANGELOG); -} - -void MainWindow::OnHelpVulkanSpec(bool checked) { - (void)checked; - - ShowDoc(DOC_VULKAN_SPEC); -} - -void MainWindow::OnHelpLayerSpec(bool checked) { - (void)checked; - - ShowDoc(DOC_VULKAN_LAYERS); -} - -void MainWindow::OnHelpGPUInfo(bool checked) { - (void)checked; - - ShowDoc(DOC_GPU_INFO); -} - -/// The only thing we need to do here is clear the configuration if -/// the user does not want it active. -void MainWindow::closeEvent(QCloseEvent *event) { - Environment &environment = Configurator::Get().environment; - - // If a child process is still running, destroy it - if (_launch_application) { - ResetLaunchApplication(); - } - - _settings_tree_manager.CleanupGUI(); - - environment.Set(VKCONFIG2_LAYOUT_MAIN_GEOMETRY, saveGeometry()); - environment.Set(VKCONFIG2_LAYOUT_MAIN_WINDOW_STATE, saveState()); - environment.Set(VKCONFIG2_LAYOUT_MAIN_SPLITTER1, ui->splitter_settings->saveState()); - environment.Set(VKCONFIG2_LAYOUT_MAIN_SPLITTER2, ui->splitter_configurations->saveState()); - environment.Set(VKCONFIG2_LAYOUT_MAIN_SPLITTER3, ui->splitter_main->saveState()); - - environment.Save(); - - if (QSystemTrayIcon::isSystemTrayAvailable() && environment.GetUseSystemTray()) { - QGuiApplication::setQuitOnLastWindowClosed(false); - this->hide(); - event->ignore(); - } else { - QGuiApplication::setQuitOnLastWindowClosed(true); - QMainWindow::closeEvent(event); - } -} - -/// Resizing needs a little help. Yes please, there has to be -/// a better way of doing this. -void MainWindow::resizeEvent(QResizeEvent *event) { - if (event != nullptr) event->accept(); -} - -void MainWindow::showEvent(QShowEvent *event) { - (void)event; - - UpdateUI(); - - event->accept(); -} - -/// Edit the list of apps that can be filtered. -void MainWindow::on_push_button_applications_clicked() { - ApplicationsDialog dlg(this); - dlg.exec(); - - Configurator &configurator = Configurator::Get(); - configurator.configurations.Configure(configurator.layers.selected_layers); - - UpdateUI(); -} - -void MainWindow::on_push_button_new_clicked() { - Configurator &configurator = Configurator::Get(); - const std::string selected_configuration = configurator.environment.GetSelectedConfiguration(); - - Configuration &new_configuration = - configurator.configurations.CreateConfiguration(configurator.layers.selected_layers, "New Configuration"); - - std::string activate_configuration; - - LayersDialog dlg(this, new_configuration); - switch (dlg.exec()) { - case QDialog::Accepted: - activate_configuration = new_configuration.key; - break; - case QDialog::Rejected: - activate_configuration = selected_configuration; - configurator.configurations.RemoveConfiguration(configurator.layers.selected_layers, new_configuration.key); - break; - default: - assert(0); - break; - } - - configurator.ActivateConfiguration(activate_configuration); - - LoadConfigurationList(); - - this->UpdateUI(); -} - -void MainWindow::on_push_button_remove_clicked() { - Configurator &configurator = Configurator::Get(); - - this->RemoveConfiguration(configurator.environment.GetSelectedConfiguration()); -} - -void MainWindow::on_push_button_duplicate_clicked() { - Configurator &configurator = Configurator::Get(); - - Configuration *configutation = configurator.configurations.FindActiveConfiguration(); - assert(configutation != nullptr); - - const Configuration &duplicated_configuration = - configurator.configurations.CreateConfiguration(configurator.layers.selected_layers, configutation->key, true); - - configurator.ActivateConfiguration(duplicated_configuration.key); - - LoadConfigurationList(); - - this->UpdateUI(); -} - -void MainWindow::on_push_button_edit_clicked() { - Configurator &configurator = Configurator::Get(); - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - assert(configuration != nullptr); - - LayersDialog dlg(this, *configuration); - if (dlg.exec() == QDialog::Accepted) { - configurator.ActivateConfiguration(configuration->key); - - LoadConfigurationList(); - - this->UpdateUI(); - } -} - -// Edit the layers for the given configuration. -void MainWindow::EditClicked(ConfigurationListItem *item) { - assert(item); - assert(!item->configuration_name.empty()); - - Configurator &configurator = Configurator::Get(); - Configuration *configuration = - FindByKey(configurator.configurations.available_configurations, item->configuration_name.c_str()); - assert(configuration != nullptr); - - LayersDialog dlg(this, *configuration); - if (dlg.exec() == QDialog::Accepted) { - configurator.configurations.SortConfigurations(); - configurator.ActivateConfiguration(configuration->key); - - LoadConfigurationList(); - - this->UpdateUI(); - } -} - -void MainWindow::RemoveConfiguration(const std::string &configuration_name) { - assert(!configuration_name.empty()); - - // Let make sure... - QMessageBox alert; - alert.setWindowTitle(format("Removing *%s* configuration...", configuration_name.c_str()).c_str()); - alert.setText(format("Are you sure you want to remove the *%s* configuration?", configuration_name.c_str()).c_str()); - alert.setInformativeText("All the data from this configuration will be lost."); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Warning); - if (alert.exec() == QMessageBox::No) { - return; - } - - Configurator &configurator = Configurator::Get(); - configurator.configurations.RemoveConfiguration(configurator.layers.selected_layers, configuration_name); - configurator.environment.SetSelectedConfiguration(""); - - LoadConfigurationList(); - - this->UpdateUI(); -} - -void MainWindow::RemoveClicked(ConfigurationListItem *item) { - assert(item); - - this->RemoveConfiguration(item->configuration_name); -} - -void MainWindow::ResetClicked(ConfigurationListItem *item) { - assert(item); - assert(!item->configuration_name.empty()); - - Configurator &configurator = Configurator::Get(); - Configuration *configuration = - FindByKey(configurator.configurations.available_configurations, item->configuration_name.c_str()); - assert(configuration != nullptr); - - QMessageBox alert; - alert.setWindowTitle(format("Resetting *%s* configuration...", configuration->key.c_str()).c_str()); - alert.setText(format("Are you sure you want to reset the *%s* configuration?", configuration->key.c_str()).c_str()); - if (configuration->IsBuiltIn()) - alert.setInformativeText( - format("The configuration layers and settings will be restored to default built-in *%s* configuration.", - configuration->key.c_str()) - .c_str()); - else if (configurator.configurations.HasFile(*configuration)) - alert.setInformativeText( - format("The configuration layers and settings will be reloaded using the *%s* saved file from previous %s run.", - configuration->key.c_str(), VKCONFIG_NAME) - .c_str()); - else - alert.setInformativeText("The configuration layers and settings will be reset to zero."); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Warning); - if (alert.exec() == QMessageBox::No) { - return; - } - - configuration->Reset(configurator.layers.selected_layers, configurator.path); - - configurator.ActivateConfiguration(configuration->key); - - LoadConfigurationList(); - - this->UpdateUI(); -} - -void MainWindow::RenameClicked(ConfigurationListItem *item) { - assert(item); - - ui->configuration_tree->editItem(item, 1); -} - -void MainWindow::DuplicateClicked(ConfigurationListItem *item) { - assert(item); - assert(!item->configuration_name.empty()); - - Configurator &configurator = Configurator::Get(); - const Configuration &duplicated_configuration = - configurator.configurations.CreateConfiguration(configurator.layers.selected_layers, item->configuration_name, true); - - item->configuration_name = duplicated_configuration.key; - - configurator.ActivateConfiguration(duplicated_configuration.key); - - LoadConfigurationList(); - - ConfigurationListItem *new_item = nullptr; - for (int i = 0, n = ui->configuration_tree->topLevelItemCount(); i < n; ++i) { - ConfigurationListItem *searched_item = dynamic_cast(ui->configuration_tree->topLevelItem(i)); - assert(searched_item); - - if (searched_item->configuration_name != duplicated_configuration.key) continue; - - new_item = searched_item; - break; - } - assert(new_item); - ui->configuration_tree->editItem(new_item, 1); - - this->UpdateUI(); -} - -void MainWindow::ImportClicked(ConfigurationListItem *item) { - (void)item; // We don't need this - - Configurator &configurator = Configurator::Get(); - - const std::string full_import_path = configurator.path.SelectPath(this, PATH_IMPORT_CONFIGURATION); - if (full_import_path.empty()) return; - - const std::string imported_configuration = - configurator.configurations.ImportConfiguration(configurator.layers.selected_layers, full_import_path); - if (imported_configuration.empty()) { - return; - } - - configurator.ActivateConfiguration(imported_configuration); - - LoadConfigurationList(); - - this->UpdateUI(); -} - -void MainWindow::ExportClicked(ConfigurationListItem *item) { - assert(item); - - Configurator &configurator = Configurator::Get(); - - const std::string full_suggested_path = configurator.path.GetFullPath(PATH_EXPORT_CONFIGURATION, item->configuration_name); - const std::string full_export_path = configurator.path.SelectPath(this, PATH_EXPORT_CONFIGURATION, full_suggested_path); - if (full_export_path.empty()) return; - - configurator.configurations.ExportConfiguration(configurator.layers.selected_layers, full_export_path, - item->configuration_name); -} - -void MainWindow::ReloadDefaultClicked(ConfigurationListItem *item) { - (void)item; - - if (Alert::ConfiguratorReloadDefault() == QMessageBox::Yes) { - _settings_tree_manager.CleanupGUI(); - - Configurator &configurator = Configurator::Get(); - configurator.configurations.ReloadDefaultsConfigurations(configurator.layers.selected_layers); - - configurator.ActivateConfiguration(configurator.environment.GetSelectedConfiguration()); - - LoadConfigurationList(); - - this->UpdateUI(); - } -} - -void MainWindow::editorExpanded(QTreeWidgetItem *item) { - (void)item; - ui->settings_tree->resizeColumnToContents(0); -} - -void MainWindow::OnConfigurationItemExpanded(QTreeWidgetItem *item) { - (void)item; - ui->settings_tree->resizeColumnToContents(0); - ui->settings_tree->resizeColumnToContents(1); -} - -void MainWindow::OnSettingsTreeClicked(QTreeWidgetItem *item, int column) { - (void)column; - (void)item; - - Configurator &configurator = Configurator::Get(); - configurator.configurations.Configure(configurator.layers.selected_layers); - - // Don't update UI here. It's not useful and cause setting tree rebuild -} - -void MainWindow::SetupLauncherTree() { - // App Name - QTreeWidgetItem *launcher_parent = new QTreeWidgetItem(); - launcher_parent->setText(0, "Application"); - ui->launcher_tree->addTopLevelItem(launcher_parent); - - _launcher_apps_combo = new QComboBox(); - _launcher_apps_combo->setFocusPolicy(Qt::StrongFocus); - _launcher_apps_combo->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_apps_combo->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_parent, 1, _launcher_apps_combo); - - _launcher_apps_browse_button = new QPushButton(); - _launcher_apps_browse_button->setText("..."); - _launcher_apps_browse_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - _launcher_apps_browse_button->setMaximumWidth(LAUNCH_COLUMN2_SIZE); - _launcher_apps_browse_button->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_apps_browse_button->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_parent, 2, _launcher_apps_browse_button); - connect(_launcher_apps_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(launchItemChanged(int))); - connect(_launcher_apps_browse_button, SIGNAL(clicked()), this, SLOT(on_push_button_applications_clicked())); - - // Executable - QTreeWidgetItem *launcher_executable_item = new QTreeWidgetItem(); - launcher_executable_item->setText(0, "Executable"); - launcher_parent->addChild(launcher_executable_item); - - _launcher_executable = new QLineEdit(); - _launcher_executable->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_executable->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_executable_item, 1, _launcher_executable); - _launcher_executable->setReadOnly(false); - - _launcher_executable_browse_button = new QPushButton(); - _launcher_executable_browse_button->setText("..."); - _launcher_executable_browse_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - _launcher_executable_browse_button->setMaximumWidth(LAUNCH_COLUMN2_SIZE); - _launcher_executable_browse_button->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_executable_browse_button->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_executable_item, 2, _launcher_executable_browse_button); - connect(_launcher_executable, SIGNAL(textEdited(const QString &)), this, SLOT(launchChangeExecutable(const QString &))); - connect(_launcher_executable_browse_button, SIGNAL(clicked()), this, SLOT(launchSetExecutable())); - - // Working folder - QTreeWidgetItem *launcher_folder_item = new QTreeWidgetItem(); - launcher_folder_item->setText(0, "Working Directory"); - launcher_parent->addChild(launcher_folder_item); - - _launcher_working = new QLineEdit(); - _launcher_working->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_working->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_folder_item, 1, _launcher_working); - _launcher_working->setReadOnly(false); - - _launcher_working_browse_button = new QPushButton(); - _launcher_working_browse_button->setText("..."); - _launcher_working_browse_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - _launcher_working_browse_button->setMaximumWidth(LAUNCH_COLUMN2_SIZE); - _launcher_working_browse_button->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_working_browse_button->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_folder_item, 2, _launcher_working_browse_button); - connect(_launcher_working, SIGNAL(textEdited(const QString &)), this, SLOT(launchChangeWorkingFolder(const QString &))); - connect(_launcher_working_browse_button, SIGNAL(clicked()), this, SLOT(launchSetWorkingFolder())); - - // Command line arguments - QTreeWidgetItem *launcher_arguments_item = new QTreeWidgetItem(); - launcher_arguments_item->setText(0, "Command-line Arguments"); - launcher_parent->addChild(launcher_arguments_item); - - _launcher_arguments = new QLineEdit(); - _launcher_arguments->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_arguments->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_arguments_item, 1, _launcher_arguments); - connect(_launcher_arguments, SIGNAL(textEdited(const QString &)), this, SLOT(launchArgsEdited(const QString &))); - - // Log file - QTreeWidgetItem *launcher_log_file_item = new QTreeWidgetItem(); - launcher_log_file_item->setText(0, "Output Log"); - launcher_parent->addChild(launcher_log_file_item); - - _launcher_log_file_edit = new QLineEdit(); - _launcher_log_file_edit->setMinimumHeight(LAUNCH_ROW_HEIGHT); - _launcher_log_file_edit->setMaximumHeight(LAUNCH_ROW_HEIGHT); - ui->launcher_tree->setItemWidget(launcher_log_file_item, 1, _launcher_log_file_edit); - connect(_launcher_log_file_edit, SIGNAL(textEdited(const QString &)), this, SLOT(launchChangeLogFile(const QString &))); - - _launcher_log_file_browse_button = new QPushButton(); - _launcher_log_file_browse_button->setText("..."); - _launcher_log_file_browse_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - _launcher_log_file_browse_button->setMaximumWidth(LAUNCH_COLUMN2_SIZE); - ui->launcher_tree->setItemWidget(launcher_log_file_item, 2, _launcher_log_file_browse_button); - connect(_launcher_log_file_browse_button, SIGNAL(clicked()), this, SLOT(launchSetLogFile())); - - // Launcher tree - ui->launcher_tree->setMinimumHeight(LAUNCH_ROW_HEIGHT * 5 + 6); - ui->launcher_tree->setMaximumHeight(LAUNCH_ROW_HEIGHT * 5 + 6); - - ui->launcher_tree->setColumnWidth(0, LAUNCH_COLUMN0_SIZE); - ui->launcher_tree->setColumnWidth( - 1, ui->launcher_tree->rect().width() - LAUNCH_COLUMN0_SIZE - LAUNCH_COLUMN2_SIZE - LAUNCH_SPACING_SIZE); - ui->launcher_tree->setColumnWidth(2, LAUNCH_COLUMN2_SIZE); - - if (Configurator::Get().environment.Get(LAYOUT_LAUNCHER_COLLAPSED) == "true") - launchItemCollapsed(nullptr); - else - ui->launcher_tree->expandItem(launcher_parent); - - ui->launcher_tree->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - ui->launcher_tree->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); -} - -// Expanding the tree also grows the tree to match -void MainWindow::launchItemExpanded(QTreeWidgetItem *item) { - (void)item; - ui->launcher_tree->setMinimumHeight(LAUNCH_ROW_HEIGHT * 5 + 6); - ui->launcher_tree->setMaximumHeight(LAUNCH_ROW_HEIGHT * 5 + 6); - Configurator::Get().environment.Set(LAYOUT_LAUNCHER_COLLAPSED, QByteArray("false")); -} - -// Collapsing the tree also shrinks the tree to match and show only the first line -void MainWindow::launchItemCollapsed(QTreeWidgetItem *item) { - (void)item; - ui->launcher_tree->setMinimumHeight(LAUNCH_ROW_HEIGHT + 6); - ui->launcher_tree->setMaximumHeight(LAUNCH_ROW_HEIGHT + 6); - Configurator::Get().environment.Set(LAYOUT_LAUNCHER_COLLAPSED, QByteArray("true")); -} - -void MainWindow::OnLauncherLoaderMessageChanged(int level) { - Configurator &configurator = Configurator::Get(); - - configurator.environment.SetLoaderMessageTypes(GetLoaderMessageFlags(static_cast(level))); - - if (ui->check_box_clear_on_launch->isChecked()) { - this->UpdateUI(); - } -} - -void MainWindow::launchSetExecutable() { - int current_application_index = _launcher_apps_combo->currentIndex(); - assert(current_application_index >= 0); - - Configurator &configurator = Configurator::Get(); - Application &application = configurator.environment.GetApplication(current_application_index); - std::string new_path = _launcher_executable->text().toStdString(); - if (!QFileInfo(ReplaceBuiltInVariable(new_path).c_str()).exists()) { - new_path = application.executable_path.c_str(); - } - - const std::string selected_path = configurator.path.SelectPath(this, PATH_EXECUTABLE, ReplaceBuiltInVariable(new_path)); - - // The user has cancel the operation - if (selected_path.empty()) { - return; - } - - // The path didn't change, preserve the built-in variables - if (ReplaceBuiltInVariable(new_path) == selected_path) { - return; - } - - application.executable_path = selected_path; - _launcher_executable->setText(selected_path.c_str()); -} - -void MainWindow::launchSetLogFile() { - int current_application_index = _launcher_apps_combo->currentIndex(); - assert(current_application_index >= 0); - - Configurator &configurator = Configurator::Get(); - Application &application = configurator.environment.GetApplication(current_application_index); - std::string new_path = _launcher_log_file_edit->text().toStdString(); - if (!QFileInfo(ReplaceBuiltInVariable(new_path).c_str()).exists()) { - new_path = application.log_file.c_str(); - } - - const std::string selected_path = configurator.path.SelectPath(this, PATH_LAUNCHER_LOG_FILE, ReplaceBuiltInVariable(new_path)); - - // The user has cancel the operation - if (selected_path.empty()) { - return; - } - - // The path didn't change, preserve the built-in variables - if (ReplaceBuiltInVariable(new_path) == selected_path) { - return; - } - - application.log_file = selected_path; - _launcher_log_file_edit->setText(selected_path.c_str()); -} - -void MainWindow::launchSetWorkingFolder() { - int current_application_index = _launcher_apps_combo->currentIndex(); - assert(current_application_index >= 0); - - Configurator &configurator = Configurator::Get(); - Application &application = configurator.environment.GetApplication(current_application_index); - std::string new_path = _launcher_working->text().toStdString(); - if (!QFileInfo(ReplaceBuiltInVariable(new_path).c_str()).exists()) { - new_path = application.working_folder.c_str(); - } - - const std::string selected_path = configurator.path.SelectPath(this, PATH_WORKING_DIR, ReplaceBuiltInVariable(new_path)); - - // The user has cancel the operation - if (selected_path.empty()) { - return; - } - - // The path didn't change, preserve the built-in variables - if (ReplaceBuiltInVariable(new_path) == selected_path) { - return; - } - - application.working_folder = selected_path; - _launcher_working->setText(selected_path.c_str()); -} - -// Log file path edited manually. -void MainWindow::launchChangeLogFile(const QString &log_file) { - int current_application_index = _launcher_apps_combo->currentIndex(); - assert(current_application_index >= 0); - - const std::string replaced_path = ReplaceBuiltInVariable(log_file.toStdString()); - - if (QFileInfo(replaced_path.c_str()).exists()) { - Application &application = Configurator::Get().environment.GetApplication(current_application_index); - application.log_file = log_file.toStdString(); - } -} - -void MainWindow::launchChangeExecutable(const QString &exe_path) { - int current_application_index = _launcher_apps_combo->currentIndex(); - assert(current_application_index >= 0); - - const std::string replaced_path = ReplaceBuiltInVariable(exe_path.toStdString()); - - if (QFileInfo(replaced_path.c_str()).exists()) { - Application &application = Configurator::Get().environment.GetApplication(current_application_index); - application.executable_path = exe_path.toStdString(); - } -} - -void MainWindow::launchChangeWorkingFolder(const QString &working_folder) { - int current_application_index = _launcher_apps_combo->currentIndex(); - assert(current_application_index >= 0); - - const std::string replaced_path = ReplaceBuiltInVariable(working_folder.toStdString()); - - if (QFileInfo(replaced_path.c_str()).exists()) { - Application &application = Configurator::Get().environment.GetApplication(current_application_index); - application.working_folder = working_folder.toStdString(); - } -} - -void MainWindow::UpdateApplicationUI(const Application &application) { - _launcher_executable->setText(application.executable_path.c_str()); - _launcher_executable->setToolTip(ReplaceBuiltInVariable(application.executable_path.c_str()).c_str()); - _launcher_arguments->setText(application.arguments.c_str()); - _launcher_working->setText(application.working_folder.c_str()); - _launcher_working->setToolTip(ReplaceBuiltInVariable(application.working_folder.c_str()).c_str()); - _launcher_log_file_edit->setText(application.log_file.c_str()); - _launcher_log_file_edit->setToolTip(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); -} - -// Launch app change -void MainWindow::launchItemChanged(int application_index) { - if (application_index < 0) return; - - Environment &environment = Configurator::Get().environment; - - environment.SelectActiveApplication(application_index); - - const Application &application = environment.GetApplication(application_index); - this->UpdateApplicationUI(application); -} - -/// New command line arguments. Update them. -void MainWindow::launchArgsEdited(const QString &arguments) { - int application_index = _launcher_apps_combo->currentIndex(); - if (application_index < 0) return; - - Application &application = Configurator::Get().environment.GetApplication(application_index); - application.arguments = arguments.toStdString(); -} - -// Clear the browser window -void MainWindow::ClearLog() { - if (ui->check_box_clear_on_launch->isChecked()) { - on_push_button_clear_log_clicked(); - } -} - -void MainWindow::on_push_button_clear_log_clicked() { - ui->log_browser->clear(); - ui->log_browser->update(); - ui->push_button_clear_log->setEnabled(false); -} - -void MainWindow::on_push_button_status_clicked() { this->UpdateStatus(); } - -void MainWindow::UpdateStatus() { - ui->push_button_clear_log->setEnabled(true); - - QString text = ("Vulkan Development Status:\n" + GenerateVulkanStatus() + "\n").c_str(); - - if (!ui->check_box_clear_on_launch->isChecked()) { - text += ui->log_browser->toPlainText(); - } - - ui->log_browser->setPlainText(text); -} - -const Layer *GetLayer(QTreeWidget *tree, QTreeWidgetItem *item) { - if (item == tree->invisibleRootItem()) return nullptr; - if (item == nullptr) return nullptr; - - const std::string &text = item->text(0).toStdString().c_str(); - if (!text.empty()) { - Configurator &configurator = Configurator::Get(); - - for (std::size_t i = 0, n = configurator.layers.selected_layers.size(); i < n; ++i) { - const Layer &layer = configurator.layers.selected_layers[i]; - if (text.find(layer.key) != std::string::npos) return &layer; - } - } - - return GetLayer(tree, item->parent()); -} - -bool MainWindow::eventFilter(QObject *target, QEvent *event) { - if (event->type() == QEvent::Wheel) { - return true; - } - - // Launch tree does some fancy resizing and since it's down in - // layouts and splitters, we can't just rely on the resize method - // of this window. Any resize coming through needs to trigger this - // or we get drawing artifacts on macOS. - if (event->type() == QEvent::Resize) { - const QRect rect = ui->launcher_tree->rect(); - ui->launcher_tree->setColumnWidth(0, LAUNCH_COLUMN0_SIZE); - ui->launcher_tree->setColumnWidth(1, rect.width() - LAUNCH_COLUMN0_SIZE - LAUNCH_COLUMN2_SIZE - LAUNCH_SPACING_SIZE); - ui->launcher_tree->setColumnWidth(2, LAUNCH_COLUMN2_SIZE); - return false; - } - - Configurator &configurator = Configurator::Get(); - - // Context menus for layer configuration files - if (target == ui->settings_tree) { - QContextMenuEvent *right_click = dynamic_cast(event); - if (right_click) { - bool require_update_ui = false; - - QTreeWidgetItem *setting_item = ui->settings_tree->itemAt(right_click->pos()); - - // std::string layer_name = setting_item->toolTip(0).toStdString(); - std::string setting_text = setting_item->text(0).toStdString(); - if (setting_text == "Vulkan Applications") { - return false; - } - if (setting_text == "Vulkan Drivers") { - return false; - } - if (setting_text == "Excluded Layers:") { - return false; - } - - const Layer *layer = GetLayer(ui->settings_tree, setting_item); - std::string layer_name = setting_text; - - if (layer != nullptr) { - layer_name = layer->key; - } - - // Create context menu here - QMenu menu(ui->settings_tree); - QFont subtitle_font = menu.font(); - subtitle_font.setBold(true); - - QAction *title_action = new QAction(layer_name.c_str(), nullptr); - title_action->setEnabled(layer != nullptr); - title_action->setFont(subtitle_font); - menu.addAction(title_action); - - QAction *visit_layer_website_action = new QAction("Visit Layer Website...", nullptr); - visit_layer_website_action->setEnabled(layer != nullptr ? !layer->url.empty() : false); - menu.addAction(visit_layer_website_action); - - QAction *export_html_action = new QAction("Open Layer HTML Documentation...", nullptr); - export_html_action->setEnabled(layer != nullptr); - menu.addAction(export_html_action); - - QAction *export_markdown_action = new QAction("Open Layer Markdown Documentation...", nullptr); - export_markdown_action->setEnabled(layer != nullptr); - menu.addAction(export_markdown_action); - - static const char *table[] = { - "N/A", // LAYER_STATE_APPLICATION_CONTROLLED - "Exclude Layer", // LAYER_STATE_OVERRIDDEN - "Override Layer" // LAYER_STATE_EXCLUDED - }; - static_assert(countof(table) == LAYER_STATE_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - - Parameter *parameter = nullptr; - for (std::size_t i = 0, n = configuration->parameters.size(); i < n; ++i) { - if (layer_name.find(configuration->parameters[i].key) != std::string::npos) { - parameter = &configuration->parameters[i]; - break; - } - } - - QAction *export_settings_action = new QAction("Open Layer vk_layers_settings.txt...", nullptr); - export_settings_action->setEnabled(layer != nullptr ? parameter->state == LAYER_STATE_OVERRIDDEN : false); - menu.addAction(export_settings_action); - - QAction *layer_state_action = new QAction(layer != nullptr ? table[parameter->state] : "Remove Layer", nullptr); - if (layer == nullptr) { - layer_state_action->setFont(subtitle_font); - } - menu.addAction(layer_state_action); - - menu.addSeparator(); - - QAction *show_advanced_setting_action = new QAction("View Advanced Settings", nullptr); - show_advanced_setting_action->setEnabled(layer != nullptr); - show_advanced_setting_action->setCheckable(true); - show_advanced_setting_action->setChecked(configuration->view_advanced_settings); - menu.addAction(show_advanced_setting_action); - - QPoint point(right_click->globalX(), right_click->globalY()); - QAction *action = menu.exec(point); - - if (action == title_action) { - Alert::LayerProperties(layer); - } else if (action == visit_layer_website_action) { - QDesktopServices::openUrl(QUrl(layer->url.c_str())); - } else if (action == layer_state_action) { - switch (parameter->state) { - case LAYER_STATE_OVERRIDDEN: - parameter->state = LAYER_STATE_EXCLUDED; - break; - case LAYER_STATE_EXCLUDED: - parameter->state = LAYER_STATE_OVERRIDDEN; - break; - default: - assert(0); - break; - } - configuration->setting_tree_state.clear(); - - configurator.ActivateConfiguration(configuration->key); - - require_update_ui = true; - } else if (action == show_advanced_setting_action) { - configuration->view_advanced_settings = action->isChecked(); - configuration->setting_tree_state.clear(); - } else if (action == export_html_action) { - const std::string path = format("%s/%s.html", GetPath(BUILTIN_PATH_APPDATA).c_str(), layer->key.c_str()); - ExportHtmlDoc(*layer, path); - QDesktopServices::openUrl(QUrl(("file:///" + path).c_str())); - } else if (action == export_markdown_action) { - const std::string path = format("%s/%s.md", GetPath(BUILTIN_PATH_APPDATA).c_str(), layer->key.c_str()); - ExportMarkdownDoc(*layer, path); - QDesktopServices::openUrl(QUrl(("file:///" + path).c_str())); - } else if (action == export_settings_action) { - std::vector layers = {*layer}; - const std::string path = GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - ExportSettingsDoc(layers, *configuration, path); - QDesktopServices::openUrl(QUrl(("file:///" + path).c_str())); - } else { - return false; // Unknown action - } - - if (require_update_ui) { - this->UpdateUI(); - } - - // Do not pass on - return true; - } - } else if (target == ui->configuration_tree) { - QContextMenuEvent *right_click = dynamic_cast(event); - if (right_click) { // && event->type() == QEvent::ContextMenu) { - // Which item were we over? - QTreeWidgetItem *configuration_item = ui->configuration_tree->itemAt(right_click->pos()); - ConfigurationListItem *item = dynamic_cast(configuration_item); - - const Environment &environment = configurator.environment; - const std::string &active_contiguration_name = environment.GetSelectedConfiguration(); - - const bool active = environment.GetMode() != LAYERS_MODE_BY_APPLICATIONS && !active_contiguration_name.empty(); - - // Create context menu here - QMenu menu(ui->configuration_tree); - - QAction *rename_action = new QAction("Rename", nullptr); - rename_action->setEnabled(active && item != nullptr); - menu.addAction(rename_action); - - menu.addSeparator(); - - QAction *import_action = new QAction("Import...", nullptr); - import_action->setEnabled(true); - menu.addAction(import_action); - - QAction *export_action = new QAction("Export...", nullptr); - export_action->setEnabled(active && item != nullptr); - menu.addAction(export_action); - - menu.addSeparator(); - - QAction *reset_action = new QAction("Reset", nullptr); - reset_action->setEnabled(active && item != nullptr); - menu.addAction(reset_action); - - menu.addSeparator(); - - QAction *reload_default_action = new QAction("Reload Default Configurations", nullptr); - reload_default_action->setEnabled(true); - menu.addAction(reload_default_action); - - QPoint point(right_click->globalX(), right_click->globalY()); - QAction *action = menu.exec(point); - - if (action == rename_action) { - RenameClicked(item); - } else if (action == reset_action) { - ResetClicked(item); - } else if (action == export_action) { - ExportClicked(item); - } else if (action == import_action) { - ImportClicked(item); - } else if (action == reload_default_action) { - ReloadDefaultClicked(item); - } else { - return false; // Unknown action - } - - // Do not pass on - return true; - } - } - - // Pass it on - return false; -} - -bool MainWindow::SelectConfigurationItem(const std::string &configuration_name) { - assert(!configuration_name.empty()); - - for (int i = 0, n = ui->configuration_tree->topLevelItemCount(); i < n; ++i) { - ConfigurationListItem *item = dynamic_cast(ui->configuration_tree->topLevelItem(i)); - assert(item != nullptr); - assert(!item->configuration_name.empty()); - if (item->configuration_name == configuration_name) { - ui->configuration_tree->setCurrentItem(item); - return true; - } - } - - assert(0); - return false; -} - -void MainWindow::ResetLaunchApplication() { - if (_launch_application) { - _launch_application->kill(); - _launch_application->waitForFinished(); - _launch_application.reset(); - - ui->push_button_launcher->setText("Launch"); - - _settings_tree_manager.launched_application = false; - } -} - -QStringList MainWindow::BuildEnvVariables() const { - Configurator &configurator = Configurator::Get(); - - QStringList env = QProcess::systemEnvironment(); - env << (QString("VK_LOADER_DEBUG=") + ::GetLoaderMessageTokens(configurator.environment.GetLoaderMessageTypes()).c_str()); - return env; -} - -void MainWindow::on_push_button_launcher_clicked() { - // Are we already monitoring a running app? If so, terminate it - if (_launch_application != nullptr) { - ResetLaunchApplication(); - return; - } - - std::string launch_log; - - // Update the Vulkan Developemnt status to record the system configuration - QString vulkan_status = ("Vulkan Development Status:\n" + GenerateVulkanStatus() + "\n").c_str(); - launch_log += vulkan_status.toStdString(); - - // We are logging, let's add that we've launched a new application - launch_log += "Launching Vulkan Application:\n"; - - Configurator &configurator = Configurator::Get(); - const Application &active_application = configurator.environment.GetActiveApplication(); - - assert(!active_application.app_name.empty()); - launch_log += format("- Application: %s\n", active_application.app_name.c_str()); - assert(!active_application.executable_path.empty()); - - launch_log += format("- Executable: %s\n", ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str()); - if (!QFileInfo(ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str()).exists()) { - Alert::PathInvalid(ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str(), - format("The '%s' application will fail to launch.", active_application.app_name.c_str()).c_str()); - } - - launch_log += format("- Working Directory: %s\n", ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str()); - if (!QFileInfo(ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str()).exists()) { - Alert::PathInvalid(ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str(), - format("The '%s' application will fail to launch.", active_application.app_name.c_str()).c_str()); - } - - if (!_launcher_arguments->text().isEmpty()) { - launch_log += format("- Command-line Arguments: %s\n", _launcher_arguments->text().toStdString().c_str()); - } - - const std::string actual_log_file = ReplaceBuiltInVariable(_launcher_log_file_edit->text().toStdString()); - if (!actual_log_file.empty()) { - launch_log += format("- Log file: %s\n", actual_log_file.c_str()); - } - - if (!actual_log_file.empty()) { - // Start logging - // Make sure the log file is not already opened. This can occur if the - // launched application is closed from the applicaiton. - if (!_log_file.isOpen()) { - _log_file.setFileName(actual_log_file.c_str()); - - // Open and append, or open and truncate? - QIODevice::OpenMode mode = QIODevice::WriteOnly | QIODevice::Text; - if (!ui->check_box_clear_on_launch->isChecked()) mode |= QIODevice::Append; - - if (!_log_file.open(mode)) { - Alert::LogFileFailed(); - } - } - } - - if (ui->check_box_clear_on_launch->isChecked()) { - ui->log_browser->clear(); - } - - Log(launch_log.c_str()); - - // Launch the test application - _launch_application.reset(new QProcess(this)); - connect(_launch_application.get(), SIGNAL(readyReadStandardOutput()), this, SLOT(standardOutputAvailable())); - connect(_launch_application.get(), SIGNAL(readyReadStandardError()), this, SLOT(errorOutputAvailable())); - connect(_launch_application.get(), SIGNAL(finished(int, QProcess::ExitStatus)), this, - SLOT(processClosed(int, QProcess::ExitStatus))); - - _launch_application->setProgram(ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str()); - _launch_application->setWorkingDirectory(ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str()); - _launch_application->setEnvironment(BuildEnvVariables()); - - if (!_launcher_arguments->text().isEmpty()) { - const QStringList args = ConvertString(SplitSpace(_launcher_arguments->text().toStdString())); - _launch_application->setArguments(args); - } - - ui->push_button_launcher->setText("Terminate"); - _launch_application->start(QIODevice::ReadOnly | QIODevice::Unbuffered); - _launch_application->setProcessChannelMode(QProcess::MergedChannels); - _launch_application->closeWriteChannel(); - - // Wait... did we start? Give it 4 seconds, more than enough time - if (!_launch_application->waitForStarted(4000)) { - _launch_application->deleteLater(); - _launch_application = nullptr; - - ui->push_button_launcher->setText("Launch"); - - const std::string failed_log = - std::string("Failed to launch ") + ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str() + "!\n"; - Log(failed_log); - } else { - _settings_tree_manager.launched_application = true; - } -} - -/// The process we are following is closed. We don't actually care about the -/// exit status/code, we just need to know to destroy the QProcess object -/// and set it back to nullptr so that we know we can launch a new app. -/// Also, if we are logging, it's time to close the log file. -void MainWindow::processClosed(int exit_code, QProcess::ExitStatus status) { - (void)exit_code; - (void)status; - - assert(_launch_application); - - disconnect(_launch_application.get(), SIGNAL(finished(int, QProcess::ExitStatus)), this, - SLOT(processClosed(int, QProcess::ExitStatus))); - disconnect(_launch_application.get(), SIGNAL(readyReadStandardError()), this, SLOT(errorOutputAvailable())); - disconnect(_launch_application.get(), SIGNAL(readyReadStandardOutput()), this, SLOT(standardOutputAvailable())); - - Log("Process terminated"); - - if (_log_file.isOpen()) { - _log_file.close(); - } - - ResetLaunchApplication(); -} - -/// This signal get's raised whenever the spawned Vulkan appliction writes -/// to stdout and there is data to be read. The layers flush after all stdout -/// writes, so we should see layer output here in realtime, as we just read -/// the string and append it to the text browser. -/// If a log file is open, we also write the output to the log. -void MainWindow::standardOutputAvailable() { - if (_launch_application) { - Log(_launch_application->readAllStandardOutput().toStdString()); - } -} - -void MainWindow::errorOutputAvailable() { - if (_launch_application) { - Log(_launch_application->readAllStandardError().toStdString()); - } -} - -void MainWindow::Log(const std::string &log) { - ui->log_browser->setPlainText(ui->log_browser->toPlainText() + "\n" + log.c_str()); - ui->push_button_clear_log->setEnabled(true); - - if (_log_file.isOpen()) { - _log_file.write(log.c_str(), log.size()); - _log_file.flush(); - } -} diff --git a/vkconfig/mainwindow.h b/vkconfig/mainwindow.h deleted file mode 100644 index d2abed0e83..0000000000 --- a/vkconfig/mainwindow.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "configurator.h" -#include "settings_tree.h" - -#include "ui_mainwindow.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/// This just allows me to associate a specific profile definition -/// with a list widget item. -class ConfigurationListItem : public QTreeWidgetItem { - public: - ConfigurationListItem(const std::string &configuration_name) : configuration_name(configuration_name) {} - std::string configuration_name; - QRadioButton *radio_button; - - private: - ConfigurationListItem(const ConfigurationListItem &) = delete; - ConfigurationListItem &operator=(const ConfigurationListItem &) = delete; -}; - -enum Tool { TOOL_VULKAN_INFO, TOOL_VULKAN_INSTALL }; - -class MainWindow : public QMainWindow { - Q_OBJECT - - public: - MainWindow(QWidget *parent = nullptr); - ~MainWindow(); - - void UpdateUI(); - void UpdateApplicationUI(const Application &application); - - private: - SettingsTreeManager _settings_tree_manager; - - std::unique_ptr _launch_application; // Keeps track of the monitored app - QFile _log_file; // Log file for layer output - - void LoadConfigurationList(); - void SetupLauncherTree(); - - void closeEvent(QCloseEvent *event) override; - void showEvent(QShowEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - bool eventFilter(QObject *target, QEvent *event) override; - - std::unique_ptr vk_info_dialog; - std::unique_ptr vk_installation_dialog; - - void Log(const std::string &log); - - ConfigurationListItem *GetCheckedItem(); - - QComboBox *_launcher_apps_combo; - QLineEdit *_launcher_executable; - QLineEdit *_launcher_arguments; - QLineEdit *_launcher_working; - QLineEdit *_launcher_log_file_edit; - QPushButton *_launcher_apps_browse_button; - QPushButton *_launcher_executable_browse_button; - QPushButton *_launcher_working_browse_button; - QPushButton *_launcher_log_file_browse_button; - QSystemTrayIcon *_tray_icon; - QMenu *_tray_icon_menu; - QAction *_tray_restore_action; - QAction *_tray_layers_controlled_by_applications; - QAction *_tray_layers_controlled_by_configurator; - QAction *_tray_layers_disabled_by_configurator; - QAction *_tray_quit_action; - - void RemoveClicked(ConfigurationListItem *item); - void ResetClicked(ConfigurationListItem *item); - void RenameClicked(ConfigurationListItem *item); - void EditClicked(ConfigurationListItem *item); - void DuplicateClicked(ConfigurationListItem *item); - void ExportClicked(ConfigurationListItem *item); - void ImportClicked(ConfigurationListItem *item); - void ReloadDefaultClicked(ConfigurationListItem *item); - - private slots: - void trayActionRestore(); - void trayActionControlledByApplications(bool checked); - void trayActionControlledByConfigurator(bool checked); - void trayActionDisabledByApplications(bool checked); - void iconActivated(QSystemTrayIcon::ActivationReason reason); - - public Q_SLOTS: - void toolsVulkanInfo(bool checked); - void toolsVulkanInstallation(bool checked); - void toolsResetToDefault(bool checked); - - void OnHelpFindLayers(bool checked); - void OnHelpAbout(bool checked); - void OnHelpReadme(bool checked); - void OnHelpChangelog(bool checked); - void OnHelpVulkanSpec(bool checked); - void OnHelpLayerSpec(bool checked); - void OnHelpGPUInfo(bool checked); - - void editorExpanded(QTreeWidgetItem *item); - - void launchItemExpanded(QTreeWidgetItem *item); - void launchItemCollapsed(QTreeWidgetItem *item); - void launchItemChanged(int index); - void launchSetLogFile(); - void launchSetExecutable(); - void launchSetWorkingFolder(); - void launchChangeLogFile(const QString &new_text); - void launchChangeExecutable(const QString &new_text); - void launchChangeWorkingFolder(const QString &new_text); - void launchArgsEdited(const QString &new_text); - - void on_push_button_launcher_clicked(); - void on_push_button_clear_log_clicked(); - void on_push_button_status_clicked(); - void on_check_box_apply_list_clicked(); - void on_check_box_persistent_clicked(); - void on_check_box_clear_on_launch_clicked(); - void on_push_button_applications_clicked(); - void on_push_button_edit_clicked(); - void on_push_button_new_clicked(); - void on_push_button_remove_clicked(); - void on_push_button_duplicate_clicked(); - - void OnComboBoxModeChanged(int index); - void OnConfigurationItemExpanded(QTreeWidgetItem *item); - void OnConfigurationItemClicked(bool checked); - void OnConfigurationTreeChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); - void OnConfigurationItemChanged(QTreeWidgetItem *item, int column); - void OnConfigurationItemDoubleClicked(QTreeWidgetItem *item, int column); - void OnConfigurationTreeClicked(QTreeWidgetItem *item, int column); - void OnSettingsTreeClicked(QTreeWidgetItem *item, int column); - void OnLauncherLoaderMessageChanged(int level); - - void standardOutputAvailable(); // stdout output is available - void errorOutputAvailable(); // Layeroutput is available - void processClosed(int exitCode, QProcess::ExitStatus status); // app died - - private: - MainWindow(const MainWindow &) = delete; - MainWindow &operator=(const MainWindow &) = delete; - - void InitTray(); - void UpdateTray(); - - void RemoveConfiguration(const std::string &configuration_name); - bool SelectConfigurationItem(const std::string &configuration_name); - void ResetLaunchApplication(); - void StartTool(Tool tool); - QStringList BuildEnvVariables() const; - void UpdateStatus(); - - void ClearLog(); - - std::unique_ptr ui; - bool been_warned_about_old_loader; -}; - -int run_gui(int argc, char *argv[]); diff --git a/vkconfig/mainwindow.ui b/vkconfig/mainwindow.ui deleted file mode 100644 index 330a4f750e..0000000000 --- a/vkconfig/mainwindow.ui +++ /dev/null @@ -1,820 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 1200 - 720 - - - - - 1 - 1 - - - - - 1200 - 720 - - - - - 16777215 - 16777215 - - - - - Arial - 10 - - - - Vulkan Configurator - - - - - - - - - - Qt::Horizontal - - - true - - - 5 - - - false - - - - Qt::Vertical - - - - - 16 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 4 - 1 - - - - - 0 - 135 - - - - - 16777215 - 135 - - - - Vulkan Layers Management - - - false - - - - - - - Layers Controlled by the Vulkan Applications - - - - - Layers Controlled by the Vulkan Configurator - - - - - Layers Disabled by the Vulkan Configurator - - - - - - - - - - - 0 - 24 - - - - - Arial - 10 - - - - Keep Vulkan Configurator running in system tray - - - - - - - - 0 - 24 - - - - - Arial - 10 - - - - Apply only to the Vulkan Applications List - - - - - - - - 0 - 0 - - - - - 150 - 26 - - - - - 136 - 16777215 - - - - - Arial - 10 - - - - Edit Applications... - - - - - - - - - - - - - 1 - 0 - - - - Vulkan Layers Configurations - - - - 6 - - - - - - - - Arial - 10 - - - - QAbstractItemView::NoEditTriggers - - - false - - - 5 - - - 2 - - - false - - - 20 - - - - 1 - - - - - 2 - - - - - - - - 5 - - - 5 - - - 5 - - - 5 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - New... - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - Arial - 10 - - - - Edit... - - - - - - - Duplicate - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Remove - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - - - - - - - - - 0 - 1 - - - - Vulkan Application Launcher - - - - - - - 0 - 1 - - - - - 0 - 98 - - - - - 16777215 - 98 - - - - - Arial - 10 - - - - false - - - QAbstractItemView::NoEditTriggers - - - 3 - - - false - - - true - - - false - - - - - - - - - 2 - - - - - 3 - - - - - - - - - Consolas - 9 - - - - false - - - - - - - - Arial - 10 - - - - - - - - - - true - - - - - - - - Arial - 10 - - - - Clear - - - - - - - Status - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - Arial - 10 - - - - Launch - - - - - - - - 0 - 0 - - - - <html><head/><body><p>Vulkan loader debug messages level used by the VK_LOADER_DEBUG environment variable on launch. <br/><br/>Levels are:<br/>- error<br/>- warn (warnings)<br/>- info (information)<br/>- debug<br/>- layer (layer information)<br/>- implem (implementation/icd information)<br/>- all (report out all messages)</p></body></html> - - - - none - - - - - error - - - - - warn - - - - - info - - - - - debug - - - - - layer - - - - - implem - - - - - all - - - - - - - - Vulkan Loader: - - - - - - - - - Qt::Vertical - - - - - 0 - 1 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 400 - 0 - - - - Configuration Settings - - - false - - - false - - - - 9 - - - - - - 300 - 0 - - - - - Arial - 10 - - - - Qt::ScrollBarAlwaysOff - - - QAbstractScrollArea::AdjustToContentsOnFirstShow - - - QAbstractItemView::NoEditTriggers - - - true - - - false - - - false - - - 1 - - - false - - - 160 - - - 200 - - - - - - - - - - - - - - - - - - - 0 - 0 - 1200 - 25 - - - - - Tools - - - - - - - - - Help - - - - - - - - - - - - - - - - - - History... - - - - - Save Profile... - - - - - Exit and Keep - - - - - Exit - - - - - Vulkan Info - - - - - Vulkan Installation Analysis - - - - - About Vulkan Configurator - - - - - Vulkan Configurator Readme - - - - - Test Environment... - - - - - User-Defined Layers Paths... - - - - - API Dump... - - - - - Create Custom Profile.. - - - - - Reset To Default - - - - - Vulkan Specification - - - - - Vulkan Layer Specification - - - - - Vulkan GPU Info Reports - - - - - Vulkan Configurator Changelog - - - - - Find More Layers! - - - - - - diff --git a/vkconfig/resources.qrc b/vkconfig/resources.qrc deleted file mode 100644 index 08a828c071..0000000000 --- a/vkconfig/resources.qrc +++ /dev/null @@ -1,82 +0,0 @@ - - - resourcefiles/lunarg_logo.png - resourcefiles/qt_logo.png - resourcefiles/vulkan.ico - resourcefiles/vkconfig-off.png - resourcefiles/vkconfig-on.png - - - - ../vkconfig_core/configurations/2.2.2/API dump.json - ../vkconfig_core/configurations/2.2.2/Frame Capture.json - ../vkconfig_core/configurations/2.2.2/Portability.json - ../vkconfig_core/configurations/2.2.2/Synchronization.json - ../vkconfig_core/configurations/2.2.2/Validation.json - ../vkconfig_core/configurations/2.2.2/Crash Diagnostic.json - - - - ../vkconfig_core/layers/layers_schema.json - ../vkconfig_core/layers/validusage.json - - - - ../vkconfig_core/test/VK_LAYER_LUNARG_reference_1_2_1.json - - - - ../vkconfig_core/layers/130/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/130/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/130/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/130/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/135/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/135/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/135/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/135/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/141/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/148/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/154/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/162/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/170/VK_LAYER_KHRONOS_synchronization2.json - ../vkconfig_core/layers/170/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_screenshot.json - - diff --git a/vkconfig/settings_tree.cpp b/vkconfig/settings_tree.cpp deleted file mode 100644 index 2a6d7cd98c..0000000000 --- a/vkconfig/settings_tree.cpp +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "configurator.h" -#include "settings_tree.h" - -#include "widget_setting.h" -#include "widget_setting_int.h" -#include "widget_setting_float.h" -#include "widget_setting_frames.h" -#include "widget_setting_bool.h" -#include "widget_setting_enum.h" -#include "widget_setting_string.h" -#include "widget_setting_flags.h" -#include "widget_setting_filesystem.h" -#include "widget_setting_list_element.h" -#include "widget_setting_list.h" - -#include "../vkconfig_core/alert.h" -#include "../vkconfig_core/version.h" -#include "../vkconfig_core/platform.h" -#include "../vkconfig_core/util.h" - -#include -#include -#include -#include -#include - -#include - -static const char *TOOLTIP_ORDER = - "Layers are executed between the Vulkan application and driver in the specific order represented here"; - -SettingsTreeManager::SettingsTreeManager() : launched_application(false), tree(nullptr) {} - -void SettingsTreeManager::CreateGUI(QTreeWidget *build_tree) { - assert(build_tree); - - // Do this first to make absolutely sure if these is an old configuration still active it's state gets saved. - CleanupGUI(); - - Configurator &configurator = Configurator::Get(); - - this->tree = build_tree; - - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - if (configuration == nullptr) { - return; - } - - this->tree->blockSignals(true); - this->tree->clear(); - - QFont font_layer = this->tree->font(); - font_layer.setBold(true); - - QFont font_section = this->tree->font(); - font_section.setItalic(true); - - if (!configuration->HasOverride()) { - QTreeWidgetItem *item = new QTreeWidgetItem(); - item->setText(0, "No overridden or excluded layer"); - item->setFont(0, font_section); - item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->tree->addTopLevelItem(item); - } else { - const std::size_t overridden_layer_count = CountOverriddenLayers(configuration->parameters); - - if (overridden_layer_count > 1) { - QTreeWidgetItem *item = new QTreeWidgetItem(); - item->setText(0, "Vulkan Applications"); - item->setToolTip(0, TOOLTIP_ORDER); - item->setTextAlignment(0, Qt::AlignCenter); - item->setFont(0, font_section); - item->setDisabled(true); - this->tree->addTopLevelItem(item); - } - - // There will be one top level item for each layer - for (std::size_t i = 0, n = configuration->parameters.size(); i < n; ++i) { - Parameter ¶meter = configuration->parameters[i]; - if (!IsPlatformSupported(parameter.platform_flags)) continue; - - if (parameter.state != LAYER_STATE_OVERRIDDEN) continue; - - const std::vector &selected_layers = configurator.layers.selected_layers; - const Layer *layer = FindByKey(selected_layers, parameter.key.c_str()); - - QTreeWidgetItem *layer_item = new QTreeWidgetItem(); - this->tree->addTopLevelItem(layer_item); - - std::string layer_text = parameter.key; - if (layer == nullptr) { - layer_text += " (Missing)"; - } else if (layer->status != STATUS_STABLE) { - layer_text += std::string(" (") + GetToken(layer->status) + ")"; - } - - layer_item->setToolTip(0, parameter.key.c_str()); // Hack for the context menu to find the layer - layer_item->setText(0, layer_text.c_str()); - layer_item->setFont(0, font_layer); - layer_item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - if (layer != nullptr) layer_item->setToolTip(0, layer->description.c_str()); - layer_item->setExpanded(true); - - if (layer == nullptr) continue; - - // Handle the case were we get off easy. No settings. - if (parameter.settings.empty()) { - QTreeWidgetItem *layer_child_item = new QTreeWidgetItem(); - layer_child_item->setText(0, "No User Settings"); - layer_item->addChild(layer_child_item); - continue; - } - - if (!layer->presets.empty()) { - QTreeWidgetItem *presets_item = new QTreeWidgetItem(); - layer_item->addChild(presets_item); - WidgetPreset *presets_combobox = new WidgetPreset(this->tree, presets_item, *layer, parameter); - this->connect(presets_combobox, SIGNAL(itemChanged()), this, SLOT(OnPresetChanged())); - } - - if (UseBuiltinValidationSettings(parameter)) { - BuildValidationTree(layer_item, parameter); - } else { - BuildGenericTree(layer_item, parameter); - } - } - - if (overridden_layer_count > 1) { - QTreeWidgetItem *item = new QTreeWidgetItem(); - item->setText(0, "Vulkan Drivers"); - item->setToolTip(0, TOOLTIP_ORDER); - item->setTextAlignment(0, Qt::AlignCenter); - item->setFont(0, font_section); - item->setDisabled(true); - this->tree->addTopLevelItem(item); - } - - const std::size_t excluded_layer_count = - CountExcludedLayers(configuration->parameters, configurator.layers.selected_layers); - - if (excluded_layer_count > 0) { - // The last item is just the excluded layers - QTreeWidgetItem *excluded_layers = new QTreeWidgetItem(); - this->tree->addTopLevelItem(excluded_layers); - excluded_layers->setText(0, "Excluded Layers:"); - excluded_layers->setToolTip(0, "The following layers won't be executed."); - excluded_layers->setFont(0, font_section); - excluded_layers->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - excluded_layers->setExpanded(true); - - for (std::size_t i = 0, n = configuration->parameters.size(); i < n; ++i) { - Parameter ¶meter = configuration->parameters[i]; - if (!IsPlatformSupported(parameter.platform_flags)) continue; - - if (parameter.state != LAYER_STATE_EXCLUDED) continue; - - const Layer *layer = FindByKey(configurator.layers.selected_layers, parameter.key.c_str()); - if (layer == nullptr) continue; // Do not display missing excluded layers - - QTreeWidgetItem *layer_item = new QTreeWidgetItem(); - layer_item->setText(0, parameter.key.c_str()); - layer_item->setFont(0, font_layer); - layer_item->setToolTip(0, layer->description.c_str()); - excluded_layers->addChild(layer_item); - } - - // None excluded layer were found - if (excluded_layers->childCount() == 0) { - QTreeWidgetItem *child = new QTreeWidgetItem(); - child->setText(0, "None"); - excluded_layers->addChild(child); - } - } - } - - this->connect(this->tree, SIGNAL(expanded(const QModelIndex)), this, SLOT(OnExpandedChanged(const QModelIndex))); - this->connect(this->tree, SIGNAL(collapsed(const QModelIndex)), this, SLOT(OnCollapsedChanged(const QModelIndex))); - - this->tree->resizeColumnToContents(0); - - if (!configuration->setting_tree_state.isEmpty()) { - this->SetTreeState(configuration->setting_tree_state, 0, this->tree->invisibleRootItem()); - } - - this->tree->blockSignals(false); -} - -void SettingsTreeManager::CleanupGUI() { - if (this->tree == nullptr) // Was not initialized - return; - - Configurator &configurator = Configurator::Get(); - - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - if (configuration != nullptr) { - configuration->setting_tree_state.clear(); - GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); - } - - this->validation.reset(); - - this->tree->clear(); - this->tree = nullptr; -} - -void SettingsTreeManager::OnExpandedChanged(const QModelIndex &index) { - (void)index; - - if (this->tree == nullptr) // Was not initialized - return; - - Configurator &configurator = Configurator::Get(); - - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - configuration->setting_tree_state.clear(); - GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); - - return; -} - -void SettingsTreeManager::OnCollapsedChanged(const QModelIndex &index) { - (void)index; - - if (this->tree == nullptr) // Was not initialized - return; - - Configurator &configurator = Configurator::Get(); - - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - configuration->setting_tree_state.clear(); - GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); - - return; -} - -void SettingsTreeManager::BuildValidationTree(QTreeWidgetItem *parent, Parameter ¶meter) { - Configurator &configurator = Configurator::Get(); - std::vector &selected_layers = configurator.layers.selected_layers; - Layer *validation_layer = FindByKey(selected_layers, "VK_LAYER_KHRONOS_validation"); - assert(validation_layer != nullptr); - - QTreeWidgetItem *validation_areas_item = new QTreeWidgetItem(); - parent->addChild(validation_areas_item); - - // This just finds the enables and disables - this->validation.reset( - new WidgetSettingValidation(this->tree, validation_areas_item, validation_layer->settings, parameter.settings)); - this->connect(this->validation.get(), SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - - SettingMetaSet &settings = validation_layer->settings; - for (std::size_t i = 0, n = settings.size(); i < n; ++i) { - this->BuildTreeItem(parent, parameter, *settings[i]); - } -} - -static bool IsBuiltinValidationSetting(const Parameter ¶meter, const std::string &key) { - if (parameter.key != "VK_LAYER_KHRONOS_validation") return false; - - std::vector keys; - keys.push_back("enables"); - keys.push_back("disables"); - - if (parameter.api_version.GetPatch() < 242) { - keys.push_back("printf_to_stdout"); - keys.push_back("printf_verbose"); - keys.push_back("printf_buffer_size"); - keys.push_back("gpuav_buffer_oob"); - keys.push_back("warn_on_robust_oob"); - keys.push_back("validate_draw_indirect"); - keys.push_back("vma_linear_output"); - keys.push_back("fine_grained_locking"); - } - - return IsStringFound(keys, key); -} - -void SettingsTreeManager::BuildTreeItem(QTreeWidgetItem *parent, Parameter ¶meter, const SettingMeta &meta_object) { - if (IsBuiltinValidationSetting(parameter, meta_object.key)) return; - if (!IsPlatformSupported(meta_object.platform_flags)) return; - if (meta_object.view == SETTING_VIEW_HIDDEN) return; - if (meta_object.view == SETTING_VIEW_ADVANCED && - !Configurator::Get().configurations.FindActiveConfiguration()->view_advanced_settings) - return; - - QTreeWidgetItem *item = new QTreeWidgetItem(); - item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - parent->addChild(item); - - switch (meta_object.type) { - case SETTING_GROUP: { - item->setText(0, meta_object.label.c_str()); - item->setToolTip(0, meta_object.description.c_str()); - item->setFont(0, tree->font()); - item->setExpanded(meta_object.expanded); - } break; - case SETTING_BOOL: - case SETTING_BOOL_NUMERIC_DEPRECATED: { - const SettingMetaBool &meta = static_cast(meta_object); - - WidgetSettingBool *widget = new WidgetSettingBool(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - case SETTING_INT: { - const SettingMetaInt &meta = static_cast(meta_object); - - WidgetSettingInt *widget = new WidgetSettingInt(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - case SETTING_FLOAT: { - const SettingMetaFloat &meta = static_cast(meta_object); - - WidgetSettingFloat *widget = new WidgetSettingFloat(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - case SETTING_FRAMES: { - const SettingMetaFrames &meta = static_cast(meta_object); - - WidgetSettingFrames *widget = new WidgetSettingFrames(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - case SETTING_SAVE_FILE: - case SETTING_LOAD_FILE: - case SETTING_SAVE_FOLDER: - case SETTING_LOAD_FOLDER: { - const SettingMetaFilesystem &meta = static_cast(meta_object); - - WidgetSettingFilesystem *widget = new WidgetSettingFilesystem(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - case SETTING_ENUM: { - const SettingMetaEnum &meta = static_cast(meta_object); - - WidgetSettingEnum *enum_widget = new WidgetSettingEnum(tree, item, meta, parameter.settings); - this->connect(enum_widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - - for (std::size_t i = 0, n = meta.enum_values.size(); i < n; ++i) { - const SettingEnumValue &value = meta.enum_values[i]; - - if (!IsPlatformSupported(value.platform_flags)) continue; - if (value.view == SETTING_VIEW_HIDDEN) continue; - - for (std::size_t i = 0, n = value.settings.size(); i < n; ++i) { - this->BuildTreeItem(item, parameter, *value.settings[i]); - } - } - } break; - - case SETTING_FLAGS: { - const SettingMetaFlags &meta = static_cast(meta_object); - - item->setText(0, meta.label.c_str()); - item->setToolTip(0, meta.description.c_str()); - item->setExpanded(meta.expanded); - - for (std::size_t i = 0, n = meta.enum_values.size(); i < n; ++i) { - const SettingEnumValue &value = meta.enum_values[i]; - - if (!IsPlatformSupported(value.platform_flags)) continue; - if (value.view == SETTING_VIEW_HIDDEN) continue; - - QTreeWidgetItem *child = new QTreeWidgetItem(); - item->addChild(child); - - WidgetSettingFlag *widget = new WidgetSettingFlag(tree, child, meta, parameter.settings, value.key.c_str()); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - - for (std::size_t j = 0, o = value.settings.size(); j < o; ++j) { - this->BuildTreeItem(child, parameter, *value.settings[j]); - } - } - } break; - - case SETTING_STRING: { - const SettingMetaString &meta = static_cast(meta_object); - - WidgetSettingString *widget = new WidgetSettingString(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - case SETTING_LIST: { - const SettingMetaList &meta = static_cast(meta_object); - - WidgetSettingList *widget = new WidgetSettingList(tree, item, meta, parameter.settings); - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } break; - - default: { - item->setText(0, "Unknown setting"); - assert(0); // Unknown setting - } break; - } - - for (std::size_t i = 0, n = meta_object.children.size(); i < n; ++i) { - this->BuildTreeItem(item, parameter, *meta_object.children[i]); - } -} - -void SettingsTreeManager::BuildGenericTree(QTreeWidgetItem *parent, Parameter ¶meter) { - std::vector &selected_layers = Configurator::Get().layers.selected_layers; - - const SettingMetaSet &settings = FindByKey(selected_layers, parameter.key.c_str())->settings; - for (std::size_t i = 0, n = settings.size(); i < n; ++i) { - this->BuildTreeItem(parent, parameter, *settings[i]); - } -} - -void SettingsTreeManager::GetTreeState(QByteArray &byte_array, QTreeWidgetItem *top_item) { - byte_array.push_back(top_item->isExpanded() ? '1' : '0'); - - for (int i = 0, n = top_item->childCount(); i < n; ++i) { - GetTreeState(byte_array, top_item->child(i)); - } -} - -int SettingsTreeManager::SetTreeState(QByteArray &byte_array, int index, QTreeWidgetItem *top_item) { - // We very well could run out, on initial run, expand everything - if (index > byte_array.length()) - top_item->setExpanded(true); - else { - top_item->setExpanded(byte_array[index++] == '1'); - } - - // Walk the children - if (top_item->childCount() != 0) { - for (int i = 0, n = top_item->childCount(); i < n; ++i) { - index = SetTreeState(byte_array, index, top_item->child(i)); - } - } - - return index; -} - -void SettingsTreeManager::OnPresetChanged() { this->Refresh(REFRESH_ENABLE_AND_STATE); } - -void SettingsTreeManager::OnSettingChanged() { this->Refresh(REFRESH_ENABLE_ONLY); } - -void SettingsTreeManager::Refresh(RefreshAreas refresh_areas) { - this->tree->blockSignals(true); - - QTreeWidgetItem *root_item = this->tree->invisibleRootItem(); - for (int i = 0, n = root_item->childCount(); i < n; ++i) { - this->RefreshItem(refresh_areas, root_item->child(i)); - } - - this->tree->blockSignals(false); - - if (this->launched_application) { - QSettings settings; - if (!settings.value(VKCONFIG_KEY_MESSAGE_NEED_APPLICATION_RESTART, false).toBool()) { - settings.setValue(VKCONFIG_KEY_MESSAGE_NEED_APPLICATION_RESTART, true); - - Alert::ConfiguratorRestart(); - } - } - - // Refresh layer configuration - Configurator &configurator = Configurator::Get(); - configurator.configurations.Configure(configurator.layers.selected_layers); -} - -void SettingsTreeManager::RefreshItem(RefreshAreas refresh_areas, QTreeWidgetItem *parent) { - QWidget *widget = this->tree->itemWidget(parent, 0); - if (widget != nullptr) { - WidgetSettingBase *widget_base = dynamic_cast(widget); - if (widget_base != nullptr) widget_base->Refresh(refresh_areas); - } - - for (int i = 0, n = parent->childCount(); i < n; ++i) { - QTreeWidgetItem *child = parent->child(i); - if (child == nullptr) continue; - - this->RefreshItem(refresh_areas, child); - } -} diff --git a/vkconfig/settings_tree.h b/vkconfig/settings_tree.h deleted file mode 100644 index 9979d53134..0000000000 --- a/vkconfig/settings_tree.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "settings_validation_areas.h" -#include "widget_setting_flags.h" -#include "widget_setting_filesystem.h" -#include "widget_preset.h" - -#include "../vkconfig_core/configuration.h" - -#include -#include - -#include -#include - -class SettingsTreeManager : QObject { - Q_OBJECT - public: - SettingsTreeManager(); - - bool launched_application; - - void CreateGUI(QTreeWidget *build_tree); - void CleanupGUI(); - - void GetTreeState(QByteArray &byte_array, QTreeWidgetItem *top_item); - int SetTreeState(QByteArray &byte_array, int index, QTreeWidgetItem *top_item); - - void Refresh(RefreshAreas refresh_areas); - - public Q_SLOTS: - void OnSettingChanged(); - void OnPresetChanged(); - void OnExpandedChanged(const QModelIndex &index); - void OnCollapsedChanged(const QModelIndex &index); - - private: - SettingsTreeManager(const SettingsTreeManager &) = delete; - SettingsTreeManager &operator=(const SettingsTreeManager &) = delete; - - void BuildValidationTree(QTreeWidgetItem *parent, Parameter ¶meter); - void BuildGenericTree(QTreeWidgetItem *parent, Parameter ¶meter); - void BuildTreeItem(QTreeWidgetItem *parent, Parameter ¶meter, const SettingMeta &meta); - - void RefreshItem(RefreshAreas refresh_areas, QTreeWidgetItem *parent); - - QTreeWidget *tree; - std::unique_ptr validation; -}; diff --git a/vkconfig/settings_validation_areas.cpp b/vkconfig/settings_validation_areas.cpp deleted file mode 100644 index f5e35a7799..0000000000 --- a/vkconfig/settings_validation_areas.cpp +++ /dev/null @@ -1,977 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting.h" -#include "settings_validation_areas.h" -#include "configurator.h" - -#include "../vkconfig_core/version.h" -#include "../vkconfig_core/platform.h" -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/setting_bool.h" - -#include -#include - -static const char *TOKEN_CORE = "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT"; -static const char *TOKEN_CORE_LAYOUT = "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION"; -static const char *TOKEN_CORE_CMD = "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE"; -static const char *TOKEN_CORE_OBJECT = "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE"; -static const char *TOKEN_CORE_QUERY = "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION"; -static const char *TOKEN_CORE_DESC = "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET"; -static const char *TOKEN_CORE_SHADER = "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT"; -static const char *TOKEN_CORE_PUSH = "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE"; -static const char *TOKEN_CORE_CACHING = "VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT"; - -static const char *TOKEN_MISC_THREAD = "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT"; -static const char *TOKEN_MISC_UNIQUE = "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT"; -static const char *TOKEN_MISC_LIFETIMES = "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT"; -static const char *TOKEN_MISC_PARAM = "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT"; - -static const char *TOKEN_SHADER_GPU = "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT"; -static const char *TOKEN_SHADER_GPU_RESERVE = "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT"; -static const char *TOKEN_SHADER_PRINTF = "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT"; - -static const char *TOKEN_SYNC = "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT"; -static const char *TOKEN_SYNC_QUEUE_SUBMIT = "VALIDATION_CHECK_ENABLE_SYNCHRONIZATION_VALIDATION_QUEUE_SUBMIT"; - -static const char *TOKEN_BEST = "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT"; -static const char *TOKEN_BEST_ARM = "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM"; -static const char *TOKEN_BEST_AMD = "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_AMD"; -static const char *TOKEN_BEST_IMG = "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_IMG"; -static const char *TOKEN_BEST_NVIDIA = "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_NVIDIA"; - -QCheckBox *WidgetSettingValidation::CreateWidget(QTreeWidgetItem *parent, QTreeWidgetItem **item, const char *key, - const char *flag) { - const SettingEnumValue *value = this->GetMetaFlag(key, flag); - - if (!IsSupported(value)) { - return nullptr; - } - - const std::string status = value->status == STATUS_STABLE ? "" : std::string(" (") + GetToken(value->status) + ")"; - - *item = new QTreeWidgetItem(); - (*item)->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - parent->addChild(*item); - (*item)->setExpanded(true); - - QCheckBox *widget = new QCheckBox(this); - widget->setText((value->label + status).c_str()); - widget->setToolTip(value->description.c_str()); - this->tree->setItemWidget(*item, 0, widget); - return widget; -} - -WidgetSettingValidation::WidgetSettingValidation(QTreeWidget *tree, QTreeWidgetItem *item, const SettingMetaSet &meta_set, - SettingDataSet &data_set) - : WidgetSettingBase(tree, item), - item_core(nullptr), - widget_core(nullptr), - item_core_layout(nullptr), - widget_core_layout(nullptr), - item_core_command(nullptr), - widget_core_cmd(nullptr), - item_core_object(nullptr), - widget_core_object(nullptr), - item_core_query(nullptr), - widget_core_query(nullptr), - item_core_desc(nullptr), - widget_core_desc(nullptr), - item_core_shader(nullptr), - widget_core_shader(nullptr), - item_core_push(nullptr), - widget_core_push(nullptr), - item_misc_thread(nullptr), - widget_misc_thread(nullptr), - item_misc_unique(nullptr), - widget_misc_unique(nullptr), - item_misc_lifetimes(nullptr), - widget_misc_lifetimes(nullptr), - item_misc_param(nullptr), - widget_misc_param(nullptr), - - item_shader(nullptr), - widget_shader(nullptr), - item_shader_gpu(nullptr), - widget_shader_gpu(nullptr), - item_shader_gpu_reserve(nullptr), - widget_shader_gpu_reserve(nullptr), - item_shader_gpu_oob(nullptr), - widget_shader_gpu_oob(nullptr), - item_shader_gpu_robust_oob(nullptr), - widget_shader_gpu_robust_oob(nullptr), - item_shader_gpu_desc_indexing(nullptr), - widget_shader_gpu_desc_indexing(nullptr), - item_shader_gpu_indirect(nullptr), - widget_shader_gpu_indirect(nullptr), - item_shader_dispatch_indirect(nullptr), - widget_shader_dispatch_indirect(nullptr), - item_shader_gpu_vma_linear_output(nullptr), - widget_shader_gpu_vma_linear_output(nullptr), - item_shader_printf(nullptr), - widget_shader_printf(nullptr), - - item_shader_printf_to_stdout(nullptr), - widget_shader_printf_to_stdout(nullptr), - item_shader_printf_verbose(nullptr), - widget_shader_printf_verbose(nullptr), - item_shader_printf_size(nullptr), - widget_debug_printf_size(nullptr), - - item_sync(nullptr), - widget_sync(nullptr), - item_sync_queue_submit(nullptr), - widget_sync_queue_submit(nullptr), - item_best(nullptr), - widget_best(nullptr), - item_best_arm(nullptr), - widget_best_arm(nullptr), - item_best_amd(nullptr), - widget_best_amd(nullptr), - item_best_img(nullptr), - widget_best_img(nullptr), - item_best_nvidia(nullptr), - widget_best_nvidia(nullptr), - - meta_set(meta_set), - data_set(data_set) { - assert(FindSetting(meta_set, "enables") != nullptr); - assert(FindSetting(meta_set, "disables") != nullptr); - assert(FindSetting(data_set, "enables") != nullptr); - assert(FindSetting(data_set, "disables") != nullptr); - - this->item->setText(0, "Validation Areas"); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(false); - - // Core - this->widget_core = this->CreateWidget(this->item, &this->item_core, "disables", TOKEN_CORE); - if (this->widget_core != nullptr) { - this->connect(this->widget_core, SIGNAL(clicked(bool)), this, SLOT(OnCoreChecked(bool))); - - Configurator &configurator = Configurator::Get(); - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - - if (configuration->view_advanced_settings) { - this->widget_core_layout = this->CreateWidget(this->item_core, &this->item_core_layout, "disables", TOKEN_CORE_LAYOUT); - if (this->widget_core_layout != nullptr) - this->connect(this->widget_core_layout, SIGNAL(clicked(bool)), this, SLOT(OnCoreLayoutChecked(bool))); - - this->widget_core_cmd = this->CreateWidget(this->item_core, &this->item_core_command, "disables", TOKEN_CORE_CMD); - if (this->widget_core_cmd != nullptr) - this->connect(this->widget_core_cmd, SIGNAL(clicked(bool)), this, SLOT(OnCoreCommandChecked(bool))); - - this->widget_core_object = this->CreateWidget(this->item_core, &this->item_core_object, "disables", TOKEN_CORE_OBJECT); - if (this->widget_core_object != nullptr) - this->connect(this->widget_core_object, SIGNAL(clicked(bool)), this, SLOT(OnCoreObjectChecked(bool))); - - this->widget_core_query = this->CreateWidget(this->item_core, &this->item_core_query, "disables", TOKEN_CORE_QUERY); - if (this->widget_core_query != nullptr) - this->connect(this->widget_core_query, SIGNAL(clicked(bool)), this, SLOT(OnCoreQueryChecked(bool))); - - this->widget_core_desc = this->CreateWidget(this->item_core, &this->item_core_desc, "disables", TOKEN_CORE_DESC); - if (this->widget_core_desc != nullptr) - this->connect(this->widget_core_desc, SIGNAL(clicked(bool)), this, SLOT(OnCoreDescChecked(bool))); - - this->widget_core_shader = this->CreateWidget(this->item_core, &this->item_core_shader, "disables", TOKEN_CORE_SHADER); - if (this->widget_core_shader != nullptr) { - this->connect(this->widget_core_shader, SIGNAL(clicked(bool)), this, SLOT(OnCoreShaderChecked(bool))); - - this->widget_core_caching = - this->CreateWidget(this->item_core_shader, &this->item_core_caching, "disables", TOKEN_CORE_CACHING); - if (this->widget_core_caching != nullptr) - this->connect(this->widget_core_caching, SIGNAL(clicked(bool)), this, SLOT(OnCoreCachingChecked(bool))); - } - - this->widget_core_push = this->CreateWidget(this->item_core, &this->item_core_push, "disables", TOKEN_CORE_PUSH); - if (this->widget_core_push != nullptr) - this->connect(this->widget_core_push, SIGNAL(clicked(bool)), this, SLOT(OnCorePushChecked(bool))); - } - } - - // Misc: VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT - this->widget_misc_thread = this->CreateWidget(this->item, &this->item_misc_thread, "disables", TOKEN_MISC_THREAD); - if (this->widget_misc_thread != nullptr) - this->connect(this->widget_misc_thread, SIGNAL(clicked(bool)), this, SLOT(OnMiscThreadChecked(bool))); - - // Misc: VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT - this->widget_misc_unique = this->CreateWidget(this->item, &this->item_misc_unique, "disables", TOKEN_MISC_UNIQUE); - if (this->widget_misc_unique != nullptr) - this->connect(this->widget_misc_unique, SIGNAL(clicked(bool)), this, SLOT(OnMiscUniqueChecked(bool))); - - // Misc: VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT - this->widget_misc_lifetimes = this->CreateWidget(this->item, &this->item_misc_lifetimes, "disables", TOKEN_MISC_LIFETIMES); - if (this->widget_misc_lifetimes != nullptr) - this->connect(this->widget_misc_lifetimes, SIGNAL(clicked(bool)), this, SLOT(OnMiscLifetimesChecked(bool))); - - // Misc: VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT - this->widget_misc_param = this->CreateWidget(this->item, &this->item_misc_param, "disables", TOKEN_MISC_PARAM); - if (this->widget_misc_param != nullptr) - this->connect(this->widget_misc_param, SIGNAL(clicked(bool)), this, SLOT(OnMiscParamChecked(bool))); - - // Shader-based - { - const SettingEnumValue *value_gpu = GetMetaFlag("enables", TOKEN_SHADER_GPU); - const SettingEnumValue *value_printf = GetMetaFlag("enables", TOKEN_SHADER_PRINTF); - if (IsSupported(value_gpu) && IsSupported(value_printf)) { - this->item_shader = new QTreeWidgetItem(); - this->item_shader->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->addChild(this->item_shader); - - this->widget_shader = new QCheckBox(this); - this->widget_shader->setText("Shader-Based"); - this->tree->setItemWidget(this->item_shader, 0, this->widget_shader); - this->connect(this->widget_shader, SIGNAL(clicked(bool)), this, SLOT(OnShaderBasedChecked(bool))); - - this->item_shader_gpu = new QTreeWidgetItem(); - this->item_shader_gpu->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader->addChild(this->item_shader_gpu); - this->item_shader->setExpanded(true); - this->item_shader_gpu->setExpanded(true); - - this->widget_shader_gpu = new QRadioButton(this); - this->widget_shader_gpu->setText(value_gpu->label.c_str()); - this->widget_shader_gpu->setToolTip(value_gpu->description.c_str()); - this->tree->setItemWidget(this->item_shader_gpu, 0, this->widget_shader_gpu); - this->connect(this->widget_shader_gpu, SIGNAL(toggled(bool)), this, SLOT(OnShaderGPUChecked(bool))); - - this->widget_shader_gpu_reserve = - this->CreateWidget(this->item_shader_gpu, &this->item_shader_gpu_reserve, "enables", TOKEN_SHADER_GPU_RESERVE); - - if (this->widget_shader_gpu_reserve != nullptr) - this->connect(this->widget_shader_gpu_reserve, SIGNAL(clicked(bool)), this, SLOT(OnShaderGPUReserveChecked(bool))); - - { - const SettingMetaBool *value = FindSetting(meta_set, "gpuav_descriptor_indexing"); - if (IsSupported(value)) { - this->item_shader_gpu_desc_indexing = new QTreeWidgetItem(); - this->item_shader_gpu_desc_indexing->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_gpu->addChild(this->item_shader_gpu_desc_indexing); - this->item_shader_gpu->setExpanded(true); - - this->widget_shader_gpu_desc_indexing = new QCheckBox(this); - this->widget_shader_gpu_desc_indexing->setText(value->label.c_str()); - this->widget_shader_gpu_desc_indexing->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_gpu_desc_indexing, 0, this->widget_shader_gpu_desc_indexing); - this->connect(this->widget_shader_gpu_desc_indexing, SIGNAL(clicked(bool)), this, - SLOT(OnShaderGPUDescIndexingChecked(bool))); - } - } - - { - const SettingMetaBool *value = FindSetting(meta_set, "gpuav_buffer_oob"); - if (IsSupported(value)) { - this->item_shader_gpu_oob = new QTreeWidgetItem(); - this->item_shader_gpu_oob->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_gpu->addChild(this->item_shader_gpu_oob); - this->item_shader_gpu->setExpanded(true); - - this->widget_shader_gpu_oob = new QCheckBox(this); - this->widget_shader_gpu_oob->setText(value->label.c_str()); - this->widget_shader_gpu_oob->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_gpu_oob, 0, this->widget_shader_gpu_oob); - this->connect(this->widget_shader_gpu_oob, SIGNAL(clicked(bool)), this, SLOT(OnShaderGPUOOBChecked(bool))); - - { - const SettingMetaBool *value = FindSetting(meta_set, "warn_on_robust_oob"); - if (IsSupported(value)) { - this->item_shader_gpu_robust_oob = new QTreeWidgetItem(); - this->item_shader_gpu_robust_oob->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_gpu_oob->addChild(this->item_shader_gpu_robust_oob); - this->item_shader_gpu_oob->setExpanded(true); - - this->widget_shader_gpu_robust_oob = new QCheckBox(this); - this->widget_shader_gpu_robust_oob->setText(value->label.c_str()); - this->widget_shader_gpu_robust_oob->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_gpu_robust_oob, 0, this->widget_shader_gpu_robust_oob); - this->connect(this->widget_shader_gpu_robust_oob, SIGNAL(clicked(bool)), this, - SLOT(OnShaderGPURobustOOBChecked(bool))); - } - } - } - } - - { - const SettingMetaBool *value = FindSetting(meta_set, "validate_draw_indirect"); - if (IsSupported(value)) { - this->item_shader_gpu_indirect = new QTreeWidgetItem(); - this->item_shader_gpu_indirect->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_gpu->addChild(this->item_shader_gpu_indirect); - this->item_shader_gpu->setExpanded(true); - - this->widget_shader_gpu_indirect = new QCheckBox(this); - this->widget_shader_gpu_indirect->setText(value->label.c_str()); - this->widget_shader_gpu_indirect->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_gpu_indirect, 0, this->widget_shader_gpu_indirect); - this->connect(this->widget_shader_gpu_indirect, SIGNAL(clicked(bool)), this, - SLOT(OnShaderGPUIndirectChecked(bool))); - } - } - - { - const SettingMetaBool *value = FindSetting(meta_set, "validate_dispatch_indirect"); - if (IsSupported(value)) { - this->item_shader_dispatch_indirect = new QTreeWidgetItem(); - this->item_shader_dispatch_indirect->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_gpu->addChild(this->item_shader_dispatch_indirect); - this->item_shader_gpu->setExpanded(true); - - this->widget_shader_dispatch_indirect = new QCheckBox(this); - this->widget_shader_dispatch_indirect->setText(value->label.c_str()); - this->widget_shader_dispatch_indirect->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_dispatch_indirect, 0, this->widget_shader_dispatch_indirect); - this->connect(this->widget_shader_dispatch_indirect, SIGNAL(clicked(bool)), this, - SLOT(OnShaderDispatchIndirectChecked(bool))); - } - } - - { - const SettingMetaBool *value = FindSetting(meta_set, "vma_linear_output"); - if (IsSupported(value)) { - this->item_shader_gpu_vma_linear_output = new QTreeWidgetItem(); - this->item_shader_gpu_vma_linear_output->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_gpu->addChild(this->item_shader_gpu_vma_linear_output); - this->item_shader_gpu->setExpanded(true); - - this->widget_shader_gpu_vma_linear_output = new QCheckBox(this); - this->widget_shader_gpu_vma_linear_output->setText(value->label.c_str()); - this->widget_shader_gpu_vma_linear_output->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_gpu_vma_linear_output, 0, - this->widget_shader_gpu_vma_linear_output); - this->connect(this->widget_shader_gpu_vma_linear_output, SIGNAL(clicked(bool)), this, - SLOT(OnShaderGPUVMALinearOutput(bool))); - } - } - - this->item_shader_printf = new QTreeWidgetItem(); - this->item_shader_printf->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader->addChild(this->item_shader_printf); - this->item_shader->setExpanded(true); - this->item_shader_printf->setExpanded(true); - - this->widget_shader_printf = new QRadioButton(this); - this->widget_shader_printf->setText(value_printf->label.c_str()); - this->widget_shader_printf->setToolTip(value_printf->description.c_str()); - this->tree->setItemWidget(this->item_shader_printf, 0, this->widget_shader_printf); - this->connect(this->widget_shader_printf, SIGNAL(toggled(bool)), this, SLOT(OnShaderPrintfChecked(bool))); - - { - const SettingMetaBool *value = FindSetting(meta_set, "printf_to_stdout"); - if (IsSupported(value)) { - this->item_shader_printf_to_stdout = new QTreeWidgetItem(); - this->item_shader_printf_to_stdout->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_printf->addChild(this->item_shader_printf_to_stdout); - this->item_shader_printf->setExpanded(true); - - this->widget_shader_printf_to_stdout = new QCheckBox(this); - this->widget_shader_printf_to_stdout->setText(value->label.c_str()); - this->widget_shader_printf_to_stdout->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_printf_to_stdout, 0, this->widget_shader_printf_to_stdout); - this->connect(this->widget_shader_printf_to_stdout, SIGNAL(clicked(bool)), this, - SLOT(OnShaderPrintfStdoutChecked(bool))); - } - } - - { - const SettingMetaBool *value = FindSetting(meta_set, "printf_verbose"); - if (IsSupported(value)) { - this->item_shader_printf_verbose = new QTreeWidgetItem(); - this->item_shader_printf_verbose->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_shader_printf->addChild(this->item_shader_printf_verbose); - this->item_shader_printf->setExpanded(true); - - this->widget_shader_printf_verbose = new QCheckBox(this); - this->widget_shader_printf_verbose->setText(value->label.c_str()); - this->widget_shader_printf_verbose->setToolTip(value->description.c_str()); - this->tree->setItemWidget(this->item_shader_printf_verbose, 0, this->widget_shader_printf_verbose); - this->connect(this->widget_shader_printf_verbose, SIGNAL(clicked(bool)), this, - SLOT(OnShaderPrintfVerboseChecked(bool))); - } - } - - { - const SettingMetaInt *value = FindSetting(meta_set, "printf_buffer_size"); - if (IsSupported(value)) { - this->item_shader_printf_size = new QTreeWidgetItem(); - this->item_shader_printf->addChild(this->item_shader_printf_size); - this->item_shader_printf->setExpanded(true); - - this->widget_debug_printf_size = new WidgetSettingInt(tree, this->item_shader_printf_size, *value, data_set); - this->connect(this->widget_debug_printf_size, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - } - } - } else if (IsSupported(value_gpu)) { - this->widget_shader = this->CreateWidget(this->item, &this->item_shader, "enables", TOKEN_SHADER_GPU); - this->connect(this->widget_shader, SIGNAL(clicked(bool)), this, SLOT(OnShaderGPUChecked(bool))); - - this->widget_shader_gpu_reserve = - this->CreateWidget(this->item_shader, &this->item_shader_gpu_reserve, "enables", TOKEN_SHADER_GPU_RESERVE); - if (this->widget_shader_gpu_reserve != nullptr) - this->connect(this->widget_shader_gpu_reserve, SIGNAL(clicked(bool)), this, SLOT(OnShaderGPUReserveChecked(bool))); - } - } - - // Synchronization - this->widget_sync = this->CreateWidget(this->item, &this->item_sync, "enables", TOKEN_SYNC); - if (this->widget_sync != nullptr) { - this->connect(this->widget_sync, SIGNAL(clicked(bool)), this, SLOT(OnSyncChecked(bool))); - - this->widget_sync_queue_submit = - this->CreateWidget(this->item_sync, &this->item_sync_queue_submit, "enables", TOKEN_SYNC_QUEUE_SUBMIT); - if (this->widget_sync_queue_submit != nullptr) - this->connect(this->widget_sync_queue_submit, SIGNAL(clicked(bool)), this, SLOT(OnSyncQueueSubmitChecked(bool))); - } - - // Best Practices - this->widget_best = this->CreateWidget(this->item, &this->item_best, "enables", TOKEN_BEST); - if (this->widget_best != nullptr) { - this->connect(this->widget_best, SIGNAL(clicked(bool)), this, SLOT(OnBestChecked(bool))); - - this->widget_best_amd = this->CreateWidget(this->item_best, &this->item_best_amd, "enables", TOKEN_BEST_AMD); - if (this->widget_best_amd != nullptr) - this->connect(this->widget_best_amd, SIGNAL(clicked(bool)), this, SLOT(OnBestAmdChecked(bool))); - - this->widget_best_arm = this->CreateWidget(this->item_best, &this->item_best_arm, "enables", TOKEN_BEST_ARM); - if (this->widget_best_arm != nullptr) - this->connect(this->widget_best_arm, SIGNAL(clicked(bool)), this, SLOT(OnBestArmChecked(bool))); - - this->widget_best_img = this->CreateWidget(this->item_best, &this->item_best_img, "enables", TOKEN_BEST_IMG); - if (this->widget_best_img != nullptr) - this->connect(this->widget_best_img, SIGNAL(clicked(bool)), this, SLOT(OnBestImgChecked(bool))); - - this->widget_best_nvidia = this->CreateWidget(this->item_best, &this->item_best_nvidia, "enables", TOKEN_BEST_NVIDIA); - if (this->widget_best_nvidia != nullptr) - this->connect(this->widget_best_nvidia, SIGNAL(clicked(bool)), this, SLOT(OnBestNvidiaChecked(bool))); - } - - this->tree->setItemWidget(this->item, 0, this); - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingValidation::OnCoreChecked(bool checked) { - if (checked && !CheckOverhead(OVERHEAD_CORE)) { - this->widget_core->setChecked(false); - return; - } - - if (!checked) - this->UpdateFlag("disables", TOKEN_CORE, true); - else { - this->UpdateFlag("disables", TOKEN_CORE, false); - this->UpdateFlag("disables", TOKEN_CORE_LAYOUT, false); - this->UpdateFlag("disables", TOKEN_CORE_CMD, false); - this->UpdateFlag("disables", TOKEN_CORE_OBJECT, false); - this->UpdateFlag("disables", TOKEN_CORE_QUERY, false); - this->UpdateFlag("disables", TOKEN_CORE_DESC, false); - this->UpdateFlag("disables", TOKEN_CORE_SHADER, false); - this->UpdateFlag("disables", TOKEN_CORE_PUSH, false); - this->UpdateFlag("disables", TOKEN_CORE_CACHING, false); - } - - if (widget_core_layout != nullptr) { - widget_core_layout->setChecked(!HasDataFlag("disables", TOKEN_CORE_LAYOUT)); - } - if (widget_core_cmd != nullptr) { - widget_core_cmd->setChecked(!HasDataFlag("disables", TOKEN_CORE_CMD)); - } - if (widget_core_object != nullptr) { - widget_core_object->setChecked(!HasDataFlag("disables", TOKEN_CORE_OBJECT)); - } - if (widget_core_query != nullptr) { - widget_core_query->setChecked(!HasDataFlag("disables", TOKEN_CORE_QUERY)); - } - if (widget_core_desc != nullptr) { - widget_core_desc->setChecked(!HasDataFlag("disables", TOKEN_CORE_DESC)); - } - if (widget_core_shader != nullptr) { - widget_core_shader->setChecked(!HasDataFlag("disables", TOKEN_CORE_SHADER)); - if (widget_core_caching != nullptr) { - widget_core_caching->setChecked(!HasDataFlag("disables", TOKEN_CORE_CACHING)); - } - } - if (widget_core_push != nullptr) { - widget_core_push->setChecked(!HasDataFlag("disables", TOKEN_CORE_PUSH)); - } - - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreLayoutChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_LAYOUT, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreCommandChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_CMD, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreObjectChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_OBJECT, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreQueryChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_QUERY, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreDescChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_DESC, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreShaderChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_SHADER, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCorePushChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_PUSH, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnCoreCachingChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_CORE_CACHING, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnMiscThreadChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_MISC_THREAD, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnMiscUniqueChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_MISC_UNIQUE, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnMiscLifetimesChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_MISC_LIFETIMES, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnMiscParamChecked(bool checked) { - this->UpdateFlag("disables", TOKEN_MISC_PARAM, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderBasedChecked(bool checked) { - if (checked && !CheckOverhead(OVERHEAD_SHADER)) { - this->widget_shader->setChecked(false); - return; - } - - if (!checked) { - this->UpdateFlag("enables", TOKEN_SHADER_GPU, false); - this->UpdateFlag("enables", TOKEN_SHADER_PRINTF, false); - } else if (this->widget_shader_printf->isChecked()) { - this->UpdateFlag("enables", TOKEN_SHADER_GPU, false); - this->UpdateFlag("enables", TOKEN_SHADER_PRINTF, true); - } else { - if (!this->widget_shader_gpu->isChecked()) this->widget_shader_gpu->setChecked(true); - this->UpdateFlag("enables", TOKEN_SHADER_GPU, true); - this->UpdateFlag("enables", TOKEN_SHADER_PRINTF, false); - } - - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPUChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_SHADER_GPU, checked); - this->UpdateFlag("enables", TOKEN_SHADER_PRINTF, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPUReserveChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_SHADER_GPU_RESERVE, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPUDescIndexingChecked(bool checked) { - static_cast(FindSetting(this->data_set, "gpuav_descriptor_indexing"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPUOOBChecked(bool checked) { - static_cast(FindSetting(this->data_set, "gpuav_buffer_oob"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPURobustOOBChecked(bool checked) { - static_cast(FindSetting(this->data_set, "warn_on_robust_oob"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPUIndirectChecked(bool checked) { - static_cast(FindSetting(this->data_set, "validate_draw_indirect"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderDispatchIndirectChecked(bool checked) { - static_cast(FindSetting(this->data_set, "validate_dispatch_indirect"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderGPUVMALinearOutput(bool checked) { - static_cast(FindSetting(this->data_set, "vma_linear_output"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderPrintfChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_SHADER_PRINTF, checked); - this->UpdateFlag("enables", TOKEN_SHADER_GPU, !checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderPrintfStdoutChecked(bool checked) { - static_cast(FindSetting(this->data_set, "printf_to_stdout"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnShaderPrintfVerboseChecked(bool checked) { - static_cast(FindSetting(this->data_set, "printf_verbose"))->value = checked; - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnSyncChecked(bool checked) { - if (checked && !CheckOverhead(OVERHEAD_SYNC)) { - this->widget_sync->setChecked(false); - return; - } - - this->UpdateFlag("enables", TOKEN_SYNC, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnSyncQueueSubmitChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_SYNC_QUEUE_SUBMIT, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnBestChecked(bool checked) { - if (checked && !CheckOverhead(OVERHEAD_BEST)) { - this->widget_best->setChecked(false); - return; - } - - this->UpdateFlag("enables", TOKEN_BEST, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnBestArmChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_BEST_ARM, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnBestAmdChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_BEST_AMD, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnBestImgChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_BEST_IMG, checked); - this->OnSettingChanged(); -} - -void WidgetSettingValidation::OnBestNvidiaChecked(bool checked) { - this->UpdateFlag("enables", TOKEN_BEST_NVIDIA, checked); - this->OnSettingChanged(); -} - -bool WidgetSettingValidation::CheckOverhead(Overhead candidate) const { - QSettings settings; - if (settings.value("VKCONFIG_WARN_CORE_SHADER_IGNORE").toBool() == false) { - const bool features_to_run_alone[] = { - this->widget_core != nullptr ? this->widget_core->isChecked() || candidate == OVERHEAD_CORE : false, - this->widget_shader != nullptr ? this->widget_shader->isChecked() || candidate == OVERHEAD_SHADER : false, - this->widget_sync != nullptr ? this->widget_sync->isChecked() || candidate == OVERHEAD_SYNC : false, - this->widget_best != nullptr ? this->widget_best->isChecked() || candidate == OVERHEAD_BEST : false}; - - static const char *LABELS[]{ - "Core Validation", // OVERHEAD_CORE - "Shader Based Validation", // OVERHEAD_SHADER - "Synchronization Validation", // OVERHEAD_SYNC - "Best Practices Warnings" // OVERHEAD_BEST - }; - static_assert(countof(LABELS) == OVERHEAD_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - int count_enabled_features = 0; - for (std::size_t i = 0, n = countof(features_to_run_alone); i < n; ++i) - count_enabled_features += features_to_run_alone[i] ? 1 : 0; - - if (count_enabled_features > 1) { - QMessageBox alert(this->tree); - alert.setWindowTitle("High Validation Layer Overhead"); - alert.setText(format("Using %s, %s, %s and %s simultanously results in high performance degradation.", - LABELS[OVERHEAD_CORE], LABELS[OVERHEAD_SHADER], LABELS[OVERHEAD_SYNC], LABELS[OVERHEAD_BEST]) - .c_str()); - alert.setInformativeText(format("Do you want to add %s anyway?", LABELS[candidate]).c_str()); - alert.setIcon(QMessageBox::Warning); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setCheckBox(new QCheckBox("Do not show again.")); - const bool result = alert.exec() == QMessageBox::Yes; - if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WARN_CORE_SHADER_IGNORE", true); - } - return result; - } - } - - return true; -} - -void WidgetSettingValidation::OnSettingChanged() { emit itemChanged(); } - -void WidgetSettingValidation::UpdateFlag(const char *key, const char *flag, bool append) { - SettingDataFlags *data = static_cast(FindSetting(this->data_set, key)); - assert(data != nullptr); - - if (append) { - AppendString(data->value, flag); - } else { - RemoveString(data->value, flag); - } -} - -bool WidgetSettingValidation::HasDataBool(const char *key) const { - return static_cast(FindSetting(this->data_set, key))->value; -} - -bool WidgetSettingValidation::HasDataFlag(const char *key, const char *flag) const { - const SettingDataFlags *data = static_cast(FindSetting(this->data_set, key)); - - return IsStringFound(data->value, flag); -} - -const SettingEnumValue *WidgetSettingValidation::GetMetaFlag(const char *key, const char *flag) const { - return FindByKey(static_cast(FindSetting(this->meta_set, key))->enum_values, flag); -} - -void WidgetSettingValidation::Refresh(RefreshAreas refresh_areas) { - const bool core_enabled = !HasDataFlag("disables", TOKEN_CORE); - - if (this->widget_core != nullptr) { - this->widget_core->setChecked(core_enabled); - } - - if (this->widget_core_layout != nullptr) { - this->widget_core_layout->setEnabled(core_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_core_layout->setChecked(!HasDataFlag("disables", TOKEN_CORE_LAYOUT)); - } - - if (this->widget_core_cmd != nullptr) { - this->widget_core_cmd->setEnabled(core_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) this->widget_core_cmd->setChecked(!HasDataFlag("disables", TOKEN_CORE_CMD)); - } - - if (this->widget_core_object != nullptr) { - this->widget_core_object->setEnabled(core_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_core_object->setChecked(!HasDataFlag("disables", TOKEN_CORE_OBJECT)); - } - - if (this->widget_core_query != nullptr) { - this->widget_core_query->setEnabled(core_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_core_query->setChecked(!HasDataFlag("disables", TOKEN_CORE_QUERY)); - } - - if (this->widget_core_desc != nullptr) { - this->widget_core_desc->setEnabled(core_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_core_desc->setChecked(!HasDataFlag("disables", TOKEN_CORE_DESC)); - } - - if (this->widget_core_shader != nullptr) { - this->widget_core_shader->setEnabled(core_enabled); - - const bool shader_enabled = !HasDataFlag("disables", TOKEN_CORE_SHADER); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) this->widget_core_shader->setChecked(shader_enabled); - - if (this->widget_core_caching != nullptr) { - this->widget_core_caching->setEnabled(core_enabled && shader_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_core_caching->setChecked(!HasDataFlag("disables", TOKEN_CORE_CACHING)); - } - } - - if (this->widget_core_push != nullptr) { - this->widget_core_push->setEnabled(core_enabled); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_core_push->setChecked(!HasDataFlag("disables", TOKEN_CORE_PUSH)); - } - - if (this->widget_misc_thread != nullptr && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_misc_thread->setChecked(!HasDataFlag("disables", TOKEN_MISC_THREAD)); - } - - if (this->widget_misc_unique != nullptr && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_misc_unique->setChecked(!HasDataFlag("disables", TOKEN_MISC_UNIQUE)); - } - - if (this->widget_misc_lifetimes != nullptr && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_misc_lifetimes->setChecked(!HasDataFlag("disables", TOKEN_MISC_LIFETIMES)); - } - - if (this->widget_misc_param != nullptr && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_misc_param->setChecked(!HasDataFlag("disables", TOKEN_MISC_PARAM)); - } - - if (this->widget_shader != nullptr) { - const bool shader_gpu = HasDataFlag("enables", TOKEN_SHADER_GPU); - const bool shader_printf = HasDataFlag("enables", TOKEN_SHADER_PRINTF); - - if (GetMetaFlag("enables", TOKEN_SHADER_GPU) != nullptr && GetMetaFlag("enables", TOKEN_SHADER_PRINTF) != nullptr) { - const bool shader_enabled = this->widget_shader->isChecked() || shader_gpu || shader_printf; - if (shader_enabled && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_shader->setChecked(shader_gpu || shader_printf); - } - - if (this->widget_shader_gpu != nullptr) { - this->widget_shader_gpu->setEnabled(this->widget_shader->isChecked()); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) this->widget_shader_gpu->setChecked(shader_gpu); - } - - if (this->widget_shader_gpu_reserve != nullptr) { - this->widget_shader_gpu_reserve->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_reserve->setChecked(this->HasDataFlag("enables", TOKEN_SHADER_GPU_RESERVE)); - } - - if (this->widget_shader_gpu_desc_indexing != nullptr) { - this->widget_shader_gpu_desc_indexing->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_desc_indexing->setChecked(this->HasDataBool("gpuav_descriptor_indexing")); - } - - if (this->widget_shader_gpu_oob != nullptr) { - this->widget_shader_gpu_oob->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_oob->setChecked(this->HasDataBool("gpuav_buffer_oob")); - - if (this->widget_shader_gpu_robust_oob != nullptr) { - this->widget_shader_gpu_robust_oob->setEnabled(shader_gpu && this->HasDataBool("gpuav_buffer_oob")); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_robust_oob->setChecked(this->HasDataBool("warn_on_robust_oob")); - } - } - - if (this->widget_shader_gpu_indirect != nullptr) { - this->widget_shader_gpu_indirect->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_indirect->setChecked(this->HasDataBool("validate_draw_indirect")); - } - - if (this->widget_shader_dispatch_indirect != nullptr) { - this->widget_shader_dispatch_indirect->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_dispatch_indirect->setChecked(this->HasDataBool("validate_dispatch_indirect")); - } - - if (this->widget_shader_gpu_vma_linear_output != nullptr) { - this->widget_shader_gpu_vma_linear_output->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_vma_linear_output->setChecked(this->HasDataBool("vma_linear_output")); - } - - if (this->widget_shader_printf != nullptr) { - this->widget_shader_printf->setEnabled(this->widget_shader->isChecked()); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) this->widget_shader_printf->setChecked(shader_printf); - } - - if (this->widget_shader_printf_to_stdout != nullptr) { - this->widget_shader_printf_to_stdout->setEnabled(shader_printf); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_printf_to_stdout->setChecked(this->HasDataBool("printf_to_stdout")); - } - - if (this->widget_shader_printf_verbose != nullptr) { - this->widget_shader_printf_verbose->setEnabled(shader_printf); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_printf_verbose->setChecked(this->HasDataBool("printf_verbose")); - } - - if (this->widget_debug_printf_size != nullptr) { - this->widget_debug_printf_size->setEnabled(shader_printf); - } - } else if (GetMetaFlag("enables", TOKEN_SHADER_GPU) != nullptr) { - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_shader->setChecked(HasDataFlag("enables", TOKEN_SHADER_GPU)); - } - - if (this->widget_shader_gpu_reserve != nullptr) { - this->widget_shader_gpu_reserve->setEnabled(shader_gpu); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) - this->widget_shader_gpu_reserve->setChecked(HasDataFlag("enables", TOKEN_SHADER_GPU)); - } - } - } - - if (this->widget_sync != nullptr && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_sync->setChecked(HasDataFlag("enables", TOKEN_SYNC)); - } - - if (this->widget_sync_queue_submit != nullptr) { - this->widget_sync_queue_submit->setEnabled(HasDataFlag("enables", TOKEN_SYNC)); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_sync_queue_submit->setChecked(HasDataFlag("enables", TOKEN_SYNC_QUEUE_SUBMIT)); - } - } - - if (this->widget_best != nullptr && refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_best->setChecked(HasDataFlag("enables", TOKEN_BEST)); - } - - if (this->widget_best_arm != nullptr) { - this->widget_best_arm->setEnabled(HasDataFlag("enables", TOKEN_BEST)); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_best_arm->setChecked(HasDataFlag("enables", TOKEN_BEST_ARM)); - } - } - - if (this->widget_best_amd != nullptr) { - this->widget_best_amd->setEnabled(HasDataFlag("enables", TOKEN_BEST)); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_best_amd->setChecked(HasDataFlag("enables", TOKEN_BEST_AMD)); - } - } - - if (this->widget_best_img != nullptr) { - this->widget_best_img->setEnabled(HasDataFlag("enables", TOKEN_BEST)); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_best_img->setChecked(HasDataFlag("enables", TOKEN_BEST_IMG)); - } - } - - if (this->widget_best_nvidia != nullptr) { - this->widget_best_nvidia->setEnabled(HasDataFlag("enables", TOKEN_BEST)); - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - this->widget_best_nvidia->setChecked(HasDataFlag("enables", TOKEN_BEST_NVIDIA)); - } - } - - this->blockSignals(false); -} diff --git a/vkconfig/settings_validation_areas.h b/vkconfig/settings_validation_areas.h deleted file mode 100644 index c621e562ce..0000000000 --- a/vkconfig/settings_validation_areas.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/layer.h" - -#include "widget_setting_int.h" -#include "widget_setting_flags.h" - -#include "widget_setting.h" -#include -#include - -#include - -class WidgetSettingValidation : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetSettingValidation(QTreeWidget *tree, QTreeWidgetItem *item, const SettingMetaSet &meta_set, - SettingDataSet &data_set); - - void Refresh(RefreshAreas refresh_areas) override; - - private: - QTreeWidgetItem *item_core; - QCheckBox *widget_core; - - QTreeWidgetItem *item_core_layout; - QCheckBox *widget_core_layout; - - QTreeWidgetItem *item_core_command; - QCheckBox *widget_core_cmd; - - QTreeWidgetItem *item_core_object; - QCheckBox *widget_core_object; - - QTreeWidgetItem *item_core_query; - QCheckBox *widget_core_query; - - QTreeWidgetItem *item_core_desc; - QCheckBox *widget_core_desc; - - QTreeWidgetItem *item_core_shader; - QCheckBox *widget_core_shader; - - QTreeWidgetItem *item_core_push; - QCheckBox *widget_core_push; - - QTreeWidgetItem *item_core_caching; - QCheckBox *widget_core_caching; - - QTreeWidgetItem *item_misc_thread; - QCheckBox *widget_misc_thread; - - QTreeWidgetItem *item_misc_unique; - QCheckBox *widget_misc_unique; - - QTreeWidgetItem *item_misc_lifetimes; - QCheckBox *widget_misc_lifetimes; - - QTreeWidgetItem *item_misc_param; - QCheckBox *widget_misc_param; - - QTreeWidgetItem *item_shader; - QCheckBox *widget_shader; - - QTreeWidgetItem *item_shader_gpu; - QRadioButton *widget_shader_gpu; - - QTreeWidgetItem *item_shader_gpu_reserve; - QCheckBox *widget_shader_gpu_reserve; - - QTreeWidgetItem *item_shader_gpu_oob; - QCheckBox *widget_shader_gpu_oob; - - QTreeWidgetItem *item_shader_gpu_robust_oob; - QCheckBox *widget_shader_gpu_robust_oob; - - QTreeWidgetItem *item_shader_gpu_desc_indexing; - QCheckBox *widget_shader_gpu_desc_indexing; - - QTreeWidgetItem *item_shader_gpu_indirect; - QCheckBox *widget_shader_gpu_indirect; - - QTreeWidgetItem *item_shader_dispatch_indirect; - QCheckBox *widget_shader_dispatch_indirect; - - QTreeWidgetItem *item_shader_gpu_vma_linear_output; - QCheckBox *widget_shader_gpu_vma_linear_output; - - QTreeWidgetItem *item_shader_printf; - QRadioButton *widget_shader_printf; - - QTreeWidgetItem *item_shader_printf_to_stdout; - QCheckBox *widget_shader_printf_to_stdout; - - QTreeWidgetItem *item_shader_printf_verbose; - QCheckBox *widget_shader_printf_verbose; - - QTreeWidgetItem *item_shader_printf_size; - WidgetSettingInt *widget_debug_printf_size; - - QTreeWidgetItem *item_sync; - QCheckBox *widget_sync; - - QTreeWidgetItem *item_sync_queue_submit; - QCheckBox *widget_sync_queue_submit; - - QTreeWidgetItem *item_best; - QCheckBox *widget_best; - - QTreeWidgetItem *item_best_arm; - QCheckBox *widget_best_arm; - - QTreeWidgetItem *item_best_amd; - QCheckBox *widget_best_amd; - - QTreeWidgetItem *item_best_img; - QCheckBox *widget_best_img; - - QTreeWidgetItem *item_best_nvidia; - QCheckBox *widget_best_nvidia; - - QCheckBox *CreateWidget(QTreeWidgetItem *parent, QTreeWidgetItem **item, const char *key, const char *flag); - - public Q_SLOTS: - void OnCoreChecked(bool checked); - - void OnCoreLayoutChecked(bool checked); - void OnCoreCommandChecked(bool checked); - void OnCoreObjectChecked(bool checked); - void OnCoreQueryChecked(bool checked); - void OnCoreDescChecked(bool checked); - void OnCoreShaderChecked(bool checked); - void OnCorePushChecked(bool checked); - void OnCoreCachingChecked(bool checked); - - void OnMiscThreadChecked(bool checked); - void OnMiscUniqueChecked(bool checked); - void OnMiscLifetimesChecked(bool checked); - void OnMiscParamChecked(bool checked); - - void OnShaderBasedChecked(bool checked); - - void OnShaderGPUChecked(bool checked); - void OnShaderGPUReserveChecked(bool checked); - void OnShaderGPUDescIndexingChecked(bool checked); - void OnShaderGPUOOBChecked(bool checked); - void OnShaderGPURobustOOBChecked(bool checked); - void OnShaderGPUIndirectChecked(bool checked); - void OnShaderDispatchIndirectChecked(bool checked); - void OnShaderGPUVMALinearOutput(bool checked); - - void OnShaderPrintfChecked(bool checked); - void OnShaderPrintfStdoutChecked(bool checked); - void OnShaderPrintfVerboseChecked(bool checked); - - void OnSyncChecked(bool checked); - void OnSyncQueueSubmitChecked(bool checked); - - void OnBestChecked(bool checked); - void OnBestArmChecked(bool checked); - void OnBestAmdChecked(bool checked); - void OnBestImgChecked(bool checked); - void OnBestNvidiaChecked(bool checked); - - void OnSettingChanged(); - - Q_SIGNALS: - void itemChanged(); - - private: - WidgetSettingValidation(const WidgetSettingValidation &) = delete; - WidgetSettingValidation &operator=(const WidgetSettingValidation &) = delete; - - enum Overhead { - OVERHEAD_CORE = 0, - OVERHEAD_SHADER, - OVERHEAD_SYNC, - OVERHEAD_BEST, - - OVERHEAD_FIRST = OVERHEAD_CORE, - OVERHEAD_LAST = OVERHEAD_BEST, - }; - - enum { OVERHEAD_COUNT = OVERHEAD_LAST - OVERHEAD_FIRST + 1 }; - - bool CheckOverhead(Overhead candidate) const; - - void UpdateFlag(const char *key, const char *flag, bool append); - bool HasDataBool(const char *key) const; - bool HasDataFlag(const char *key, const char *flag) const; - const SettingEnumValue *GetMetaFlag(const char *key, const char *flag) const; - - const SettingMetaSet &meta_set; - SettingDataSet &data_set; -}; diff --git a/vkconfig/vkconfig.pro b/vkconfig/vkconfig.pro deleted file mode 100644 index d116c1d1f8..0000000000 --- a/vkconfig/vkconfig.pro +++ /dev/null @@ -1,203 +0,0 @@ -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets network - -CONFIG += c++11 -CONFIG += sdk_no_version_check - -INCLUDEPATH += ../external/Vulkan-Headers/include -INCLUDEPATH += ../Vulkan-Headers/include - -# Ignore JSON validation -DEFINES += JSON_VALIDATION_OFF - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -DEFINES += WIN32_LEAN_AND_MEAN - -DEFINES += NOMINMAX - -Release: DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT - -linux: QMAKE_CXXFLAGS += -Wunused-variable - -SOURCES += \ - ../vkconfig_core/alert.cpp \ - ../vkconfig_core/application.cpp \ - ../vkconfig_core/application_singleton.cpp \ - ../vkconfig_core/command_line.cpp \ - ../vkconfig_core/configuration.cpp \ - ../vkconfig_core/configuration_manager.cpp \ - ../vkconfig_core/doc.cpp \ - ../vkconfig_core/date.cpp \ - ../vkconfig_core/environment.cpp \ - ../vkconfig_core/header.cpp \ - ../vkconfig_core/help.cpp \ - ../vkconfig_core/json.cpp \ - ../vkconfig_core/json_validator.cpp \ - ../vkconfig_core/layer.cpp \ - ../vkconfig_core/layer_manager.cpp \ - ../vkconfig_core/layer_preset.cpp \ - ../vkconfig_core/layer_state.cpp \ - ../vkconfig_core/layer_type.cpp \ - ../vkconfig_core/override.cpp \ - ../vkconfig_core/parameter.cpp \ - ../vkconfig_core/path.cpp \ - ../vkconfig_core/path_manager.cpp \ - ../vkconfig_core/platform.cpp \ - ../vkconfig_core/registry.cpp \ - ../vkconfig_core/setting.cpp \ - ../vkconfig_core/setting_bool.cpp \ - ../vkconfig_core/setting_filesystem.cpp \ - ../vkconfig_core/setting_flags.cpp \ - ../vkconfig_core/setting_float.cpp \ - ../vkconfig_core/setting_frames.cpp \ - ../vkconfig_core/setting_group.cpp \ - ../vkconfig_core/setting_int.cpp \ - ../vkconfig_core/setting_list.cpp \ - ../vkconfig_core/setting_string.cpp \ - ../vkconfig_core/util.cpp \ - ../vkconfig_core/version.cpp \ - vulkan_util.cpp \ - widget_preset.cpp \ - widget_setting.cpp \ - widget_setting_bool.cpp \ - widget_setting_enum.cpp \ - widget_setting_filesystem.cpp \ - widget_setting_flags.cpp \ - widget_setting_float.cpp \ - widget_setting_int.cpp \ - widget_setting_frames.cpp \ - widget_setting_string.cpp \ - widget_setting_list_element.cpp \ - widget_setting_list.cpp \ - widget_tree_friendly_combobox.cpp \ - dialog_about.cpp \ - dialog_applications.cpp \ - dialog_layers.cpp \ - dialog_vulkan_analysis.cpp \ - dialog_vulkan_info.cpp \ - main.cpp \ - main_gui.cpp \ - main_signal.cpp \ - main_reset.cpp \ - main_layers.cpp \ - main_doc.cpp \ - mainwindow.cpp \ - settings_tree.cpp \ - settings_validation_areas.cpp \ - configurator.cpp - -HEADERS += \ - ../vkconfig_core/alert.h \ - ../vkconfig_core/application.h \ - ../vkconfig_core/application_singleton.h \ - ../vkconfig_core/command_line.h \ - ../vkconfig_core/configuration.h \ - ../vkconfig_core/configuration_manager.h \ - ../vkconfig_core/doc.h \ - ../vkconfig_core/date.h \ - ../vkconfig_core/environment.h \ - ../vkconfig_core/header.h \ - ../vkconfig_core/help.h \ - ../vkconfig_core/json.h \ - ../vkconfig_core/json_validator.h \ - ../vkconfig_core/layer.h \ - ../vkconfig_core/layer_manager.h \ - ../vkconfig_core/layer_preset.h \ - ../vkconfig_core/layer_state.h \ - ../vkconfig_core/layer_type.h \ - ../vkconfig_core/override.h \ - ../vkconfig_core/parameter.h \ - ../vkconfig_core/path.h \ - ../vkconfig_core/path_manager.h \ - ../vkconfig_core/platform.h \ - ../vkconfig_core/registry.h \ - ../vkconfig_core/setting.h \ - ../vkconfig_core/setting_bool.h \ - ../vkconfig_core/setting_filesystem.h \ - ../vkconfig_core/setting_flags.h \ - ../vkconfig_core/setting_float.h \ - ../vkconfig_core/setting_frames.h \ - ../vkconfig_core/setting_group.h \ - ../vkconfig_core/setting_int.h \ - ../vkconfig_core/setting_list.h \ - ../vkconfig_core/setting_string.h \ - ../vkconfig_core/util.h \ - ../vkconfig_core/version.h \ - vulkan_util.h \ - widget_preset.h \ - widget_setting.h \ - widget_setting_bool.h \ - widget_setting_enum.h \ - widget_setting_filesystem.h \ - widget_setting_flags.h \ - widget_setting_float.h \ - widget_setting_int.h \ - widget_setting_frames.h \ - widget_setting_string.h \ - widget_setting_list_element.h \ - widget_setting_list.h \ - widget_tree_friendly_combobox.h \ - dialog_about.h \ - dialog_applications.h \ - dialog_layers.h \ - dialog_vulkan_analysis.h \ - dialog_vulkan_info.h \ - main_gui.h \ - main_signal.h \ - main_reset.h \ - main_layers.h \ - main_doc.h \ - mainwindow.h \ - settings_validation_areas.h \ - settings_tree.h \ - configurator.h - -FORMS += \ - dialog_about.ui \ - dialog_applications.ui \ - dialog_layers.ui \ - dialog_vulkan_analysis.ui \ - dialog_vulkan_info.ui \ - mainwindow.ui - -TRANSLATIONS += \ - vkconfig_en_US.ts - - -win32: { - LIBS += Advapi32.lib - LIBS += Cfgmgr32.lib - LIBS += User32.lib - RC_ICONS = resourcefiles/vulkan.ico -} - -macx: { -#CONFIG += file_copies -#COPIES += shellScript -#shellScript.files = $$files(macOS/vkconfig.sh) -#shellScript.path = $$OUT_PWD/VkConfig.app/Contents/MacOS - -QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10 - -QMAKE_INFO_PLIST = macOS/Info.plist -RC_FILE = macOS/Resources/VulkanIcon.icns -} - -# Default rules for deployment. -qnx: target.path = /tmp/$${TARGET}/bin -else: unix:!android: target.path = /opt/$${TARGET}/bin -!isEmpty(target.path): INSTALLS += target - -RESOURCES += \ - resources.qrc diff --git a/vkconfig/widget_setting.cpp b/vkconfig/widget_setting.cpp deleted file mode 100644 index 4036caa5f1..0000000000 --- a/vkconfig/widget_setting.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "widget_setting.h" - -WidgetSettingBase::WidgetSettingBase(QTreeWidget* tree, QTreeWidgetItem* item) : tree(tree), item(item) { - assert(tree != nullptr); - assert(item != nullptr); -} - -void WidgetSettingBase::DisplayOverride(QWidget* widget, const SettingMeta& meta) const { - QCursor cursor = widget->cursor(); - cursor.setShape(Qt::WhatsThisCursor); - widget->setCursor(cursor); - - QPalette palette; - palette.setColor(QPalette::Active, QPalette::WindowText, QColor(255, 0, 0)); - palette.setColor(QPalette::Active, QPalette::Text, QColor(255, 0, 0)); - palette.setColor(QPalette::Inactive, QPalette::WindowText, QColor(255, 0, 0)); - palette.setColor(QPalette::Inactive, QPalette::Text, QColor(255, 0, 0)); - palette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(192, 128, 128)); - palette.setColor(QPalette::Disabled, QPalette::Text, QColor(192, 128, 128)); - - widget->setPalette(palette); - - const std::string tip = - format("Overridden by '%s' environment variable set to: '%s'", meta.env.c_str(), GetSettingOverride(meta).c_str()); - - widget->setToolTip(tip.c_str()); -} - -int HorizontalAdvance(const QFontMetrics& fm, const QString& string) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) - return fm.horizontalAdvance(string); -#else - return fm.width(string); -#endif -} - -std::string GetLabel(const SettingMeta& meta) { - if (meta.status == STATUS_STABLE) { - return meta.label; - } else { - return meta.label + " (" + GetToken(meta.status) + ")"; - } -} diff --git a/vkconfig/widget_setting_float.cpp b/vkconfig/widget_setting_float.cpp deleted file mode 100644 index 2cab7e00c1..0000000000 --- a/vkconfig/widget_setting_float.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "widget_setting_float.h" - -#include -#include -#include -#include - -#include - -static const int MIN_FIELD_WIDTH = 80; - -WidgetSettingFloat::WidgetSettingFloat(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFloat& meta, - SettingDataSet& data_set) - : WidgetSettingBase(tree, item), - meta(meta), - data_set(data_set), - field(new QLineEdit(this)), - timer_error(new QTimer(this)), - timer_valid(new QTimer(this)) { - const std::string unit = meta.unit.empty() ? "" : format(" (%s)", meta.unit.c_str()); - const std::string status = meta.status == STATUS_STABLE ? "" : std::string(" (") + GetToken(this->meta.status) + ")"; - - this->field->setFont(tree->font()); - this->field->setToolTip(format("[%f, %f]", meta.min_value, meta.max_value).c_str()); - this->field->setAlignment(Qt::AlignRight); - this->field->show(); - this->default_palette = this->field->palette(); - - this->connect(this->field, SIGNAL(textEdited(const QString&)), this, SLOT(OnTextEdited(const QString&))); - this->connect(this->timer_error, &QTimer::timeout, this, &WidgetSettingFloat::OnErrorValue); - this->connect(this->timer_valid, &QTimer::timeout, this, &WidgetSettingFloat::OnValidValue); - - this->item->setText(0, (this->meta.label + unit + status).c_str()); - this->item->setFont(0, this->tree->font()); - this->item->setToolTip(0, meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -WidgetSettingFloat::~WidgetSettingFloat() { - this->timer_error->stop(); - this->timer_valid->stop(); -} - -void WidgetSettingFloat::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - const std::string float_format = meta.GetFloatFormat(); - - this->field->blockSignals(true); - this->field->setText(format(float_format.c_str(), this->data().value).c_str()); - this->field->blockSignals(false); - } -} - -void WidgetSettingFloat::resizeEvent(QResizeEvent* event) { - this->resize = event->size(); - this->Resize(); -} - -void WidgetSettingFloat::OnErrorValue() { - QPalette palette; - palette.setColor(QPalette::Base, QColor(255, 192, 192)); - this->field->setPalette(palette); - - QSettings settings; - if (settings.value("VKCONFIG_WIDGET_SETTING_FLOAT").toBool() == false) { - const std::string float_format = this->meta.GetFloatFormat(); - const std::string info = format("Do you want to reset to the setting default value? '%s'", float_format.c_str()); - const std::string range = this->meta.HasRange() - ? format("Enter a number in the range [%s, %s].", float_format.c_str(), float_format.c_str()) - : std::string("Enter a floating point number."); - - std::string text; - switch (this->ProcessInputValue()) { - default: - case SETTING_INPUT_NO_ERROR: { - assert(0); - break; - } - case SETTING_INPUT_ERROR_EMPTY: { - text = format(("'%s' value is empty. " + range).c_str(), this->meta.label.c_str(), this->meta.min_value, - this->meta.max_value); - break; - } - case SETTING_INPUT_ERROR_SYNTAX: { - text = format(("'%s' value has invalid characters. " + range).c_str(), this->meta.label.c_str(), - this->meta.min_value, this->meta.max_value); - break; - } - case SETTING_INPUT_ERROR_SEMENTICS: { - text = format(("'%s' value is out of range. " + range).c_str(), this->meta.label.c_str(), this->meta.min_value, - this->meta.max_value); - break; - } - } - - QMessageBox alert; - alert.setWindowTitle(format("Invalid '%s' setting value", meta.label.c_str()).c_str()); - alert.setText(text.c_str()); - alert.setInformativeText(format(info.c_str(), this->meta.default_value).c_str()); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Critical); - alert.setCheckBox(new QCheckBox("Do not show again.")); - if (alert.exec() == QMessageBox::Yes) { - const std::string field_value = format(this->meta.GetFloatFormat().c_str(), this->meta.default_value); - - this->data().value = this->meta.default_value; - this->field->setText(field_value.c_str()); - this->field->setPalette(default_palette); - this->Resize(); - } - if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WIDGET_SETTING_FLOAT", true); - } - } - - this->timer_error->stop(); -} - -void WidgetSettingFloat::OnValidValue() { - emit itemChanged(); - - this->timer_valid->stop(); -} - -void WidgetSettingFloat::Resize() { - const QFontMetrics fm = this->field->fontMetrics(); - const int width = std::max(HorizontalAdvance(fm, this->field->text() + "00"), MIN_FIELD_WIDTH); - - const QRect button_rect = QRect(this->resize.width() - width, 0, width, this->resize.height()); - this->field->setGeometry(button_rect); -} - -SettingInputError WidgetSettingFloat::ProcessInputValue() { return this->data().ProcessInput(this->value_buffer); } - -void WidgetSettingFloat::OnTextEdited(const QString& new_value) { - this->timer_error->stop(); - this->timer_valid->stop(); - - this->value_buffer = new_value.toStdString(); - this->Resize(); - - if (this->ProcessInputValue() == SETTING_INPUT_NO_ERROR) { - this->field->setPalette(default_palette); - this->timer_valid->start(500); - } else { - this->timer_error->start(2000); - } - - emit itemChanged(); -} - -SettingDataFloat& WidgetSettingFloat::data() { - SettingDataFloat* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig/widget_setting_frames.cpp b/vkconfig/widget_setting_frames.cpp deleted file mode 100644 index b9276dd73d..0000000000 --- a/vkconfig/widget_setting_frames.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "widget_setting_frames.h" -#include "widget_setting.h" - -#include "../vkconfig_core/util.h" - -#include -#include -#include -#include - -#include - -static const int MIN_FIELD_WIDTH = 80; - -WidgetSettingFrames::WidgetSettingFrames(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFrames& meta, - SettingDataSet& data_set) - : WidgetSettingBase(tree, item), - meta(meta), - data_set(data_set), - field(new QLineEdit(this)), - timer_error(new QTimer(this)), - timer_valid(new QTimer(this)) { - this->field->setFont(tree->font()); - this->field->setToolTip("Use list of comma separated integer ranges. Example: '0-2,16'."); - this->field->setAlignment(Qt::AlignRight); - this->field->show(); - this->default_palette = this->field->palette(); - - this->connect(this->field, SIGNAL(textEdited(const QString&)), this, SLOT(OnTextEdited(const QString&))); - this->connect(this->timer_error, &QTimer::timeout, this, &WidgetSettingFrames::OnErrorValue); - this->connect(this->timer_valid, &QTimer::timeout, this, &WidgetSettingFrames::OnValidValue); - - this->item->setText(0, GetLabel(this->meta).c_str()); - this->item->setFont(0, this->tree->font()); - this->item->setToolTip(0, meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -WidgetSettingFrames::~WidgetSettingFrames() { - this->timer_error->stop(); - this->timer_valid->stop(); -} - -void WidgetSettingFrames::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->blockSignals(true); - this->field->setText(this->data().GetValue()); - this->field->blockSignals(false); - } -} - -void WidgetSettingFrames::resizeEvent(QResizeEvent* event) { - this->resize = event->size(); - this->Resize(); -} - -void WidgetSettingFrames::OnErrorValue() { - QPalette palette; - palette.setColor(QPalette::Base, QColor(255, 192, 192)); - this->field->setPalette(palette); - - QSettings settings; - if (settings.value("VKCONFIG_WIDGET_SETTING_FRAMES").toBool() == false) { - const std::string text = - format("The setting input '%s' is invalid. Use list of comma separated integer ranges. Example: '0-2,16'.", - this->data().GetValue()); - const std::string info = - format("Do you want to reset to the setting default value? '%s'", this->meta.default_value.c_str()); - - QMessageBox alert; - alert.setWindowTitle(format("Invalid '%s' setting value", meta.label.c_str()).c_str()); - alert.setText(text.c_str()); - alert.setInformativeText(info.c_str()); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Critical); - alert.setCheckBox(new QCheckBox("Do not show again.")); - if (alert.exec() == QMessageBox::Yes) { - this->data().SetValue(this->meta.default_value.c_str()); - this->field->setText(this->meta.default_value.c_str()); - this->field->setPalette(default_palette); - this->Resize(); - } - if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WIDGET_SETTING_FRAMES", true); - } - } - - this->timer_error->stop(); -} - -void WidgetSettingFrames::OnValidValue() { - emit itemChanged(); - - this->timer_valid->stop(); -} - -void WidgetSettingFrames::Resize() { - const QFontMetrics fm = this->field->fontMetrics(); - const int width = std::max(HorizontalAdvance(fm, this->field->text() + "00"), MIN_FIELD_WIDTH); - - const QRect button_rect = QRect(this->resize.width() - width, 0, width, this->resize.height()); - this->field->setGeometry(button_rect); -} - -SettingInputError WidgetSettingFrames::ProcessInputValue() { return this->data().ProcessInput(this->value_buffer); } - -void WidgetSettingFrames::OnTextEdited(const QString& new_value) { - this->timer_error->stop(); - this->timer_valid->stop(); - - this->value_buffer = new_value.toStdString(); - this->Resize(); - - if (this->ProcessInputValue() == SETTING_INPUT_NO_ERROR) { - this->field->setPalette(default_palette); - this->timer_valid->start(500); - } else { - this->timer_error->start(3000); - } - - emit itemChanged(); -} - -SettingDataFrames& WidgetSettingFrames::data() { - SettingDataFrames* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig/widget_setting_int.cpp b/vkconfig/widget_setting_int.cpp deleted file mode 100644 index 63603d1c02..0000000000 --- a/vkconfig/widget_setting_int.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "widget_setting_int.h" - -#include -#include -#include -#include - -#include - -static const int MIN_FIELD_WIDTH = 80; - -WidgetSettingInt::WidgetSettingInt(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaInt& meta, SettingDataSet& data_set) - : WidgetSettingBase(tree, item), - meta(meta), - data_set(data_set), - field(new QLineEdit(this)), - timer_error(new QTimer(this)), - timer_valid(new QTimer(this)) { - const std::string unit = meta.unit.empty() ? "" : format(" (%s)", meta.unit.c_str()); - const std::string status = meta.status == STATUS_STABLE ? "" : std::string(" (") + GetToken(this->meta.status) + ")"; - - this->field->setFont(tree->font()); - this->field->setToolTip(format("[%d, %d]", meta.min_value, meta.max_value).c_str()); - this->field->setAlignment(Qt::AlignRight); - this->field->show(); - this->default_palette = this->field->palette(); - - this->connect(this->field, SIGNAL(textEdited(const QString&)), this, SLOT(OnTextEdited(const QString&))); - this->connect(this->timer_error, &QTimer::timeout, this, &WidgetSettingInt::OnErrorValue); - this->connect(this->timer_valid, &QTimer::timeout, this, &WidgetSettingInt::OnValidValue); - - this->item->setText(0, (meta.label + unit + status).c_str()); - this->item->setFont(0, this->tree->font()); - this->item->setToolTip(0, meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -WidgetSettingInt::~WidgetSettingInt() { - this->timer_error->stop(); - this->timer_valid->stop(); -} - -void WidgetSettingInt::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->blockSignals(true); - this->field->setText(format("%d", this->data().value).c_str()); - this->field->blockSignals(false); - } -} - -void WidgetSettingInt::resizeEvent(QResizeEvent* event) { - this->resize = event->size(); - this->Resize(); -} - -void WidgetSettingInt::OnErrorValue() { - QPalette palette; - palette.setColor(QPalette::Base, QColor(255, 192, 192)); - this->field->setPalette(palette); - - QSettings settings; - if (settings.value("VKCONFIG_WIDGET_SETTING_INT").toBool() == false) { - const std::string info = format("Do you want to reset to the setting default value? '%d'", this->meta.default_value); - const std::string range = format("Enter a number in the range [%d, %d].", this->meta.min_value, this->meta.max_value); - - std::string text; - switch (this->ProcessInputValue()) { - default: - case SETTING_INPUT_NO_ERROR: { - assert(0); - break; - } - case SETTING_INPUT_ERROR_EMPTY: { - text = format("'%s' value is empty. %s", meta.label.c_str(), range.c_str()); - break; - } - case SETTING_INPUT_ERROR_SYNTAX: { - text = format("'%s' value has invalid characters. %s", meta.label.c_str(), range.c_str()); - break; - } - case SETTING_INPUT_ERROR_SEMENTICS: { - text = format("'%s' value is out of range. %s", meta.label.c_str(), range.c_str()); - break; - } - } - - QMessageBox alert; - alert.setWindowTitle(format("Invalid '%s' setting value", meta.label.c_str()).c_str()); - alert.setText(text.c_str()); - alert.setInformativeText(info.c_str()); - alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - alert.setDefaultButton(QMessageBox::Yes); - alert.setIcon(QMessageBox::Critical); - alert.setCheckBox(new QCheckBox("Do not show again.")); - if (alert.exec() == QMessageBox::Yes) { - this->data().value = this->meta.default_value; - this->field->setText(format("%d", this->meta.default_value).c_str()); - this->field->setPalette(default_palette); - this->Resize(); - } - if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WIDGET_SETTING_INT", true); - } - } - - this->timer_error->stop(); -} - -void WidgetSettingInt::OnValidValue() { - emit itemChanged(); - - this->timer_valid->stop(); -} - -void WidgetSettingInt::Resize() { - const QFontMetrics fm = this->field->fontMetrics(); - const int width = std::max(HorizontalAdvance(fm, this->field->text() + "00"), MIN_FIELD_WIDTH); - - const QRect button_rect = QRect(this->resize.width() - width, 0, width, this->resize.height()); - this->field->setGeometry(button_rect); -} - -SettingInputError WidgetSettingInt::ProcessInputValue() { return this->data().ProcessInput(this->value_buffer); } - -void WidgetSettingInt::OnTextEdited(const QString& new_value) { - this->timer_error->stop(); - this->timer_valid->stop(); - - this->value_buffer = new_value.toStdString(); - this->Resize(); - - if (this->ProcessInputValue() == SETTING_INPUT_NO_ERROR) { - this->field->setPalette(default_palette); - this->timer_valid->start(500); - } else { - this->timer_error->start(2000); - } - - emit itemChanged(); -} - -SettingDataInt& WidgetSettingInt::data() { - SettingDataInt* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig/widget_tree_friendly_combobox.cpp b/vkconfig/widget_tree_friendly_combobox.cpp deleted file mode 100644 index 6e9242158b..0000000000 --- a/vkconfig/widget_tree_friendly_combobox.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_tree_friendly_combobox.h" - -#include - -WidgetTreeFriendlyComboBox::WidgetTreeFriendlyComboBox(QTreeWidgetItem *item) : QComboBox(), item(item) { - assert(item); - - setFocusPolicy(Qt::StrongFocus); - - connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int))); -} - -void WidgetTreeFriendlyComboBox::indexChanged(int index) { emit selectionMade(item, index); } diff --git a/vkconfig/widget_tree_friendly_combobox.h b/vkconfig/widget_tree_friendly_combobox.h deleted file mode 100644 index 2afd18c57d..0000000000 --- a/vkconfig/widget_tree_friendly_combobox.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include -#include -#include - -class WidgetTreeFriendlyComboBox : public QComboBox { - Q_OBJECT - public: - WidgetTreeFriendlyComboBox(QTreeWidgetItem *item); - - void wheelEvent(QWheelEvent *e) { - if (hasFocus()) QComboBox::wheelEvent(e); - } - - public Q_SLOTS: - void indexChanged(int nIndex); - - Q_SIGNALS: - void selectionMade(QTreeWidgetItem *tree_item, int index); - - private: - WidgetTreeFriendlyComboBox(const WidgetTreeFriendlyComboBox &) = delete; - WidgetTreeFriendlyComboBox &operator=(const WidgetTreeFriendlyComboBox &) = delete; - - QTreeWidgetItem *item; -}; diff --git a/vkconfig3/CHANGELOG.md b/vkconfig3/CHANGELOG.md deleted file mode 100644 index ba55cfc8f5..0000000000 --- a/vkconfig3/CHANGELOG.md +++ /dev/null @@ -1,290 +0,0 @@ - -

LunarG

-

Copyright � 2015-2022 LunarG, Inc.

- -[![Creative Commons][3]][4] - -[3]: https://i.creativecommons.org/l/by-nd/4.0/88x31.png "Creative Commons License" -[4]: https://creativecommons.org/licenses/by-nd/4.0/ - -

- -# Release notes - -## [Vulkan Configurator 3.0.0](https://github.com/LunarG/VulkanTools/tree/main) - ??? 202? - -### Features: -- Redesign main window UI around tabs -- Add check box to disable all Vulkan Layers - -## [Vulkan Configurator 2.5.6](https://github.com/LunarG/VulkanTools/tree/main) - March 2024 - -### Fixes: -- Fix confusing synchronization built-in configuration - -## [Vulkan Configurator 2.5.5](https://github.com/LunarG/VulkanTools/tree/main) - January 2024 - -### Improvements: -- Add `LOAD_FOLDER` setting type - -### Fixes: -- Remove default settings values from built-in layer configurations -- Fix doc generator using default environment variable names - -## [Vulkan Configurator 2.5.4](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.250.0) - May 2023 - -### Improvements: -- Display `deviceUUID` and `driverUUID` in the "Development Status" when available for each physical device - -## [Vulkan Configurator 2.5.3](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.243.0) - March 2023 - -### Improvements: -- Enabling fully generic layer settings for the validation layer settings - -## [Vulkan Configurator 2.5.2](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.236.0) - December 2022 - -### Improvements: -- Add `warn_on_robust_oob` validation layer setting handling - -## [Vulkan Configurator 2.5.1](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.231.0) - October 2022 - -### Features: -- Add ENUM setting type children settings #1746 - -### Improvements: -- Allow disabling the validation layer settings built-in UI #1746 - -### Fixes: -- Fix override layer version when some layers are excluded or missing #1743 - -## [Vulkan Configurator 2.5.0](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.224.0) - August 2022 - -### Features: -- Add per layers-configuration user-defined layers paths #1711 - -### Improvements: -- Add reordering of configurations when renaming a configuration -- Improve handling of missing layers - -## [Vulkan Configurator 2.4.6](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.216.0) - June 2022 - -### Features: -- Add `VK_KHR_portability_enumeration` extension support - -### Improvements: -- Allow using multiple layers built with different Vulkan header version when Loader 212 or newer is installed on the system - -## [Vulkan Configurator 2.4.5](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.211.0) - April 2022 - -### Features: -- Add `VK_ADD_LAYER_PATH` Vulkan Loader variable handling -- Remove built-in support of `VK_LAYER_LUNARG_device_simulation` layer #1628 - - Use `VK_LAYER_KHRONOS_profiles` layer instead - -### Improvements: -- Improve the Portability built-in configuration to check only what's necessary, reducing validation overhead -- Refinement of the layers window UI design - -## [Vulkan Configurator 2.4.4](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.204.1) - March 2022 - -### Features: -- Add markdown documentation export -- Add `vk_layer_settings.txt` documentation export -- Add command line support of HTML, markdown and `vk_layer_settings.txt` documentation exports - -### Improvements: -- Add button to create a new layers configuration - -### Fixes: -- Fix layer presets that could be modified by accident #1653 -- Fix loading of profiles file from the UI #1653 - -## [Vulkan Configurator 2.4.3](https://github.com/LunarG/VulkanTools/tree/sdk-1.3.204.0) - February 2022 - -### Improvements: -- Upgrade the built-in "Portability" to use the Profiles layer -- Display the development status of a setting next to the setting label in the UI -- Display a warning when using multiple layers built with different Vulkan Header version - - It's a requirement by the Vulkan Loader - -### Fixes: -- Fix ANY dependence when using FLAGS setting type - -## [Vulkan Configurator 2.4.2](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.196.0) - November 2021 - -### Improvements: -- Discard applied layers configuration to ensure the layers never crash Vulkan Configurator - -### Fixes: -- Fix 'Edit Layers' button being enabled when there is no active configuration #1616 - -## [Vulkan Configurator 2.4.1](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.189.0) - September 2021 - -### Fixes: -- Fix user-defined layer settings not loaded, for older Vulkan API than 1.2.176 -- Fix settings written in 'vk_layer_settings.txt' even when the dependence is not met #1582 - -## [Vulkan Configurator 2.4.0](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.182.0) - July 2021 - -### Features: -- Add support for `VK_LAYER_SETTINGS_PATH` override for 'vk_layer_settings.txt' path -- Add 'vk_layer_settings.txt' path in the 'Vulkan Development Status' -- Add ${VK_LOCAL} and ${VK_APPDATA} built-in variables -- Add 'expanded' property to layer manifest settings and flags #1497 -- Add settings environment variables checking #1498 -- Add settings tree context menu #1501 -- Add layer generated user documentation #1510 -- Add build date in the title bar - -### Improvements: -- Add link to [Vulkan Guide layers](https://github.com/KhronosGroup/Vulkan-Guide/blob/main/chapters/development_tools.md#vulkan-layers) list within the help menu -- Update built-in VUIDs to the list included in SDK 1.2.176 #1511 -- Refactor the layer window to expose more layer documentation #1519 -- Add shader caching setting to validation built-in UI #1552 -- Add indirect parameter setting to validation built-in UI #1522 -- Improve user-defined paths dialog and workflow #1523 -- Improve UI labels #1551 - -### Fixes: -- Fix message box with no title displayed on macOS #1547 -- Hide excluded layers in configuration that are missing, these may not be supported on the platform #1551 -- Fix crash when renaming a configuration from the layers window #1551 -- Fix validation layer bool setting written in 'vk_layer-setting.txt' #1551 -- Fix upgrade of 'vkcube' path when the path is no longer valid - -## [Vulkan Configurator 2.3.0](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.176.0) - May 2021 - -### Features: -- Add Vulkan loader debug message to application launcher #1372 -- Redesigned of the full layer settings UI #1420 - -### Improvements: -- Add display of layer execution order in the setting tree #1390 -- Add layer settings UI inputs checking -- Add API dump presets #1414 -- Add validation layer VUIDs loading from Vulkan Header to keep it up to date #1434 -- Improve 'High Validation Layer Overhead' warning UI - -### Fixes: -- Hide 'Callback' from validation layer 'Debug Action' debug action that is NOOP -- Fix crash when SDK path is included in 'override_paths' of 'VkLayer_override.json' -- Fix default value of validation layer 'Check Out of Bounds #1435 -- Fix duplicate configurations #1445 -- Fix layer reordering crash #1449 -- Fix Vulkan application crash when updating the Vulkan loader -- Fix User-Defined layer path window 'Ok' button being disabled incorrectly -- Fix blank setting tree after using the user-defined layer path window #1377 -- Fix 'Reset To Default' than wasn't bringing back notification pop-ups -- Fix creating a new 'Configuration' can be cancelled - -## [Vulkan Configurator 2.2.0](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.170.0) - March 2021 - -### Features: -- Add *Synchronization* default configuration #1304 -- Add *Portability* default configuration on *macOS* #1307 -- Add per-configuration reset in layers configuration context menu -- Add per-configuration reset in layers window -- Expose `modify_extension_list` and `modify_memory_flags` settings from devsim - -### Improvements: -- Add display of `VK_LAYER_PATH` content in 'Vulkan Development Status' -- Rename 'Custom Path' by 'User-Defined Path' -- Add extension filters to load and save file layer settings #1317 -- Improve in application documentation of settings #1332 -- Display the layer status in the 'Vulkan Development Status' #1332 -- Refresh 'Vulkan Development Status' when the configuration changed #1366 -- Streamline 'configuration tree' UI usage #1370 -- Add 'Reload Default Configuration' to retrieve missing default configurations #1370 -- Add 'reset' command line argument to reset the platform layers configurations -- Add possible recovery by resetting to default when a crash happened during last run - -### Fixes: -- Fix export and import path being truncated when the path as '.' character -- Fix crash when loading a JSON file as if it's a JSON layer file but it's not #1330 -- Fix validation layer 'printf buffer size' setting exposed as a 'bool' instead of a 'int' #1338 -- Fix crash when using older `VK_LAYER_KHRONOS_validation` versions -- Fix *Vulkan Info* and *Vulkan Installation Analysis* dialog no longer running with overridden layers -- Fix preset changed causing the setting tree to be rebuild #1300 - -## [Vulkan Configurator 2.1.0](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.162.1) - January 2021 - -### Features: -- Refactor built-in configurations #1247 -- Add layer settings presets #1271 -- Add *Portability* default configuration on Linux and Windows #1279 - -### Improvements: -- In case of crash or user interruption, remove the layers override #1278 -- Improve layers support since version 1.1.130 -- Improve layer configurations compatibilities between versions -- Add more tool tips #1296 -- Display the 'Vulkan Development Status' each time the layers paths are changed - -### Fixes: -- Expose missing `VK_LAYER_LUNARG_gfxreconstruct` 'Log Detailed' setting - -## [Vulkan Configurator 2.0.3](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.162.0) - December 2020 - -### Features: -- Add command line arguments to manage layers override #1213 - -### Improvements: -- Test with *VS2015*, *VS2017* and *VS2019* -- Test with *Qt 5.9* and *Qt 5.15* including *QMake* build -- Test manually using a [use cases based template](https://docs.google.com/document/d/1z0WqfMp2IBko1fvDICkjDE_3JKnf8SrU5APQTqKRR-U/edit) - -### Fixes: -- Fix manual layers ordering #1214 -- Fix layers override update when changing layers management options #1225 -- Fix reset button in layers window #1227 -- Fix warning about old loader when trying to use application list #1230 -- Fix initialization of added applications on macOS #1249 - -## [Vulkan Configurator 2.0.2](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.154.0) - October 2020 - -### Features: -- Add multiple debug actions simultaneously #1119 -- Add better representation of the layers execution order #1181 - -### Improvements: -- Streamline and clean up GUI -- Add layers configuration description #1105 -- Add selected path from dialog window cache #1107 -- Add unit test framework #1100 -- Add button to browse working directory #1099 -- Add version in the title bar and show state #1109 -- Add default settings state in the layer configuration settings #1076 -- Make *Validation - Standard*, the default configuration #1076 -- Update `vkcube` to use the version from the same *Vulkan SDK* than *Vulkan Configurator* #1112 -- Expose `duplicate_message_limit` setting from `VK_LAYER_KHRONOS_validation` #1176 - -### Fixes: -- Fix disabled configurations that can't be reenabled or removed -- Fix display of custom layer paths #1101 -- Fix inconsistent display of separators in paths #1107 -- Fix display of empty entries in the custom path dialog when opening Json files that are not layer json files #1103 -- Fix log file default location to `HOME` to ensure write access #1083 -- Fix log file not written to #1109 -- Fix `debug_output` setting displayed on Linux and macOS but not available #1086 -- Fix `numeric_bool` setting display #1166 - -## [Vulkan Configurator 2.0.1](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.148.1) - August 2020 (revision 1) - -### Fixes: -- Fix *Shader Printf* built-in configuration that was setup for *GPU-Assisted* validation instead -- Fix layer configurations selection on Linux -- Fix debug output setting not working - -## [Vulkan Configurator 2.0.0](https://github.com/LunarG/VulkanTools/tree/sdk-1.2.148.0) - August 2020 - -### Features: -- Design GUI -- Add built-in Vulkan layers configurations -- Add user-defined Vulkan layers configurations -- Add import and export of Vulkan layers configuration -- Add `VK_LAYER_KHRONOS_validation` settings presets -- Add message filtering using VUID and message IDs -- Add an option to make layers overriding persistent on exit -- Add an option to override only a selected list of applications -- Add an application launcher -- Add startup Vulkan status diff --git a/vkconfig3/CONTRIBUTING.md b/vkconfig3/CONTRIBUTING.md deleted file mode 100644 index 4fbc92b651..0000000000 --- a/vkconfig3/CONTRIBUTING.md +++ /dev/null @@ -1,98 +0,0 @@ -# Contributing to Vulkan Configurator - -## Contributions Welcome - -The easiest method for contributing to *Vulkan Configurator* is to examine the [issues list](https://github.com/LunarG/VulkanTools/issues) and the [roadmap](https://github.com/LunarG/VulkanTools/projects/2) -and look for areas that are of interest. - -Furthermore: -- If you have your own work in mind, please open an issue to describe it and assign it to yourself. -- If you choose to work on an issue that is assigned, simply coordinate with the current assignee. - --------------- -## Building Vulkan Configurator - -It requires *[Qt 5](https://www.qt.io/download)* to be install and *Qt* `bin` directory to be added to the `PATH` environment variable. *Vulkan Configurator* is built as part of the [VulkanTools](https://github.com/LunarG/VulkanTools/blob/main/BUILD.md) using *CMake* build system or alternatively with `vkconfig.pro` using Qt Creator. - --------------- -## How to run Vulkan Configurator Unit Tests - -When submitting a PR, the unit tests will ran automatically. - -However, it's trivial and more effective to run the unit tests locally with the following commands: - -On Windows, from the build directory: -``` -ctest -C Debug --output-on-failure --parallel 16 -ctest -C Release --output-on-failure --parallel 16 -``` - -On Linux and macOS, from the build directory: -``` -ctest --output-on-failure --parallel 16 -``` - -`--parallel` runs the unit tests on the especified number of threads. - -`--output-on-failure` outputs unit tests details only on failed tests. - --------------- -## Submitting Fixes - -* **Ensure that the bug was not already reported or fixed** by searching on GitHub under [Issues](https://github.com/LunarG/VulkanTools/issues) and [Pull Requests](https://github.com/LunarG/VulkanTools/pulls). -* Use the existing GitHub forking and pull request process. - This will involve [forking the repository](https://help.github.com/articles/fork-a-repo/), - creating a branch with your commits, and then [submitting a pull request](https://help.github.com/articles/using-pull-requests/). -* Please read and adhere to the style and process [guidelines ](#coding-conventions-and-formatting) enumerated below. -* Please base your fixes on the `main` branch. SDK branches are generally not updated except for critical fixes needed to repair an SDK release. -* The resulting Pull Request will be assigned to a repository maintainer. Once the Pull Request has been approved and is passing internal CI, a repository maintainer - will merge the PR. - -### Coding Conventions and Formatting -* Use the **[Google style guide](https://google.github.io/styleguide/cppguide.html)** for source code with the following exceptions: - * The column limit is 132 (as opposed to the default value 80). The clang-format tool will handle this. See below. - * The indent is 4 spaces instead of the default 2 spaces. Again, the clang-format tool will handle this. - * If you can justify a reason for violating a rule in the guidelines, then you are free to do so. Be prepared to defend your -decision during code review. This should be used responsibly. An example of a bad reason is "I don't like that rule." An example of -a good reason is "This violates the style guide, but it improves type safety." - -* Run **clang-format** on your changes to maintain consistent formatting - * There are `.clang-format files` present in the repository to define clang-format settings - which are found and used automatically by clang-format. - * A sample git workflow may look like: - -> # Make changes to the source. -> $ git add -u . -> $ git clang-format --style=file -> # Check to see if clang-format made any changes and if they are OK. -> $ git add -u . -> $ git commit - -* **Commit Messages** - * Limit the subject line to 50 characters -- this allows the information to display correctly in git/Github logs - * Begin subject line with a one-word component description followed by a colon (e.g. layer/tool name, tests, etc.) - * Separate subject from body with a blank line - * Wrap the body at 72 characters - * Capitalize the subject line - * Do not end the subject line with a period - * Use the body to explain what and why vs. how - * Use the imperative mode in the subject line. This just means to write it as a command (e.g. Fix the sprocket) - -Strive for commits that implement a single or related set of functionality, using as many commits as is necessary (more is better). -That said, please ensure that the repository compiles and passes tests without error for each commit in your pull request. Note -that to be accepted into the repository, the pull request must [pass all tests](#testing your changes) on all supported platforms --- the automatic Github Travis and AppVeyor continuous integration features will assist in enforcing this requirement. - --------------- -## Contributor License Agreement (CLA) - -You will be prompted with a one-time "click-through" CLA dialog as part of submitting your pull request -or other contribution to GitHub. - --------------- -## License and Copyrights - -All contributions made to the LunarG repositories need to have the Apache 2.0 license. -Please see an existing file in this repository for an example. - -You can include your individual copyright after any existing copyrights. diff --git a/vkconfig3/configurator.cpp b/vkconfig3/configurator.cpp deleted file mode 100644 index c1fee594e9..0000000000 --- a/vkconfig3/configurator.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Lenny Komow - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "configurator.h" -#include "vulkan_util.h" - -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/path.h" -#include "../vkconfig_core/override.h" -#include "../vkconfig_core/alert.h" - -#include -#include -#include -#include -#include - -#include -#include -#include - -Configurator &Configurator::Get(const std::string &VULKAN_SDK) { - static Configurator configurator(VULKAN_SDK); - return configurator; -} - -Configurator::Configurator(const std::string &VULKAN_SDK) - : path(VULKAN_SDK, SUPPORTED_CONFIG_FILES), environment(path), layers(environment), configurations(environment) {} - -Configurator::~Configurator() { - configurations.SaveAllConfigurations(layers.selected_layers); - - SurrenderConfiguration(environment); -} - -bool Configurator::Init() { - this->UpdateDevices(); - - // Load simple app settings, the additional search paths, and the - // override app list. - this->layers.LoadAllInstalledLayers(); - - QSettings settings; - if (settings.value("crashed", QVariant(false)).toBool()) { - settings.setValue("crashed", false); - - if (Alert::ConfiguratorCrashed() == QMessageBox::No) { - this->configurations.LoadAllConfigurations(this->layers.selected_layers); - } - } else { - this->configurations.LoadAllConfigurations(this->layers.selected_layers); - } - - if (this->configurations.Empty()) { - this->configurations.ResetDefaultsConfigurations(layers.selected_layers); - } else { - this->configurations.FirstDefaultsConfigurations(layers.selected_layers); - } - - this->ActivateConfiguration(this->environment.GetSelectedConfiguration()); - - return true; -} - -void Configurator::ActivateConfiguration(const std::string &configuration_name) { - Configuration *configuration = nullptr; - if (!configuration_name.empty()) { - configuration = FindByKey(this->configurations.available_configurations, configuration_name.c_str()); - } - - if (configuration_name.empty()) { - this->environment.SetSelectedConfiguration(""); - this->configurations.Configure(this->layers.selected_layers); - } else if (configuration == nullptr) { - QMessageBox alert; - alert.QDialog::setWindowTitle("Vulkan layers configuration is missing..."); - const std::string text = format("%s couldn't find '%s' layers configuration.", VKCONFIG_NAME, configuration_name.c_str()); - alert.setText(text.c_str()); - alert.setInformativeText("Vulkan Configurator is switching to Layers Controlled by Vulkan Application mode"); - alert.setIcon(QMessageBox::Critical); - alert.exec(); - - this->environment.SetSelectedConfiguration(""); - this->environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - this->configurations.Configure(this->layers.selected_layers); - } else { - // If the layers paths are differents, we need to reload the layers and the configurations - const std::vector paths = this->environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_GUI); - if (configuration->user_defined_paths != paths) { - this->configurations.SaveAllConfigurations(this->layers.selected_layers); - this->environment.SetPerConfigUserDefinedLayersPaths(configuration->user_defined_paths); - this->layers.LoadAllInstalledLayers(); - this->configurations.LoadAllConfigurations(this->layers.selected_layers); - } - - std::string missing_layer; - if (::HasMissingLayer(configuration->parameters, layers.selected_layers, missing_layer)) { - QMessageBox alert; - alert.QDialog::setWindowTitle("Vulkan layer missing..."); - alert.setText(format("%s couldn't find '%s' layer required by '%s' configuration:", VKCONFIG_NAME, - missing_layer.c_str(), configuration->key.c_str()) - .c_str()); - alert.setIcon(QMessageBox::Critical); - alert.exec(); - } else { - this->configurations.Configure(this->layers.selected_layers); - } - - this->environment.SetSelectedConfiguration(configuration_name.c_str()); - } -} - -void Configurator::UpdateDevices() { - QLibrary library(GetVulkanLibrary()); - - VkInstance instance = VK_NULL_HANDLE; - VkResult err = CreateInstance(library, instance, false); - - if (err != VK_SUCCESS) { - err = CreateInstance(library, instance, true); - if (err != VK_SUCCESS) { - return; - } - } - - PFN_vkEnumeratePhysicalDevices pfnEnumeratePhysicalDevices = - (PFN_vkEnumeratePhysicalDevices)library.resolve("vkEnumeratePhysicalDevices"); - PFN_vkDestroyInstance pfnDestroyInstance = (PFN_vkDestroyInstance)library.resolve("vkDestroyInstance"); - PFN_vkGetPhysicalDeviceProperties pfnGetPhysicalDeviceProperties = - (PFN_vkGetPhysicalDeviceProperties)library.resolve("vkGetPhysicalDeviceProperties"); - - if (pfnEnumeratePhysicalDevices == nullptr || pfnDestroyInstance == nullptr || pfnGetPhysicalDeviceProperties == nullptr) { - return; - } - - uint32_t gpu_count = 0; - err = pfnEnumeratePhysicalDevices(instance, &gpu_count, NULL); - assert(!err); - - std::vector devices; - if (gpu_count > 0) { - devices.resize(gpu_count); - - err = pfnEnumeratePhysicalDevices(instance, &gpu_count, &devices[0]); - assert(!err); - } - - this->device_names.clear(); - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - VkPhysicalDeviceProperties properties; - pfnGetPhysicalDeviceProperties(devices[i], &properties); - - this->device_names.push_back(properties.deviceName); - } - - pfnDestroyInstance(instance, NULL); -} - -bool Configurator::SupportLoaderSettings(Version *return_loader_version) const { - // Check loader version - const Version version = GetVulkanLoaderVersion(); - assert(version != Version::VERSION_NULL); - - if (return_loader_version) { - *return_loader_version = version; - } - - return version >= Version("1.3.261"); -} - -void Configurator::ResetToDefault(bool hard) { - if (hard) { - this->environment.Reset(Environment::CLEAR); - this->layers.LoadAllInstalledLayers(); - this->configurations.ResetDefaultsConfigurations(this->layers.selected_layers); - - this->ActivateConfiguration(this->environment.GetSelectedConfiguration()); - } else { - this->configurations.ReloadDefaultsConfigurations(this->layers.selected_layers); - } -} - -std::vector Configurator::GetDeviceNames() const { return device_names; } diff --git a/vkconfig3/configurator.h b/vkconfig3/configurator.h deleted file mode 100644 index 6cdc5a62d6..0000000000 --- a/vkconfig3/configurator.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/version.h" -#include "../vkconfig_core/layer.h" -#include "../vkconfig_core/layer_manager.h" -#include "../vkconfig_core/path_manager.h" -#include "../vkconfig_core/environment.h" -#include "../vkconfig_core/configuration_manager.h" -#include "../vkconfig_core/platform.h" - -static const std::vector SUPPORTED_CONFIG_FILES = {"_2_2_3"}; - -class Configurator { - public: - static Configurator& Get(const std::string& VULKAN_SDK = ""); - bool Init(); - - // The list of applications affected - public: - bool SupportLoaderSettings(Version* return_loader_version = nullptr) const; - - void ActivateConfiguration(const std::string& configuration_name); - - void ResetToDefault(bool hard); - - std::vector GetDeviceNames() const; - - private: - Configurator(const std::string& VULKAN_SDK); - ~Configurator(); - - Configurator(const Configurator&) = delete; - Configurator& operator=(const Configurator&) = delete; - - void UpdateDevices(); - - public: - PathManager path; - Environment environment; - LayerManager layers; - ConfigurationManager configurations; - std::vector device_names; -}; diff --git a/vkconfig3/dialog_applications.cpp b/vkconfig3/dialog_applications.cpp deleted file mode 100644 index 7217f61939..0000000000 --- a/vkconfig3/dialog_applications.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "dialog_applications.h" -#include "configurator.h" - -#include "../vkconfig_core/alert.h" - -#include -#include -#include -#include - -#include - -ApplicationsDialog::ApplicationsDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::dialog_applications()), _last_selected_application_index(-1) { - ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - Configurator &configurator = Configurator::Get(); - - // The header is hidden by default and stays hidden when no checkboxes are used. - if (!configurator.environment.GetUseApplicationList()) - setWindowTitle("Vulkan Applications Launcher Shortcuts"); - else { - ui->treeWidget->setHeaderHidden(false); - ui->treeWidget->setHeaderLabel("Check to override Vulkan layers"); - } - - // Show the current list - const std::vector &applications = configurator.environment.GetApplications(); - for (std::size_t i = 0, n = applications.size(); i < n; ++i) { - CreateApplicationItem(applications[i]); - } - - ui->treeWidget->installEventFilter(this); - - connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, - SLOT(selectedPathChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(itemChanged(QTreeWidgetItem *, int))); - connect(ui->lineEditAppName, SIGNAL(textEdited(const QString &)), this, SLOT(editAppName(const QString &))); - connect(ui->lineEditExecutable, SIGNAL(textEdited(const QString &)), this, SLOT(editExecutable(const QString &))); - connect(ui->lineEditCmdArgs, SIGNAL(textEdited(const QString &)), this, SLOT(editCommandLine(const QString &))); - connect(ui->lineEditWorkingFolder, SIGNAL(textEdited(const QString &)), this, SLOT(editWorkingFolder(const QString &))); - connect(ui->lineEditLogFile, SIGNAL(textEdited(const QString &)), this, SLOT(editLogFile(const QString &))); - - // If there is an item in the tree (nullptr is okay here), make it the currently selected item. - // This is a work around for macOS, where the currentItemChanged() signal is being emitted (by something) - // after this constructor, without actually selecting the first row. The effect there is, the remove button is - // enabled, and the first item is selected, but not visibly so. Repainting does not fix the issue either. This - // is a macOS only fix, but is put in for all platforms so that the GUI behavior is consistent across all - // platforms. - QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0); - ui->treeWidget->setCurrentItem(item); -} - -bool ApplicationsDialog::eventFilter(QObject *target, QEvent *event) { - // Launch tree does some fancy resizing and since it's down in - // layouts and splitters, we can't just rely on the resize method - // of this window. - if (target == ui->treeWidget) { - if (event->type() == QEvent::Resize) { - ui->treeWidget->resizeColumnToContents(1); - int nLastColumnWidth = ui->treeWidget->columnWidth(1); - QRect rect = ui->treeWidget->geometry(); - ui->treeWidget->setColumnWidth(0, rect.width() - nLastColumnWidth); - } - } - return false; -} - -/// Make sure any changes are saved -void ApplicationsDialog::closeEvent(QCloseEvent *event) { - Environment &environment = Configurator::Get().environment; - - event->accept(); - - // When we don't use overridden list only, no need to alert the user about empty list cases. - if (!environment.GetUseApplicationList()) return; - - if (environment.GetApplications().empty() || !environment.HasOverriddenApplications()) { - environment.SetUseApplicationList(false); - - Alert::ApplicationListEmpty(); - } -} - -/// Browse for and select an executable file to add to the list. -void ApplicationsDialog::on_pushButtonAdd_clicked() // Pick the test application -{ - Configurator &configurator = Configurator::Get(); - - const std::string suggested_path(configurator.path.GetPath(PATH_EXECUTABLE).c_str()); - std::string executable_full_path = configurator.path.SelectPath(this, PATH_EXECUTABLE, suggested_path).c_str(); - - // If they have selected something! - if (!executable_full_path.empty()) { - // On macOS, they may have selected a binary, or they may have selected an app bundle. - // If the later, we need to drill down to the actuall applicaiton - if (executable_full_path.find(".app") != std::string::npos) { - // Start by drilling down - ExactExecutableFromAppBundle(executable_full_path); - } - - std::string app_name; - if (executable_full_path.find(GetNativeSeparator()) != std::string::npos) { - app_name = executable_full_path.substr(executable_full_path.rfind(GetNativeSeparator()) + 1); - } else { - app_name = executable_full_path; - } - - Application new_application(app_name, executable_full_path, ""); - configurator.environment.AppendApplication(new_application); - - QTreeWidgetItem *item = CreateApplicationItem(new_application); - - // To update the application list configuration - configurator.configurations.Configure(configurator.layers.selected_layers); - - ui->treeWidget->setCurrentItem(item); - configurator.environment.SelectActiveApplication(ui->treeWidget->indexOfTopLevelItem(item)); - } -} - -QTreeWidgetItem *ApplicationsDialog::CreateApplicationItem(const Application &application) const { - Configurator &configurator = Configurator::Get(); - - QTreeWidgetItem *item = new QTreeWidgetItem(); - ui->treeWidget->addTopLevelItem(item); - - if (configurator.environment.GetUseApplicationList()) { - QCheckBox *check_box = new QCheckBox(application.app_name.c_str()); - check_box->setChecked(application.layers_mode != LAYERS_MODE_BY_APPLICATIONS); - ui->treeWidget->setItemWidget(item, 0, check_box); - connect(check_box, SIGNAL(clicked(bool)), this, SLOT(itemClicked(bool))); - } else { - item->setText(0, application.app_name.c_str()); - } - - return item; -} - -/// Easy enough, just remove the selected program from the list -void ApplicationsDialog::on_pushButtonRemove_clicked() { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - int selection = ui->treeWidget->indexOfTopLevelItem(current); - assert(selection >= 0 && selection < ui->treeWidget->topLevelItemCount()); - - Configurator &configurator = Configurator::Get(); - - ui->treeWidget->takeTopLevelItem(selection); - ui->treeWidget->setCurrentItem(nullptr); - configurator.environment.RemoveApplication(selection); - - ui->groupLaunchInfo->setEnabled(false); - ui->pushButtonRemove->setEnabled(false); - ui->pushButtonSelect->setEnabled(false); - ui->lineEditAppName->setText(""); - ui->lineEditExecutable->setText(""); - ui->lineEditCmdArgs->setText(""); - ui->lineEditWorkingFolder->setText(""); - ui->lineEditLogFile->setText(""); - - // Update the application list configuration - configurator.configurations.Configure(configurator.layers.selected_layers); - - ui->treeWidget->update(); -} - -// Dismiss the dialog, and preserve app information so it can be set to -// the launcher. -void ApplicationsDialog::on_pushButtonSelect_clicked() { - Configurator &configurator = Configurator::Get(); - QTreeWidgetItem *item = ui->treeWidget->currentItem(); - if (item != nullptr) { - configurator.environment.SelectActiveApplication(ui->treeWidget->indexOfTopLevelItem(item)); - } - - close(); -} - -/// The remove button is disabled until/unless something is selected that can -/// be removed. Also the working folder and command line arguments are updated -void ApplicationsDialog::selectedPathChanged(QTreeWidgetItem *current_item, QTreeWidgetItem *previous_item) { - (void)previous_item; - int application_index = ui->treeWidget->indexOfTopLevelItem(current_item); - - ui->groupLaunchInfo->setEnabled(application_index >= 0); - ui->pushButtonRemove->setEnabled(application_index >= 0); - ui->pushButtonSelect->setEnabled(application_index >= 0); - - if (application_index < 0) { - ui->lineEditAppName->setText(""); - ui->lineEditExecutable->setText(""); - ui->lineEditCmdArgs->setText(""); - ui->lineEditWorkingFolder->setText(""); - ui->lineEditLogFile->setText(""); - return; - } - - const Application &application = Configurator::Get().environment.GetApplication(application_index); - - ui->lineEditAppName->setText(application.app_name.c_str()); - ui->lineEditExecutable->setText(application.executable_path.c_str()); - ui->lineEditExecutable->setToolTip(ReplaceBuiltInVariable(application.executable_path.c_str()).c_str()); - ui->lineEditWorkingFolder->setText(application.working_folder.c_str()); - ui->lineEditWorkingFolder->setToolTip(ReplaceBuiltInVariable(application.working_folder.c_str()).c_str()); - ui->lineEditCmdArgs->setText(application.arguments.c_str()); - ui->lineEditLogFile->setText(application.log_file.c_str()); - ui->lineEditLogFile->setToolTip(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); -} - -void ApplicationsDialog::itemChanged(QTreeWidgetItem *item, int column) { - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(item); - QCheckBox *check_box = dynamic_cast(ui->treeWidget->itemWidget(item, column)); - if (check_box != nullptr) { - Configurator::Get().environment.GetApplication(_last_selected_application_index).layers_mode = - check_box->isChecked() ? LAYERS_MODE_BY_CONFIGURATOR_RUNNING : LAYERS_MODE_BY_APPLICATIONS; - } -} - -/// Something was clicked. We don't know what, and short of setting up a new -/// signal/slot for each button, this seemed a reasonable approach. Just poll -/// all of them. There aren't that many, so KISS (keep it simple stupid) -/// If one of them had their state flipped, that's the one that was checked, make -/// it the currently selected one. -void ApplicationsDialog::itemClicked(bool clicked) { - (void)clicked; - - Environment &environment = Configurator::Get().environment; - const bool need_checkbox = environment.GetUseApplicationList(); - if (!need_checkbox) return; - - // Loop through the whole list and reset the checkboxes - for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++) { - QTreeWidgetItem *item = ui->treeWidget->topLevelItem(i); - QCheckBox *check_box = dynamic_cast(ui->treeWidget->itemWidget(item, 0)); - assert(check_box != nullptr); - environment.GetApplication(i).layers_mode = - check_box->isChecked() ? LAYERS_MODE_BY_CONFIGURATOR_RUNNING : LAYERS_MODE_BY_APPLICATIONS; - } -} - -void ApplicationsDialog::editAppName(const QString &name) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).app_name = name.toStdString(); -} - -void ApplicationsDialog::editExecutable(const QString &executable) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).executable_path = executable.toStdString(); -} - -void ApplicationsDialog::editCommandLine(const QString &cmdLine) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).arguments = cmdLine.toStdString(); -} - -void ApplicationsDialog::editWorkingFolder(const QString &workingFolder) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).working_folder = workingFolder.toStdString(); -} - -void ApplicationsDialog::editLogFile(const QString &logFile) { - QTreeWidgetItem *current = ui->treeWidget->currentItem(); - _last_selected_application_index = ui->treeWidget->indexOfTopLevelItem(current); - if (_last_selected_application_index < 0) return; - - Configurator::Get().environment.GetApplication(_last_selected_application_index).log_file = logFile.toStdString(); -} diff --git a/vkconfig3/dialog_applications.h b/vkconfig3/dialog_applications.h deleted file mode 100644 index 292180cf9e..0000000000 --- a/vkconfig3/dialog_applications.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "ui_dialog_applications.h" - -#include "../vkconfig_core/application.h" - -#include - -class ApplicationsDialog : public QDialog { - Q_OBJECT - - public: - explicit ApplicationsDialog(QWidget *parent = nullptr); - - int GetSelectedLaunchApplicationIndex() const { return _last_selected_application_index; } - - private: - QTreeWidgetItem *CreateApplicationItem(const Application &application) const; - - void closeEvent(QCloseEvent *) override; - bool eventFilter(QObject *target, QEvent *event) override; - - public Q_SLOTS: - void on_pushButtonAdd_clicked(); // Pick the application - void on_pushButtonRemove_clicked(); // Remove - void on_pushButtonSelect_clicked(); // Make this the current launcher app - void selectedPathChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); // Used to enable remove button - void itemChanged(QTreeWidgetItem *item, int column_index); - void itemClicked(bool clicked); - - void editAppName(const QString &name); - void editExecutable(const QString &name); - void editCommandLine(const QString &cmd_line); - void editWorkingFolder(const QString &working_folder); - void editLogFile(const QString &log_file); - - private: - ApplicationsDialog(const ApplicationsDialog &) = delete; - ApplicationsDialog &operator=(const ApplicationsDialog &) = delete; - - std::unique_ptr ui; - int _last_selected_application_index; -}; diff --git a/vkconfig3/dialog_applications.ui b/vkconfig3/dialog_applications.ui deleted file mode 100644 index dd52a4b9d8..0000000000 --- a/vkconfig3/dialog_applications.ui +++ /dev/null @@ -1,176 +0,0 @@ - - - dialog_applications - - - - 0 - 0 - 606 - 375 - - - - - Arial - 10 - - - - Vulkan Applications with overridden Vulkan Layers - - - - - - Add... - - - - - - - false - - - Remove - - - - - - - false - - - Ok - - - - - - - - Arial - 10 - - - - - - - Qt::ScrollBarAlwaysOff - - - 4 - - - true - - - 1 - - - false - - - false - - - - 1 - - - - - - - - false - - - - 0 - 60 - - - - This information is used only when the application is launched manually from vkconfig. - - - Monitored Launch Info - - - - - - Application: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Executable: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Working Folder: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Command Line Arguments: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Log File - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - diff --git a/vkconfig3/dialog_vulkan_analysis.h b/vkconfig3/dialog_vulkan_analysis.h deleted file mode 100644 index af1a432cf9..0000000000 --- a/vkconfig3/dialog_vulkan_analysis.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "ui_dialog_vulkan_analysis.h" - -#include - -#include - -class VulkanAnalysisDialog : public QDialog { - Q_OBJECT - - public: - explicit VulkanAnalysisDialog(QWidget* parent = nullptr); - - private: - VulkanAnalysisDialog(const VulkanAnalysisDialog&) = delete; - VulkanAnalysisDialog& operator=(const VulkanAnalysisDialog&) = delete; - - void Run(); - void LoadTable(QJsonObject& json_parent, QTableWidget* table); - - std::unique_ptr ui; -}; diff --git a/vkconfig3/dialog_vulkan_analysis.ui b/vkconfig3/dialog_vulkan_analysis.ui deleted file mode 100644 index a16b75ff9b..0000000000 --- a/vkconfig3/dialog_vulkan_analysis.ui +++ /dev/null @@ -1,420 +0,0 @@ - - - dialog_vulkan_analysis - - - - 0 - 0 - 752 - 772 - - - - - Arial - 10 - - - - Vulkan Installation Analysis - - - - - - 1 - - - QLayout::SetMaximumSize - - - - - 0 - - - - System Info - - - - - - 5 - - - - - 0 - 0 - 708 - 435 - - - - Environment - - - - - - true - - - true - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Hardware - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Executable Info - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Vulkan Driver Info - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Vulkan Runtimes - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Vulkan SDKs - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Vulkan Implicit Layers - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Vulkan Explicit Layers - - - - - - false - - - false - - - - - - - - - 0 - 0 - 708 - 435 - - - - Vulkan Layer Settings File - - - - - - false - - - false - - - - - - - - - - - - Vulkan API Calls - - - - - - 0 - - - - - 0 - 0 - 708 - 585 - - - - Instance - - - - - - false - - - false - - - - - - - - - 0 - 0 - 98 - 89 - - - - Physical Devices - - - - - - false - - - false - - - - - - - - - 0 - 0 - 98 - 89 - - - - Logical Devices - - - - - - false - - - false - - - - - - - - - 0 - 0 - 98 - 89 - - - - Cleanup - - - - - - false - - - false - - - - - - - - - - - - External Tests - - - - - - false - - - false - - - - - - - - - - - - - - diff --git a/vkconfig3/dialog_vulkan_info.cpp b/vkconfig3/dialog_vulkan_info.cpp deleted file mode 100644 index 1277cd80b4..0000000000 --- a/vkconfig3/dialog_vulkan_info.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "dialog_vulkan_info.h" - -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/platform.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -VulkanInfoDialog::VulkanInfoDialog(QWidget *parent) : QDialog(parent), ui(new Ui::dialog_vulkan_info) { - ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - Run(); -} - -void VulkanInfoDialog::Run() { - static const char *VULKAN_INFO_PATH[] = { - "vulkaninfoSDK", // PLATFORM_WINDOWS - "vulkaninfo", // PLATFORM_LINUX - "/usr/local/bin/vulkaninfo", // PLATFORM_MACOS - "N/A", // PLATFORM_ANDROID - }; - static_assert(countof(VULKAN_INFO_PATH) == PLATFORM_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - ui->treeWidget->clear(); - - QProcess *vulkan_info = new QProcess(this); - vulkan_info->setProgram(VULKAN_INFO_PATH[VKC_PLATFORM]); - - QString filePath = QDir::temp().path(); - - QStringList args; - args << "--vkconfig_output"; - args << filePath; - - // Wait... make sure we don't pick up the old one! - filePath += "/vulkaninfo.json"; - remove(filePath.toUtf8().constData()); - - // Lock and load... - vulkan_info->setArguments(args); - vulkan_info->start(); - vulkan_info->waitForFinished(); - - // Check for the output file - QFile file(filePath); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QMessageBox msgBox; - msgBox.setText("Error running vulkaninfo. Is your SDK up to date and installed properly?"); - msgBox.exec(); - return; - } - - QString jsonText = file.readAll(); - file.close(); - - ////////////////////////////////////////////////////// - // Convert the text to a JSON document & validate it - QJsonParseError parseError; - QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonText.toUtf8(), &parseError); - if (parseError.error != QJsonParseError::NoError) { - QMessageBox msgBox; - msgBox.setWindowTitle("Cannot parse vulkaninfo output."); - msgBox.setText(parseError.errorString()); - msgBox.exec(); - return; - } - - if (jsonDoc.isNull() || jsonDoc.isEmpty()) { - QMessageBox msgBox; - msgBox.setText(tr("Json document is empty!")); - msgBox.exec(); - return; - } - - ///////////////////////////////////////////////////////// - // Get the instance version and set that to the header - QJsonObject jsonTopObject = jsonDoc.object(); - QJsonValue instance = jsonTopObject.value("Vulkan Instance Version"); - QString output = "Vulkan Instance Version: " + instance.toString(); - - QTreeWidgetItem *header = ui->treeWidget->headerItem(); - header->setText(0, output); - - //////////////////////////////////////////////////////////// - // Setp through each major section and parse. - // All of these are the top layer nodes on the tree. - QJsonValue rootObject = jsonTopObject.value("Instance Extensions"); - QTreeWidgetItem *parent_node = new QTreeWidgetItem(); - parent_node->setText(0, "Instance Extensions"); - ui->treeWidget->addTopLevelItem(parent_node); - BuildExtensions(rootObject, parent_node); - - rootObject = jsonTopObject.value("Layer Properties"); - parent_node = new QTreeWidgetItem(); - BuildLayers(rootObject, parent_node); - - rootObject = jsonTopObject.value("Presentable Surfaces"); - parent_node = new QTreeWidgetItem(); - BuildSurfaces(rootObject, parent_node); - - rootObject = jsonTopObject.value("Device Groups"); - parent_node = new QTreeWidgetItem(); - BuildGroups(rootObject, parent_node); - - rootObject = jsonTopObject.value("Device Properties and Extensions"); - parent_node = new QTreeWidgetItem(); - parent_node->setText(0, "Device Properties and Extensions"); - BuildDevices(rootObject, parent_node); - - show(); -} - -/// Many large sections are generic enough to simply parse and construct a tree, -/// without the need for any special formatting or extra text that is not in the -/// json file. -void VulkanInfoDialog::TraverseGenericProperties(QJsonValue &parentJson, QTreeWidgetItem *pParentTreeItem) { - QJsonObject parentObject = parentJson.toObject(); - int listSize = parentObject.size(); - QStringList fields = parentObject.keys(); - - for (int field = 0; field < listSize; field++) { - QJsonValue fieldValue = parentObject.value(fields[field]); - - if (!fieldValue.isArray()) { - // Is it a single child or does it have children? If it has children, recurse - QJsonObject childObject = fieldValue.toObject(); - if (childObject.size() > 0) { - QTreeWidgetItem *pNewChild = new QTreeWidgetItem(); - pNewChild->setText(0, fields[field]); - pParentTreeItem->addChild(pNewChild); - TraverseGenericProperties(fieldValue, pNewChild); - continue; - } - - QTreeWidgetItem *pItem = new QTreeWidgetItem(); - pItem->setText(0, QString().asprintf("%s = %s", fields[field].toUtf8().constData(), - fieldValue.toVariant().toString().toUtf8().constData())); - pParentTreeItem->addChild(pItem); - } else { - // Add array list - QJsonArray jsonArray = fieldValue.toArray(); - QTreeWidgetItem *pArrayParent = new QTreeWidgetItem(); - pArrayParent->setText(0, QString().asprintf("%s: count = %d", fields[field].toUtf8().constData(), jsonArray.size())); - pParentTreeItem->addChild(pArrayParent); - - // The array is just a list of values. No children. - for (int i = 0; i < jsonArray.size(); i++) { - QTreeWidgetItem *pChild = new QTreeWidgetItem(); - // This looks weird... but integer fields will not conver to strings directly. However, if I - // make them a variant first, then they do. I'd call this a Qt bug, but the word around is - // a better choice than to wait for Qt to fix it and then have to require that version of Qt - // to build this tool... RSW - pChild->setText(0, jsonArray[i].toVariant().toString().toUtf8().constData()); - pArrayParent->addChild(pChild); - } - } - } -} - -/// Populate the a subtree with extension names. Extensions also report their -/// spec version, so some extra text is needed, and thus the need for a special -/// function as opposed to just calling TraverseGenericProperties() -void VulkanInfoDialog::BuildExtensions(QJsonValue &jsonValue, QTreeWidgetItem *pRoot) { - QString output; - QJsonObject extensionObject = jsonValue.toObject(); - int nObjectSize = extensionObject.size(); - - // Add all the extensions and thier version - QStringList keys = extensionObject.keys(); - - for (int i = 0; i < nObjectSize; i++) { - QJsonValue default_value = extensionObject.value(keys[i]); - QJsonObject object = default_value.toObject(); - QJsonValue specValue = object.value("specVersion"); - output = keys[i]; - output += " : extension revision "; - output += specValue.toVariant().toString(); - - QTreeWidgetItem *pSubItem = new QTreeWidgetItem(); - pSubItem->setText(0, output); - pRoot->addChild(pSubItem); - } -} - -/// This tree section has some different "kinds" of subtrees (the extensions) -/// and some extra text formatting requirements, so it had to be treated specially. -void VulkanInfoDialog::BuildLayers(QJsonValue &jsonValue, QTreeWidgetItem *root) { - QJsonObject layersObject = jsonValue.toObject(); - int layersCount = layersObject.size(); - - QString output = "Layers : count = "; - output += QString().asprintf("%d", layersCount); - - root->setText(0, output); - ui->treeWidget->addTopLevelItem(root); - - // Loop through all the layers - QStringList layers = layersObject.keys(); - for (int i = 0; i < layersCount; i++) { - QJsonValue layerTop = layersObject.value(layers[i]); - QJsonObject layerObject = layerTop.toObject(); - output = layers[i] + " ("; - output += layerObject.value("description").toString(); - output += ")"; - - QTreeWidgetItem *layer = new QTreeWidgetItem(); - layer->setText(0, output); - - QJsonValue apiVersion = layerObject.value("version"); - QTreeWidgetItem *api_version_item = new QTreeWidgetItem(); - output = "Vulkan Version : " + apiVersion.toString(); - api_version_item->setText(0, output); - layer->addChild(api_version_item); - - QVariant implementationVersion = layerObject.value("implementation version").toVariant(); - QTreeWidgetItem *implementation_version_item = new QTreeWidgetItem(); - output = "Implementation Version : " + implementationVersion.toString(); - implementation_version_item->setText(0, output); - layer->addChild(implementation_version_item); - - // Each layer has extensions - QJsonValue layerExtensions = layerObject.value("Layer Extensions"); - QJsonObject layerExtensionsObject = layerExtensions.toObject(); - int nExtCount = layerExtensionsObject.size(); - output = QString().asprintf("Layer Extensions: count = %d", nExtCount); - QTreeWidgetItem *ext_item = new QTreeWidgetItem(); - ext_item->setText(0, output); - layer->addChild(ext_item); - - BuildExtensions(layerExtensions, ext_item); // Generic enough - - // Each layer has devices too - QJsonValue devicesValue = layerObject.value("Devices"); - QJsonObject devicesObject = devicesValue.toObject(); - int devCount = devicesObject.size(); - QTreeWidgetItem *device_item = new QTreeWidgetItem(); - device_item->setText(0, QString().asprintf("Devices: count = %d", devCount)); - layer->addChild(device_item); - QStringList devicesList = devicesObject.keys(); - for (int dev = 0; dev < devCount; dev++) { - QJsonValue gpuVal = devicesObject.value(devicesList[dev]); - QJsonObject gpuObject = gpuVal.toObject(); - QJsonValue gpuIDValue = gpuObject.value("GPU id"); - output = "GPU id : "; - output += gpuIDValue.toVariant().toString(); - output += " ("; - output += devicesList[dev]; - output += ")"; - QTreeWidgetItem *no_child = new QTreeWidgetItem(); - no_child->setText(0, output); - device_item->addChild(no_child); - - QJsonValue devExtVal = gpuObject.value("Layer-Device Extensions"); - QJsonObject devExtObj = devExtVal.toObject(); - int extCount = devExtObj.size(); - output = QString().asprintf("Layer-Device Extensions: count = %d", extCount); - QTreeWidgetItem *pNext = new QTreeWidgetItem(); - pNext->setText(0, output); - device_item->addChild(pNext); - BuildExtensions(devExtVal, pNext); // Generic enough - } - root->addChild(layer); - } -} - -/// Nice and well behaved. TraverseGenericProperties will build the whole tree. -void VulkanInfoDialog::BuildSurfaces(QJsonValue &jsonValue, QTreeWidgetItem *pRoot) { - QJsonObject surfaces = jsonValue.toObject(); - - pRoot->setText(0, "Presentable Surfaces"); - ui->treeWidget->addTopLevelItem(pRoot); - - TraverseGenericProperties(jsonValue, pRoot); -} - -/// Nice and well behaved. TraverseGenericProperties will build the whole tree. -void VulkanInfoDialog::BuildGroups(QJsonValue &jsonValue, QTreeWidgetItem *pRoot) { - QJsonObject groupsObject = jsonValue.toObject(); - pRoot->setText(0, "Device Groups"); - ui->treeWidget->addTopLevelItem(pRoot); - - TraverseGenericProperties(jsonValue, pRoot); -} - -/// The Device Properties and Extensions tree is mostly pretty well behaved. -/// There is one section that can be handled by the TraverseGenericProperties() -/// function, and just one section that is specifially needing the -/// extensions list parser. -void VulkanInfoDialog::BuildDevices(QJsonValue &jsonValue, QTreeWidgetItem *root) { - QJsonObject gpuObject = jsonValue.toObject(); - - root->setText(0, "Device Properties and Extensions"); - ui->treeWidget->addTopLevelItem(root); - - // For each like GPU0 object - QStringList gpuList = gpuObject.keys(); - for (int i = 0; i < gpuObject.size(); i++) { - QTreeWidgetItem *pGPU = new QTreeWidgetItem(); - pGPU->setText(0, gpuList[i]); - root->addChild(pGPU); - - QJsonValue properties = gpuObject.value(gpuList[i]); - QJsonObject propertiesObject = properties.toObject(); - QStringList propertyParents = propertiesObject.keys(); - - for (int j = 0; j < propertiesObject.size(); j++) { - QTreeWidgetItem *parent = new QTreeWidgetItem(); - parent->setText(0, propertyParents[j]); - pGPU->addChild(parent); - QJsonValue default_value = propertiesObject.value(propertyParents[j]); - - if (propertyParents[j] == "Device Extensions") - BuildExtensions(default_value, parent); - else - TraverseGenericProperties(default_value, parent); - } - } -} diff --git a/vkconfig3/dialog_vulkan_info.h b/vkconfig3/dialog_vulkan_info.h deleted file mode 100644 index 5e82ebb38c..0000000000 --- a/vkconfig3/dialog_vulkan_info.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "ui_dialog_vulkan_info.h" - -#include - -class VulkanInfoDialog : public QDialog { - Q_OBJECT - - public: - explicit VulkanInfoDialog(QWidget *parent = nullptr); - - private: - VulkanInfoDialog(const VulkanInfoDialog &) = delete; - VulkanInfoDialog &operator=(const VulkanInfoDialog &) = delete; - - void BuildExtensions(QJsonValue &json_value, QTreeWidgetItem *root); - void BuildLayers(QJsonValue &json_value, QTreeWidgetItem *root); - void BuildSurfaces(QJsonValue &json_value, QTreeWidgetItem *root); - void BuildGroups(QJsonValue &json_value, QTreeWidgetItem *root); - void BuildDevices(QJsonValue &json_value, QTreeWidgetItem *root); - void TraverseGenericProperties(QJsonValue &parent_json, QTreeWidgetItem *parent_tree_item); - - void Run(); - - std::unique_ptr ui; -}; diff --git a/vkconfig3/dialog_vulkan_info.ui b/vkconfig3/dialog_vulkan_info.ui deleted file mode 100644 index 9ece47193d..0000000000 --- a/vkconfig3/dialog_vulkan_info.ui +++ /dev/null @@ -1,41 +0,0 @@ - - - dialog_vulkan_info - - - - 0 - 0 - 754 - 653 - - - - - Arial - - - - Vulkan Info - - - - - - - Arial - 10 - - - - - 1 - - - - - - - - - diff --git a/vkconfig3/images/NewLunarGLogoBlack.png b/vkconfig3/images/NewLunarGLogoBlack.png deleted file mode 100644 index 495acff39e..0000000000 Binary files a/vkconfig3/images/NewLunarGLogoBlack.png and /dev/null differ diff --git a/vkconfig3/images/presentation.gif b/vkconfig3/images/presentation.gif deleted file mode 100644 index e314eb7f3f..0000000000 Binary files a/vkconfig3/images/presentation.gif and /dev/null differ diff --git a/vkconfig3/images/vkconfig_applications_collapsed.png b/vkconfig3/images/vkconfig_applications_collapsed.png deleted file mode 100644 index 3940fffbcd..0000000000 Binary files a/vkconfig3/images/vkconfig_applications_collapsed.png and /dev/null differ diff --git a/vkconfig3/images/vkconfig_applications_dialog.png b/vkconfig3/images/vkconfig_applications_dialog.png deleted file mode 100644 index adf42da9bf..0000000000 Binary files a/vkconfig3/images/vkconfig_applications_dialog.png and /dev/null differ diff --git a/vkconfig3/images/vkconfig_applications_expanded.png b/vkconfig3/images/vkconfig_applications_expanded.png deleted file mode 100644 index feb1cf45d1..0000000000 Binary files a/vkconfig3/images/vkconfig_applications_expanded.png and /dev/null differ diff --git a/vkconfig3/images/vulkan_layers_order.png b/vkconfig3/images/vulkan_layers_order.png deleted file mode 100644 index 175e2b6944..0000000000 Binary files a/vkconfig3/images/vulkan_layers_order.png and /dev/null differ diff --git a/vkconfig3/images/vulkan_layers_order_small.png b/vkconfig3/images/vulkan_layers_order_small.png deleted file mode 100644 index b7ce80223c..0000000000 Binary files a/vkconfig3/images/vulkan_layers_order_small.png and /dev/null differ diff --git a/vkconfig3/images/vulkan_loader.png b/vkconfig3/images/vulkan_loader.png deleted file mode 100644 index 8451a35125..0000000000 Binary files a/vkconfig3/images/vulkan_loader.png and /dev/null differ diff --git a/vkconfig3/images/vulkan_loader_640px.png b/vkconfig3/images/vulkan_loader_640px.png deleted file mode 100644 index e79bf6d6df..0000000000 Binary files a/vkconfig3/images/vulkan_loader_640px.png and /dev/null differ diff --git a/vkconfig3/main.cpp b/vkconfig3/main.cpp deleted file mode 100644 index bf02185e8a..0000000000 --- a/vkconfig3/main.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "main_gui.h" -#include "main_reset.h" -#include "main_layers.h" -#include "main_doc.h" -#include "main_signal.h" - -#include "../vkconfig_core/path.h" - -#include - -#ifdef _WIN32 -#include -#endif - -#include -#include - -int main(int argc, char* argv[]) { -#ifdef _WIN32 - DWORD procId; - DWORD count = GetConsoleProcessList(&procId, 1); - if (count < 2) { - ::ShowWindow(::GetConsoleWindow(), SW_HIDE); // hide console window - } -#endif - - ::vkconfig_version = "vkconfig"; - - const CommandLine command_line(argc, argv); - - if (command_line.error != ERROR_NONE) { - command_line.log(); - command_line.usage(); - return -1; - } - - InitSignals(); - - switch (command_line.command) { - case COMMAND_SHOW_USAGE: { - command_line.usage(); - return 0; - } - case COMMAND_VERSION: { - command_line.version(); - return 0; - } - case COMMAND_LAYERS: { - return run_layers(command_line); - } - case COMMAND_RESET: { - return run_reset(argc, argv, command_line); - } - case COMMAND_VULKAN_SDK: - case COMMAND_GUI: { - return run_gui(argc, argv, command_line); - } - case COMMAND_DOC: { - return run_doc(command_line); - } - default: { - assert(0); - return -1; - } - } -} diff --git a/vkconfig3/main_doc.cpp b/vkconfig3/main_doc.cpp deleted file mode 100644 index 4a8c007e70..0000000000 --- a/vkconfig3/main_doc.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2022-2024 Valve Corporation - * Copyright (c) 2022-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - David Pinedo - * - Christophe Riccio - */ - -#include "main_doc.h" -#include "configurator.h" - -#include "../vkconfig_core/layer_manager.h" -#include "../vkconfig_core/doc.h" -#include "../vkconfig_core/configuration_manager.h" - -#include - -int run_doc_html(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); - - for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { - const Layer& layer = layers.selected_layers[i]; - if (layer.key == command_line.doc_layer_name) { - const std::string path = format("%s/%s.html", command_line.doc_out_dir.c_str(), layer.key.c_str()); - ExportHtmlDoc(layer, path); - return 0; - } - } - fprintf(stderr, "vkconfig: Could not load layer %s\n", command_line.doc_layer_name.c_str()); - fprintf(stderr, "Run \"vkconfig layers --list\" to get list of available layers\n"); - return -1; -} - -int run_doc_markdown(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); - - for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { - const Layer& layer = layers.selected_layers[i]; - if (layer.key == command_line.doc_layer_name) { - const std::string path = format("%s/%s.md", command_line.doc_out_dir.c_str(), layer.key.c_str()); - ExportMarkdownDoc(layer, path); - return 0; - } - } - fprintf(stderr, "vkconfig: Could not load layer %s\n", command_line.doc_layer_name.c_str()); - fprintf(stderr, "Run \"vkconfig layers --list\" to get list of available layers\n"); - return -1; -} - -int run_doc_settings(const CommandLine& command_line) { - int rval = 0; - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - ConfigurationManager configuration_manager(environment); - Configuration config; - LayerManager layers(environment); - Layer* layer; - - layers.LoadLayer(command_line.doc_layer_name); - layer = FindByKey(layers.selected_layers, command_line.doc_layer_name.c_str()); - if (!layer) { - fprintf(stderr, "vkconfig: Could not load layer %s\n", command_line.doc_layer_name.c_str()); - fprintf(stderr, "Run \"vkconfig layers --list\" to get list of available layers\n"); - return -1; - } - config = configuration_manager.CreateConfiguration(layers.selected_layers, "Config"); - config.parameters = GatherParameters(config.parameters, layers.selected_layers); - config.parameters[0].state = LAYER_STATE_OVERRIDDEN; - ExportSettingsDoc(layers.selected_layers, config, command_line.doc_out_dir + "/vk_layer_settings.txt"); - - return rval; -} - -int run_doc(const CommandLine& command_line) { - assert(command_line.command == COMMAND_DOC); - assert(command_line.error == ERROR_NONE); - - switch (command_line.command_doc_arg) { - case COMMAND_DOC_HTML: { - return run_doc_html(command_line); - } - case COMMAND_DOC_MARKDOWN: { - return run_doc_markdown(command_line); - } - case COMMAND_DOC_SETTINGS: { - return run_doc_settings(command_line); - } - default: { - assert(0); - return -1; - } - } -} diff --git a/vkconfig3/main_gui.h b/vkconfig3/main_gui.h deleted file mode 100644 index 06c17e5aca..0000000000 --- a/vkconfig3/main_gui.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/command_line.h" - -int run_gui(int argc, char* argv[], const CommandLine& command_line); diff --git a/vkconfig3/main_reset.h b/vkconfig3/main_reset.h deleted file mode 100644 index d777edf378..0000000000 --- a/vkconfig3/main_reset.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/command_line.h" - -int run_reset(int argc, char* argv[], const CommandLine& command_line); diff --git a/vkconfig3/main_signal.cpp b/vkconfig3/main_signal.cpp deleted file mode 100644 index 1e057852f0..0000000000 --- a/vkconfig3/main_signal.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "../vkconfig_core/override.h" -#include "../vkconfig_core/layer_manager.h" - -#include "main_signal.h" -#include "configurator.h" - -#include - -#include - -void SurrenderConfiguration(int signal) { - (void)signal; - - // Indicate that Vulkan Configurator crashed to handle it on next run - { - QSettings settings; - settings.setValue("crashed", true); - } - - PathManager paths("", SUPPORTED_CONFIG_FILES); - Environment environment(paths); - - SurrenderConfiguration(environment); -} - -void InitSignals() { - std::signal(SIGINT, SurrenderConfiguration); - std::signal(SIGTERM, SurrenderConfiguration); - std::signal(SIGSEGV, SurrenderConfiguration); - std::signal(SIGABRT, SurrenderConfiguration); - std::signal(SIGILL, SurrenderConfiguration); - std::signal(SIGFPE, SurrenderConfiguration); -} diff --git a/vkconfig3/resourcefiles/lunarg_logo.png b/vkconfig3/resourcefiles/lunarg_logo.png deleted file mode 100644 index 0d63479821..0000000000 Binary files a/vkconfig3/resourcefiles/lunarg_logo.png and /dev/null differ diff --git a/vkconfig3/resourcefiles/qt_logo.png b/vkconfig3/resourcefiles/qt_logo.png deleted file mode 100644 index bd5250e30b..0000000000 Binary files a/vkconfig3/resourcefiles/qt_logo.png and /dev/null differ diff --git a/vkconfig3/resourcefiles/vkconfig-off.png b/vkconfig3/resourcefiles/vkconfig-off.png deleted file mode 100644 index ba43b48fda..0000000000 Binary files a/vkconfig3/resourcefiles/vkconfig-off.png and /dev/null differ diff --git a/vkconfig3/resourcefiles/vkconfig-on.png b/vkconfig3/resourcefiles/vkconfig-on.png deleted file mode 100644 index 4460643f77..0000000000 Binary files a/vkconfig3/resourcefiles/vkconfig-on.png and /dev/null differ diff --git a/vkconfig3/resourcefiles/vkconfig.aps b/vkconfig3/resourcefiles/vkconfig.aps deleted file mode 100644 index 776c775f60..0000000000 Binary files a/vkconfig3/resourcefiles/vkconfig.aps and /dev/null differ diff --git a/vkconfig3/resourcefiles/vkconfig.rc b/vkconfig3/resourcefiles/vkconfig.rc deleted file mode 100644 index a0110cb778..0000000000 --- a/vkconfig3/resourcefiles/vkconfig.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "vulkan.ico" \ No newline at end of file diff --git a/vkconfig3/resourcefiles/vulkan.ico b/vkconfig3/resourcefiles/vulkan.ico deleted file mode 100644 index 802593c65c..0000000000 Binary files a/vkconfig3/resourcefiles/vulkan.ico and /dev/null differ diff --git a/vkconfig3/resourcefiles/vulkan_configurator.png b/vkconfig3/resourcefiles/vulkan_configurator.png deleted file mode 100644 index 0b665ad338..0000000000 Binary files a/vkconfig3/resourcefiles/vulkan_configurator.png and /dev/null differ diff --git a/vkconfig3/resources.qrc b/vkconfig3/resources.qrc deleted file mode 100644 index 6a6d611d1a..0000000000 --- a/vkconfig3/resources.qrc +++ /dev/null @@ -1,81 +0,0 @@ - - - resourcefiles/vulkan_configurator.png - resourcefiles/lunarg_logo.png - resourcefiles/qt_logo.png - resourcefiles/vkconfig-off.png - resourcefiles/vkconfig-on.png - - - - ../vkconfig_core/configurations/2.2.2/API dump.json - ../vkconfig_core/configurations/2.2.2/Frame Capture.json - ../vkconfig_core/configurations/2.2.2/Portability.json - ../vkconfig_core/configurations/2.2.2/Synchronization.json - ../vkconfig_core/configurations/2.2.2/Validation.json - - - - ../vkconfig_core/layers/layers_schema.json - ../vkconfig_core/layers/validusage.json - - - - ../vkconfig_core/test/VK_LAYER_LUNARG_reference_1_2_1.json - - - - ../vkconfig_core/layers/130/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/130/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/130/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/130/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/135/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/135/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/135/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/135/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/141/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/141/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/148/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/148/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/154/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/154/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/162/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/162/VK_LAYER_LUNARG_screenshot.json - - - - ../vkconfig_core/layers/170/VK_LAYER_KHRONOS_synchronization2.json - ../vkconfig_core/layers/170/VK_LAYER_KHRONOS_validation.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_api_dump.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_gfxreconstruct.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_monitor.json - ../vkconfig_core/layers/170/VK_LAYER_LUNARG_screenshot.json - - diff --git a/vkconfig3/vkconfig.entitlements b/vkconfig3/vkconfig.entitlements deleted file mode 100644 index 6883e4a27b..0000000000 --- a/vkconfig3/vkconfig.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.cs.allow-unsigned-executable-memory - - com.apple.security.cs.disable-library-validation - - - diff --git a/vkconfig3/vulkan_util.cpp b/vkconfig3/vulkan_util.cpp deleted file mode 100644 index d91acffd30..0000000000 --- a/vkconfig3/vulkan_util.cpp +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "vulkan_util.h" -#include "configurator.h" - -#include "../vkconfig_core/alert.h" -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/platform.h" -#include "../vkconfig_core/override.h" - -#include - -#include -#include - -#include - -const char *GetVulkanLibrary() { - static const char *TABLE[] = { - "vulkan-1.dll", // PLATFORM_WINDOWS - "libvulkan", // PLATFORM_LINUX - "/usr/local/lib/libvulkan", // PLATFORM_MACOS - "N/A", // PLATFORM_ANDROID - }; - static_assert(countof(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - return TABLE[VKC_PLATFORM]; -} - -std::string GetUUIDString(const uint8_t deviceUUID[VK_UUID_SIZE]) { - std::string result; - - for (std::size_t i = 0, n = VK_UUID_SIZE; i < n; ++i) { - result += format("%02X", deviceUUID[i]); - } - - return result; -} - -Version GetVulkanLoaderVersion() { - // Check loader version - QLibrary library(GetVulkanLibrary()); - - if (!library.load()) return Version::VERSION_NULL; - - PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion; - vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion)library.resolve("vkEnumerateInstanceVersion"); - assert(vkEnumerateInstanceVersion); - - uint32_t version = 0; - const VkResult result = vkEnumerateInstanceVersion(&version); - assert(result == VK_SUCCESS); - - return Version(version); -} - -static std::string GetUserDefinedLayersPathsLog(const char *label, UserDefinedLayersPaths custom_layer_path) { - std::string log; - - const std::vector &user_defined_layer_paths = - Configurator::Get().environment.GetUserDefinedLayersPaths(custom_layer_path); - if (!user_defined_layer_paths.empty()) { - log += format(" - %s:\n", label); - for (std::size_t i = 0, n = user_defined_layer_paths.size(); i < n; ++i) - log += format(" - %s\n", user_defined_layer_paths[i].c_str()); - } else - log += format(" - %s: None\n", label); - - return log; -} - -VkResult CreateInstance(QLibrary &library, VkInstance &instance, bool enumerate_portability) { - if (!enumerate_portability) return VK_ERROR_INCOMPATIBLE_DRIVER; - - PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties = - (PFN_vkEnumerateInstanceExtensionProperties)library.resolve("vkEnumerateInstanceExtensionProperties"); - assert(vkEnumerateInstanceExtensionProperties); - - uint32_t property_count = 0; - VkResult err = vkEnumerateInstanceExtensionProperties(nullptr, &property_count, nullptr); - assert(err == VK_SUCCESS); - - std::vector instance_properties(property_count); - err = vkEnumerateInstanceExtensionProperties(nullptr, &property_count, &instance_properties[0]); - assert(err == VK_SUCCESS); - - // Handle Portability Enumeration requirements - std::vector instance_extensions; - - for (std::size_t i = 0, n = instance_properties.size(); i < n && enumerate_portability; ++i) { - if (instance_properties[i].extensionName == std::string(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { - instance_extensions.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); - } -#if VK_KHR_portability_enumeration - else if (instance_properties[i].extensionName == std::string(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME)) { - instance_extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); - } -#endif - } - - // Check Vulkan Devices - - VkApplicationInfo app = {}; - app.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; - app.pNext = nullptr; - app.pApplicationName = VKCONFIG_SHORT_NAME; - app.applicationVersion = 0; - app.pEngineName = VKCONFIG_SHORT_NAME; - app.engineVersion = 0; - app.apiVersion = VK_API_VERSION_1_1; - - VkInstanceCreateInfo inst_info = {}; - inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; -#if VK_KHR_portability_enumeration - if (!instance_extensions.empty()) { - inst_info.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; - } -#endif - inst_info.pNext = nullptr; - inst_info.pApplicationInfo = &app; - inst_info.enabledLayerCount = 0; - inst_info.ppEnabledLayerNames = nullptr; - inst_info.enabledExtensionCount = static_cast(instance_extensions.size()); - inst_info.ppEnabledExtensionNames = instance_extensions.empty() ? nullptr : &instance_extensions[0]; - - PFN_vkCreateInstance vkCreateInstance = (PFN_vkCreateInstance)library.resolve("vkCreateInstance"); - assert(vkCreateInstance); - - return vkCreateInstance(&inst_info, nullptr, &instance); -} - -std::string GenerateVulkanStatus() { - std::string log; - - Configurator &configurator = Configurator::Get(); - - // Layers override configuration - switch (configurator.environment.GetMode()) { - default: - case LAYERS_MODE_BY_APPLICATIONS: - log += "- Vulkan Layers Controlled by Vulkan Applications\n"; - break; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: - if (configurator.configurations.HasActiveConfiguration(configurator.layers.selected_layers)) { - log += format("- Vulkan Layers Controlled by \"%s\" configuration\n", - configurator.environment.GetSelectedConfiguration().c_str()); - } else { - log += format("- Vulkan Layers Controlled by Vulkan Configurator but no configuration selected\n", - configurator.environment.GetSelectedConfiguration().c_str()); - } - break; - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: - log += "- Vulkan Layers Disabled by Vulkan Configurator\n"; - break; - } - - log += "- Environment variables:\n"; - - // Check Vulkan SDK path - const std::string vk_sdk_path(qgetenv("VULKAN_SDK")); - if (!vk_sdk_path.empty()) - log += format(" - VULKAN_SDK: %s\n", vk_sdk_path.c_str()); - else - log += " - VULKAN_SDK not set\n"; - - // Check VK_LOCAL path - const std::string vk_local_path(GetPath(BUILTIN_PATH_LOCAL)); - if (!vk_local_path.empty()) { - log += format(" - VK_LOCAL: %s\n", vk_local_path.c_str()); - } - - const Version loader_version = GetVulkanLoaderVersion(); - - if (loader_version == Version::VERSION_NULL) { - Alert::LoaderFailure(); - - log += "- Could not find a Vulkan Loader.\n"; - return log; - } else { - log += format("- Vulkan Loader version: %s\n", loader_version.str().c_str()); - const int loader_message_types = configurator.environment.GetLoaderMessageTypes(); - if (loader_message_types != LOADER_MESSAGE_NONE) { - log += format(" - VK_LOADER_DEBUG=%s\n", GetLoaderMessageTokens(loader_message_types).c_str()); - } - } - - log += "- User-Defined Layers locations:\n"; - log += GetUserDefinedLayersPathsLog("VK_LAYER_PATH variable", USER_DEFINED_LAYERS_PATHS_ENV_SET); - log += GetUserDefinedLayersPathsLog("Per-configuration paths", USER_DEFINED_LAYERS_PATHS_GUI); - log += GetUserDefinedLayersPathsLog("VK_ADD_LAYER_PATH variable", USER_DEFINED_LAYERS_PATHS_ENV_ADD); - - const std::string layer_settings_path(qgetenv("VK_LAYER_SETTINGS_PATH")); - if (!layer_settings_path.empty()) { - log += "- `vk_layer_settings.txt` location overridden by VK_LAYER_SETTINGS_PATH:\n"; - if (layer_settings_path.find("vk_layer_settings.txt") == std::string::npos) { - log += format(" %s\n", layer_settings_path.c_str()); - } else { - log += format(" %s\n", ExtractAbsoluteDir(layer_settings_path).c_str()); - } - } else { - const std::string path = GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - log += "- `vk_layer_settings.txt` uses the default platform path:\n"; - log += format(" %s\n", ExtractAbsoluteDir(path).c_str()); - } - - // If there is no Vulkan loader installed, we can't call any Vulkan API. - if (loader_version == Version::VERSION_NULL) { - return log; - } - - LayersMode saved_mode = configurator.environment.GetMode(); - configurator.environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - configurator.configurations.Configure(configurator.layers.selected_layers); - - QLibrary library(GetVulkanLibrary()); - PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties = - (PFN_vkEnumerateInstanceLayerProperties)library.resolve("vkEnumerateInstanceLayerProperties"); - assert(vkEnumerateInstanceLayerProperties); - - std::uint32_t instance_layer_count = 0; - VkResult err = vkEnumerateInstanceLayerProperties(&instance_layer_count, NULL); - assert(!err); - - std::vector layers_properties; - layers_properties.resize(instance_layer_count); - - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, &layers_properties[0]); - assert(!err); - - log += "- Available Layers:\n"; - for (std::size_t i = 0, n = layers_properties.size(); i < n; ++i) { - const Layer *layer = FindByKey(configurator.layers.selected_layers, layers_properties[i].layerName); - - std::string status; - if (layer != nullptr) { - if (layer->status != STATUS_STABLE) { - status = GetToken(layer->status); - } - } - - if (status.empty()) { - log += format(" - %s\n", layers_properties[i].layerName); - } else { - log += format(" - %s (%s)\n", layers_properties[i].layerName, status.c_str()); - } - } - - VkInstance inst = VK_NULL_HANDLE; - err = CreateInstance(library, inst, false); - if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { - // If no compatible driver were found, trying with portability enumeration - err = CreateInstance(library, inst, true); - if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { - Alert::InstanceFailure(); - - log += "- Cannot find a compatible Vulkan installable client driver (ICD).\n"; - return log; - } - } - assert(err == VK_SUCCESS); - - PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices = - (PFN_vkEnumeratePhysicalDevices)library.resolve("vkEnumeratePhysicalDevices"); - assert(vkEnumeratePhysicalDevices); - - PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties = - (PFN_vkEnumerateInstanceExtensionProperties)library.resolve("vkEnumerateInstanceExtensionProperties"); - assert(vkEnumerateInstanceExtensionProperties); - - VkResult result = VK_SUCCESS; - - uint32_t instance_extension_count = 0; - result = vkEnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, nullptr); - - std::vector instance_extensions; - if (instance_extension_count > 0) { - instance_extensions.resize(instance_extension_count); - } - result = vkEnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, instance_extensions.data()); - - bool has_device_id = false; - if (result == VK_SUCCESS) { - for (std::size_t i = 0, n = instance_extensions.size(); i < n; ++i) { - if (instance_extensions[i].extensionName == std::string(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { - has_device_id = true; - break; - } - } - } - - uint32_t gpu_count = 0; - err = vkEnumeratePhysicalDevices(inst, &gpu_count, NULL); - - PFN_vkDestroyInstance vkDestroyInstance = (PFN_vkDestroyInstance)library.resolve("vkDestroyInstance"); - assert(vkDestroyInstance); - - // This can fail on a new Linux setup. Check and fail gracefully rather than crash. - if (err != VK_SUCCESS) { - Alert::PhysicalDeviceFailure(); - vkDestroyInstance(inst, NULL); - - log += "- Cannot find a compatible Vulkan installable client driver (ICD).\n"; - return log; - } - - std::vector devices; - devices.resize(gpu_count); - - err = vkEnumeratePhysicalDevices(inst, &gpu_count, &devices[0]); - assert(!err); - - PFN_vkGetPhysicalDeviceProperties pfnGetPhysicalDeviceProperties = - (PFN_vkGetPhysicalDeviceProperties)library.resolve("vkGetPhysicalDeviceProperties"); - assert(pfnGetPhysicalDeviceProperties); - - Configurator &configurator_edit = Configurator::Get(); - configurator_edit.device_names.clear(); - - log += "- Physical Devices:\n"; - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - VkPhysicalDeviceProperties properties; - pfnGetPhysicalDeviceProperties(devices[i], &properties); - - const std::string vk_version = format("%d.%d.%d", VK_VERSION_MAJOR(properties.apiVersion), - VK_VERSION_MINOR(properties.apiVersion), VK_VERSION_PATCH(properties.apiVersion)); - - log += format(" - %s with Vulkan %s\n", properties.deviceName, vk_version.c_str()); - - if (has_device_id) { - PFN_vkGetPhysicalDeviceProperties2 pfnGetPhysicalDeviceProperties2 = - (PFN_vkGetPhysicalDeviceProperties2)library.resolve("vkGetPhysicalDeviceProperties2"); - assert(pfnGetPhysicalDeviceProperties2); - - VkPhysicalDeviceIDPropertiesKHR properties_deviceid{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR, nullptr}; - VkPhysicalDeviceProperties2 properties2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, &properties_deviceid}; - - pfnGetPhysicalDeviceProperties2(devices[i], &properties2); - - const std::string deviceUUID = GetUUIDString(properties_deviceid.deviceUUID); - log += format(" - deviceUUID: %s\n", deviceUUID.c_str()); - - const std::string driverUUID = GetUUIDString(properties_deviceid.driverUUID); - log += format(" - driverUUID: %s\n", driverUUID.c_str()); - } - - configurator_edit.device_names.push_back(properties.deviceName); - } - - vkDestroyInstance(inst, NULL); - - configurator.environment.SetMode(saved_mode); - configurator.configurations.Configure(configurator.layers.selected_layers); - - return log; -} diff --git a/vkconfig3/widget_preset.cpp b/vkconfig3/widget_preset.cpp deleted file mode 100644 index 3bf4bfdc23..0000000000 --- a/vkconfig3/widget_preset.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "widget_preset.h" - -#include - -WidgetPreset::WidgetPreset(QTreeWidget* tree, QTreeWidgetItem* item, const Layer& layer, Parameter& parameter) - : WidgetSettingBase(tree, item), layer(layer), parameter(parameter), field(new ComboBox(this)) { - this->field->setFocusPolicy(Qt::StrongFocus); - this->field->addItem(Layer::NO_PRESET); - - preset_labels.push_back(Layer::NO_PRESET); - - for (std::size_t i = 0, n = layer.presets.size(); i < n; ++i) { - const LayerPreset& layer_preset = layer.presets[i]; - - if (!IsPlatformSupported(layer_preset.platform_flags)) continue; - if (layer_preset.view == SETTING_VIEW_HIDDEN) continue; - - this->field->addItem((layer_preset.label + " Preset").c_str()); - preset_labels.push_back(layer_preset.label); - } - - // 'Refresh' need to be called before 'connect' to avoid triggering 'currentIndexChanged' in an infinite loop - this->Refresh(REFRESH_ENABLE_AND_STATE); - this->connect(this->field, SIGNAL(currentIndexChanged(int)), this, SLOT(OnPresetChanged(int))); - - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->tree->setItemWidget(this->item, 0, this); -} - -void WidgetPreset::Refresh(RefreshAreas refresh_areas) { - (void)refresh_areas; - - const std::string& preset_label = layer.FindPresetLabel(parameter.settings); - - this->field->blockSignals(true); - this->field->setCurrentIndex(GetComboBoxIndex(preset_label.c_str())); - this->field->blockSignals(false); - - if (preset_label != Layer::NO_PRESET) { - const LayerPreset* preset = GetPreset(layer.presets, preset_label.c_str()); - assert(preset != nullptr); - this->setToolTip(preset->description.c_str()); - } -} - -void WidgetPreset::resizeEvent(QResizeEvent* event) { - const QRect button_rect = QRect(0, 0, event->size().width(), event->size().height()); - this->field->setGeometry(button_rect); -} - -int WidgetPreset::GetComboBoxIndex(const char* preset_label) const { - for (std::size_t i = 0, n = preset_labels.size(); i < n; ++i) { - if (preset_labels[i] == preset_label) return static_cast(i); - } - - assert(0); - return -1; -} - -void WidgetPreset::OnPresetChanged(int combox_preset_index) { - assert(combox_preset_index >= 0 && static_cast(combox_preset_index) < preset_labels.size()); - const std::string& preset_label = preset_labels[combox_preset_index]; - - if (preset_label == Layer::NO_PRESET) return; - - const LayerPreset* preset = GetPreset(layer.presets, preset_label.c_str()); - assert(preset != nullptr); - parameter.ApplyPresetSettings(*preset); - - emit itemChanged(); -} diff --git a/vkconfig3/widget_preset.h b/vkconfig3/widget_preset.h deleted file mode 100644 index b7dcc5c6b3..0000000000 --- a/vkconfig3/widget_preset.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/layer.h" -#include "../vkconfig_core/parameter.h" - -#include "widget_setting.h" -#include "combo_box.h" - -#include - -#include - -class WidgetPreset : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetPreset(QTreeWidget* tree, QTreeWidgetItem* item, const Layer& layer, Parameter& parameter); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnPresetChanged(int combox_preset_index); - - Q_SIGNALS: - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent* event) override; - - private: - int GetComboBoxIndex(const char* preset_label) const; - - std::vector preset_labels; // The preset in the combobox - const Layer& layer; - Parameter& parameter; - ComboBox* field; -}; diff --git a/vkconfig3/widget_setting.h b/vkconfig3/widget_setting.h deleted file mode 100644 index 66517648e1..0000000000 --- a/vkconfig3/widget_setting.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting.h" - -#include -#include -#include -#include - -#include - -static const int MIN_BUTTON_SIZE = 24; -static const int ITEM_HEIGHT = 24; - -enum RefreshAreas { REFRESH_ENABLE_AND_STATE = 0, REFRESH_ENABLE_ONLY }; - -class WidgetSettingBase : public QWidget { - Q_OBJECT - - public: - WidgetSettingBase(QTreeWidget* tree, QTreeWidgetItem* item); - - virtual void Refresh(RefreshAreas refresh_areas) = 0; - - private: - WidgetSettingBase(const WidgetSettingBase&) = delete; - WidgetSettingBase& operator=(const WidgetSettingBase&) = delete; - - protected: - void DisplayOverride(QWidget* widget, const SettingMeta& meta) const; - - QTreeWidget* tree; - QTreeWidgetItem* item; -}; - -int HorizontalAdvance(const QFontMetrics& fm, const QString& string); - -std::string GetLabel(const SettingMeta& meta); diff --git a/vkconfig3/widget_setting_bool.cpp b/vkconfig3/widget_setting_bool.cpp deleted file mode 100644 index 52ebb201d2..0000000000 --- a/vkconfig3/widget_setting_bool.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting_bool.h" - -#include - -WidgetSettingBool::WidgetSettingBool(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaBool& meta, - SettingDataSet& data_set) - : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), field(new QCheckBox(this)) { - this->field->setText(GetLabel(this->meta).c_str()); - this->field->setFont(this->tree->font()); - this->field->setToolTip(this->meta.description.c_str()); - this->field->show(); - this->connect(this->field, SIGNAL(clicked()), this, SLOT(OnClicked())); - - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingBool::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, this->data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->blockSignals(true); - this->field->setChecked(this->data().value); - this->field->blockSignals(false); - } -} - -void WidgetSettingBool::OnClicked() { - this->data().value = this->field->isChecked(); - - emit itemChanged(); -} - -SettingDataBool& WidgetSettingBool::data() { - SettingDataBool* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_bool.h b/vkconfig3/widget_setting_bool.h deleted file mode 100644 index 3b0d56c72e..0000000000 --- a/vkconfig3/widget_setting_bool.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_bool.h" - -#include "widget_setting.h" - -#include - -class WidgetSettingBool : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetSettingBool(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaBool& meta, SettingDataSet& data_set); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnClicked(); - - Q_SIGNALS: - void itemChanged(); - - private: - SettingDataBool& data(); - - const SettingMetaBool& meta; - SettingDataSet& data_set; - - QCheckBox* field; -}; diff --git a/vkconfig3/widget_setting_enum.cpp b/vkconfig3/widget_setting_enum.cpp deleted file mode 100644 index ff838de327..0000000000 --- a/vkconfig3/widget_setting_enum.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting_enum.h" -#include "widget_setting.h" -#include "configurator.h" - -#include "../vkconfig_core/setting_filesystem.h" - -#include - -static const int MIN_FIELD_WIDTH = 80; - -static std::vector GetProfileNames(SettingDataSet& data_set) { - std::vector profiles_name; - - SettingDataFileLoad* data_file_load = static_cast(FindSetting(data_set, "profile_file")); - if (data_file_load != nullptr) { - profiles_name = data_file_load->profile_names; - } - - SettingDataFolderLoad* data_folder_load = static_cast(FindSetting(data_set, "profile_dirs")); - if (data_folder_load != nullptr) { - profiles_name = data_folder_load->profile_names; - } - - return profiles_name; -} - -WidgetSettingEnum::WidgetSettingEnum(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaEnum& meta, - SettingDataSet& data_set) - : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), field(new ComboBox(this)), last_resize(0, 0) { - this->field->setFocusPolicy(Qt::StrongFocus); - this->field->show(); - - this->item->setText(0, GetLabel(this->meta).c_str()); - this->item->setFont(0, this->tree->font()); - this->item->setToolTip(0, this->meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); - - this->connect(this->field, SIGNAL(currentIndexChanged(int)), this, SLOT(OnIndexChanged(int))); -} - -void WidgetSettingEnum::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->blockSignals(true); - this->field->blockSignals(true); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (meta.default_value == "${VP_DEFAULT}") { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->clear(); - this->enum_indexes.clear(); - - const std::vector& profiles = GetProfileNames(data_set); - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - - int selection = 0; - const std::string value = this->data().GetValue(); - for (std::size_t i = 0, n = profiles.size(); i < n; ++i) { - this->field->addItem(profiles[i].c_str()); - if (profiles[i] == value) { - selection = static_cast(this->enum_indexes.size()); - } - this->enum_indexes.push_back(i); - } - this->field->setCurrentIndex(selection); - if (!profiles.empty()) { - OnIndexChanged(selection); - } - - // Ensure this->field size match the profiles names size - this->Resize(); - } else if (meta.default_value == "${VP_PHYSICAL_DEVICES}") { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->clear(); - this->enum_indexes.clear(); - - const std::vector& devices = Configurator::Get().GetDeviceNames(); - - int selection = 0; - const std::string value = this->data().GetValue(); - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - this->field->addItem(devices[i].c_str()); - if (devices[i] == value || "${VP_PHYSICAL_DEVICES}" == value) { - this->data().SetValue(devices[i].c_str()); - selection = static_cast(this->enum_indexes.size()); - } - this->enum_indexes.push_back(i); - } - this->field->setCurrentIndex(selection); - if (!devices.empty()) { - OnIndexChanged(selection); - } - } else if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->clear(); - this->enum_indexes.clear(); - - int selection = 0; - const std::string value = this->data().GetValue(); - - for (std::size_t i = 0, n = this->meta.enum_values.size(); i < n; ++i) { - if (!IsSupported(&this->meta.enum_values[i])) continue; - - this->field->addItem(this->meta.enum_values[i].label.c_str()); - if (this->meta.enum_values[i].key == value) { - selection = static_cast(this->enum_indexes.size()); - } - this->enum_indexes.push_back(i); - } - this->field->setCurrentIndex(selection); - } - - this->blockSignals(false); - this->field->blockSignals(false); -} - -void WidgetSettingEnum::Resize() { - // resizeEvent was never call yet - if (this->last_resize.width() == 0 || this->last_resize.height() == 0) { - return; - } - - int width = MIN_FIELD_WIDTH; - - const QFontMetrics fm = this->field->fontMetrics(); - - if (meta.default_value == "${VP_DEFAULT}") { - const std::vector& profiles = GetProfileNames(data_set); - for (std::size_t i = 0, n = profiles.size(); i < n; ++i) { - width = std::max(width, HorizontalAdvance(fm, (profiles[i] + "0000").c_str())); - } - } else if (meta.default_value == "${VP_PHYSICAL_DEVICES}") { - const std::vector& devices = Configurator::Get().GetDeviceNames(); - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - width = std::max(width, HorizontalAdvance(fm, (devices[i] + "000").c_str())); - } - } else { - for (std::size_t i = 0, n = this->meta.enum_values.size(); i < n; ++i) { - width = std::max(width, HorizontalAdvance(fm, (this->meta.enum_values[i].label + "0000").c_str())); - } - } - - const int prefix_width = HorizontalAdvance(fm, this->item->text(0) + "0"); - - width = std::min(width, this->last_resize.width() - prefix_width); - - const QRect button_rect(this->last_resize.width() - width, 0, width, this->last_resize.height()); - this->field->setGeometry(button_rect); -} - -void WidgetSettingEnum::resizeEvent(QResizeEvent* event) { - this->last_resize = event->size(); - - this->Resize(); -} - -void WidgetSettingEnum::OnIndexChanged(int index) { - if (meta.default_value == "${VP_DEFAULT}") { - const std::vector& profiles = GetProfileNames(data_set); - assert(index >= 0 && index < static_cast(profiles.size())); - - this->data().SetValue(profiles[index].c_str()); - this->setToolTip(profiles[index].c_str()); - } else if (meta.default_value == "${VP_PHYSICAL_DEVICES}") { - const std::vector& devices = Configurator::Get().GetDeviceNames(); - assert(index >= 0 && index < static_cast(devices.size())); - - this->data().SetValue(devices[index].c_str()); - this->setToolTip(devices[index].c_str()); - } else { - assert(index >= 0 && index < static_cast(this->meta.enum_values.size())); - - const std::size_t value_index = enum_indexes[static_cast(index)]; - this->data().SetValue(this->meta.enum_values[value_index].key.c_str()); - this->setToolTip(this->meta.enum_values[value_index].description.c_str()); - } - - emit itemChanged(); -} - -SettingDataEnum& WidgetSettingEnum::data() { - SettingDataEnum* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_enum.h b/vkconfig3/widget_setting_enum.h deleted file mode 100644 index 5f707cfbd3..0000000000 --- a/vkconfig3/widget_setting_enum.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "widget_setting.h" -#include "combo_box.h" - -#include "../vkconfig_core/setting_flags.h" - -#include - -class WidgetSettingEnum : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetSettingEnum(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaEnum& meta, SettingDataSet& data_set); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnIndexChanged(int index); - - Q_SIGNALS: - void itemChanged(); - - private: - void resizeEvent(QResizeEvent* event) override; - - void Resize(); - - SettingDataEnum& data(); - - const SettingMetaEnum& meta; - SettingDataSet& data_set; - - ComboBox* field; - std::vector enum_indexes; - QSize last_resize; -}; diff --git a/vkconfig3/widget_setting_filesystem.cpp b/vkconfig3/widget_setting_filesystem.cpp deleted file mode 100644 index 3c35154e80..0000000000 --- a/vkconfig3/widget_setting_filesystem.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting_filesystem.h" -#include "widget_setting.h" - -#include "../vkconfig_core/path.h" -#include "../vkconfig_core/alert.h" -#include "../vkconfig/configurator.h" - -#include - -#include - -WidgetSettingFilesystem::WidgetSettingFilesystem(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFilesystem& meta, - SettingDataSet& data_set) - : WidgetSettingBase(tree, item), - meta(meta), - data_set(data_set), - item_child(new QTreeWidgetItem()), - field(new QLineEdit(this)), - button(new QPushButton(this)) { - this->field->show(); - this->connect(this->field, SIGNAL(textEdited(const QString&)), this, SLOT(textFieldChanged(const QString&))); - - this->button->setText("..."); - this->button->show(); - this->connect(this->button, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); - - this->item->setText(0, GetLabel(this->meta).c_str()); - this->item->setToolTip(0, meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->item->addChild(item_child); - tree->setItemWidget(this->item, 0, this); - - this->item_child->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item_child->setExpanded(true); - tree->setItemWidget(this->item_child, 0, this->field); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingFilesystem::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->item_child->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->button->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - LoadPath(this->data().GetValue()); - - this->field->blockSignals(true); - this->field->setText(this->data().GetValue()); - this->field->setToolTip(ReplaceBuiltInVariable(this->data().GetValue()).c_str()); - - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } else { - this->field->setToolTip(ReplaceBuiltInVariable(this->field->text().toStdString()).c_str()); - } - - this->field->blockSignals(false); - } -} - -void WidgetSettingFilesystem::resizeEvent(QResizeEvent* event) { - const QSize parent_size = event->size(); - - const QRect button_rect = QRect(parent_size.width() - MIN_BUTTON_SIZE, 0, MIN_BUTTON_SIZE, parent_size.height()); - this->button->setGeometry(button_rect); -} - -void WidgetSettingFilesystem::LoadPath(const std::string& path) { - switch (this->meta.type) { - case SETTING_LOAD_FILE: { - const SettingMetaFileLoad& setting_meta = static_cast(this->meta); - if (setting_meta.format == "PROFILE") { - if (path.empty()) return; - - SettingDataFileLoad& file_setting_data = static_cast(this->data()); - file_setting_data.profile_names = GetProfileNamesFromFile(path); - - SettingDataString* enum_setting_data = FindSetting(this->data_set, "profile_name"); - if (!file_setting_data.profile_names.empty() && enum_setting_data != nullptr) { - enum_setting_data->SetValue(file_setting_data.profile_names[0].c_str()); - } else { - enum_setting_data->SetValue(""); - } - } - break; - } - case SETTING_LOAD_FOLDER: { - const SettingMetaFolderLoad& setting_meta = static_cast(this->meta); - if (setting_meta.format == "PROFILE") { - if (path.empty()) return; - - SettingDataFolderLoad& setting_data = static_cast(this->data()); - setting_data.profile_names = GetProfileNamesFromDir(path); - - SettingDataString* enum_setting_data = FindSetting(this->data_set, "profile_name"); - if (enum_setting_data != nullptr) { - if (std::find(setting_data.profile_names.begin(), setting_data.profile_names.end(), - enum_setting_data->GetValue()) == setting_data.profile_names.end()) { - enum_setting_data->SetValue("${VP_DEFAULT}"); - } - } - } - break; - } - default: - break; - } -} - -void WidgetSettingFilesystem::browseButtonClicked() { - std::string path = field->text().toStdString(); - if (path.empty()) { - path = "${VK_LOCAL}"; - } - if (!QFileInfo(ReplaceBuiltInVariable(path).c_str()).exists()) { - path = this->data().GetValue(); - } - if (!QFileInfo(ReplaceBuiltInVariable(path).c_str()).exists()) { - path.clear(); - } - - const std::string replaced_path = ReplaceBuiltInVariable(path); - - const char* filter = this->meta.filter.c_str(); - std::string new_path; - - switch (this->meta.type) { - case SETTING_LOAD_FILE: - new_path = QFileDialog::getOpenFileName(this->button, "Select file", replaced_path.c_str(), filter).toStdString(); - break; - case SETTING_SAVE_FILE: - new_path = QFileDialog::getSaveFileName(this->button, "Select File", replaced_path.c_str(), filter).toStdString(); - break; - case SETTING_LOAD_FOLDER: - case SETTING_SAVE_FOLDER: - new_path = QFileDialog::getExistingDirectory(this->button, "Select Folder", replaced_path.c_str()).toStdString(); - break; - default: - assert(0); - break; - } - - // The user has cancel the operation - if (new_path.empty()) { - return; - } - - new_path = ConvertNativeSeparators(new_path); - - // The path didn't change, preserve the built-in variables - if (replaced_path == new_path) { - return; - } - - this->data().SetValue(new_path.c_str()); - - this->field->setText(this->data().GetValue()); - this->field->setToolTip(ReplaceBuiltInVariable(this->field->text().toStdString()).c_str()); - - LoadPath(new_path); - - emit itemChanged(); -} - -void WidgetSettingFilesystem::textFieldChanged(const QString& value) { - std::string file = value.toStdString(); - - if (!file.empty()) { - LoadPath(file); - - if (VKC_ENV == VKC_ENV_WIN32) { - file = ConvertNativeSeparators(file); - } - } - - if (QFileInfo(ReplaceBuiltInVariable(file).c_str()).exists()) { - this->data().SetValue(file.c_str()); - this->field->setToolTip(ReplaceBuiltInVariable(file.c_str()).c_str()); - } - - emit itemChanged(); -} - -SettingDataString& WidgetSettingFilesystem::data() { - SettingDataString* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_filesystem.h b/vkconfig3/widget_setting_filesystem.h deleted file mode 100644 index 6d82e368da..0000000000 --- a/vkconfig3/widget_setting_filesystem.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_filesystem.h" - -#include "widget_setting.h" - -#include -#include -#include - -class WidgetSettingFilesystem : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetSettingFilesystem(QTreeWidget *tree, QTreeWidgetItem *item, const SettingMetaFilesystem &meta, - SettingDataSet &data_set); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void browseButtonClicked(); - void textFieldChanged(const QString &value); - - Q_SIGNALS: - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent *event) override; - - private: - SettingDataString &data(); - void LoadPath(const std::string &path); - - const SettingMetaFilesystem &meta; - SettingDataSet &data_set; - - QTreeWidgetItem *item_child; - QLineEdit *field; - QPushButton *button; -}; diff --git a/vkconfig3/widget_setting_flags.cpp b/vkconfig3/widget_setting_flags.cpp deleted file mode 100644 index e47396b57b..0000000000 --- a/vkconfig3/widget_setting_flags.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting_flags.h" -#include "widget_setting.h" - -#include "../vkconfig_core/layer.h" -#include "../vkconfig_core/util.h" - -#include - -#include - -WidgetSettingFlag::WidgetSettingFlag(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFlags& meta, - SettingDataSet& data_set, const std::string& flag) - : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), flag(flag), field(new QCheckBox(this)) { - assert(!flag.empty()); - - const SettingEnumValue* enum_value = FindByKey(meta.enum_values, flag.c_str()); - assert(enum_value); - - const std::string status = meta.status == STATUS_STABLE ? "" : std::string(" (") + GetToken(enum_value->status) + ")"; - - this->field->setText((enum_value->label + status).c_str()); - this->field->setToolTip(enum_value->description.c_str()); - this->field->setFont(tree->font()); - this->field->show(); - this->connect(this->field, SIGNAL(clicked(bool)), this, SLOT(OnClicked(bool))); - - this->item->setExpanded(enum_value->expanded); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingFlag::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - const std::vector& value = this->data().value; - - this->field->blockSignals(true); - this->field->setChecked(std::find(value.begin(), value.end(), flag) != value.end()); - this->field->blockSignals(false); - } -} - -void WidgetSettingFlag::OnClicked(bool checked) { - if (checked) { - AppendString(this->data().value, flag); - } else { - RemoveString(this->data().value, flag); - } - - emit itemChanged(); -} - -SettingDataFlags& WidgetSettingFlag::data() { - SettingDataFlags* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_flags.h b/vkconfig3/widget_setting_flags.h deleted file mode 100644 index 393ca38209..0000000000 --- a/vkconfig3/widget_setting_flags.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_flags.h" - -#include "widget_setting.h" - -#include - -class WidgetSettingFlag : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetSettingFlag(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFlags& meta, SettingDataSet& data_set, - const std::string& flag); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnClicked(bool checked); - - Q_SIGNALS: - void itemChanged(); - - private: - SettingDataFlags& data(); - - const SettingMetaFlags& meta; - SettingDataSet& data_set; - - std::string flag; - QCheckBox* field; -}; diff --git a/vkconfig3/widget_setting_float.h b/vkconfig3/widget_setting_float.h deleted file mode 100644 index 66c76a1db1..0000000000 --- a/vkconfig3/widget_setting_float.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "widget_setting.h" - -#include "../vkconfig_core/setting_float.h" - -#include -#include -#include -#include - -class WidgetSettingFloat : public WidgetSettingBase { - Q_OBJECT - - public: - WidgetSettingFloat(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFloat& meta, SettingDataSet& data_set); - virtual ~WidgetSettingFloat(); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnTextEdited(const QString& value); - void OnErrorValue(); - void OnValidValue(); - - Q_SIGNALS: - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent* event) override; - - private: - void Resize(); - SettingInputError ProcessInputValue(); - SettingDataFloat& data(); - - const SettingMetaFloat& meta; - SettingDataSet& data_set; - - std::string value_buffer; - QLineEdit* field; - QTimer* timer_error; - QTimer* timer_valid; - QSize resize; - QPalette default_palette; -}; diff --git a/vkconfig3/widget_setting_frames.h b/vkconfig3/widget_setting_frames.h deleted file mode 100644 index 64312ebdfc..0000000000 --- a/vkconfig3/widget_setting_frames.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_frames.h" - -#include "widget_setting.h" - -#include -#include -#include -#include -#include - -class WidgetSettingFrames : public WidgetSettingBase { - Q_OBJECT - - public: - WidgetSettingFrames(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaFrames& meta, SettingDataSet& data_set); - virtual ~WidgetSettingFrames(); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnTextEdited(const QString& value); - void OnErrorValue(); - void OnValidValue(); - - Q_SIGNALS: - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent* event) override; - - private: - void Resize(); - SettingInputError ProcessInputValue(); - SettingDataFrames& data(); - - const SettingMetaFrames& meta; - SettingDataSet& data_set; - - std::string value_buffer; - QLineEdit* field; - QTimer* timer_error; - QTimer* timer_valid; - QSize resize; - QPalette default_palette; -}; diff --git a/vkconfig3/widget_setting_int.h b/vkconfig3/widget_setting_int.h deleted file mode 100644 index 7174af51a9..0000000000 --- a/vkconfig3/widget_setting_int.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_int.h" - -#include "widget_setting.h" - -#include -#include -#include - -class WidgetSettingInt : public WidgetSettingBase { - Q_OBJECT - - public: - WidgetSettingInt(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaInt& meta, SettingDataSet& data_set); - virtual ~WidgetSettingInt(); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnTextEdited(const QString& value); - void OnErrorValue(); - void OnValidValue(); - - Q_SIGNALS: - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent* event) override; - - private: - void Resize(); - SettingInputError ProcessInputValue(); - SettingDataInt& data(); - - const SettingMetaInt& meta; - SettingDataSet& data_set; - - std::string value_buffer; - QLineEdit* field; - QTimer* timer_error; - QTimer* timer_valid; - QSize resize; - QPalette default_palette; -}; diff --git a/vkconfig3/widget_setting_list.cpp b/vkconfig3/widget_setting_list.cpp deleted file mode 100644 index f33af7f398..0000000000 --- a/vkconfig3/widget_setting_list.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting_list.h" -#include "widget_setting_list_element.h" -#include "widget_setting.h" - -#include "../vkconfig_core/util.h" - -#include - -#include - -const char *GetFieldToolTip(const SettingMetaList &meta, bool current_list_empty) { - if (meta.list.empty()) { - return "Start tapping to add a new value"; - } else if (meta.list_only && current_list_empty) { - return "All the accepted values are already listed"; - } else { - return "Start tapping to search for available values"; - } -} - -WidgetSettingList::WidgetSettingList(QTreeWidget *tree, QTreeWidgetItem *item, const SettingMetaList &meta, - SettingDataSet &data_set) - : WidgetSettingBase(tree, item), - meta(meta), - data_set(data_set), - search(nullptr), - field(new QLineEdit(this)), - add_button(new QPushButton(this)), - list(meta.list) { - std::vector value = this->data().value; - for (std::size_t i = 0, n = value.size(); i < n; ++i) { - ::RemoveValue(this->list, value[i]); - } - - const char *tooltip = GetFieldToolTip(this->meta, this->list.empty()); - - this->field->show(); - this->field->setText(""); - this->field->setToolTip(tooltip); - this->field->setFont(this->tree->font()); - this->field->setFocusPolicy(Qt::StrongFocus); - this->field->installEventFilter(this); - this->ResetCompleter(); - - this->connect(this->field, SIGNAL(textChanged(const QString &)), this, SLOT(OnTextEdited(const QString &))); - this->connect(this->field, SIGNAL(returnPressed()), this, SLOT(OnElementAppended()), Qt::QueuedConnection); - - this->add_button->show(); - this->add_button->setText("+"); - this->add_button->setFont(this->tree->font()); - - this->connect(this->add_button, SIGNAL(pressed()), this, SLOT(OnElementAppended()), Qt::QueuedConnection); - - std::sort(value.begin(), value.end()); - this->data().value = value; - - this->item->setText(0, (this->meta.label + " ").c_str()); - this->item->setFont(0, this->tree->font()); - this->item->setToolTip(0, this->meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingList::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE && (!this->meta.list_only || !this->list.empty())); - this->add_button->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE && !this->field->text().isEmpty()); - - if (this->meta.list_only && this->list.empty()) { - this->field->hide(); - this->add_button->hide(); - } else { - this->field->show(); - this->add_button->show(); - } - - std::vector &value = this->data().value; - - if (value != this->value_cached) { - this->value_cached = value; - - this->tree->blockSignals(true); - - while (this->item->childCount() > 0) { - this->item->removeChild(this->item->child(0)); - } - - for (std::size_t i = 0, n = value.size(); i < n; ++i) { - this->AddElement(value[i]); - } - - this->tree->blockSignals(false); - } - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - } -} - -void WidgetSettingList::Resize() { - const int button_size = MIN_BUTTON_SIZE; - - const QFontMetrics fm = this->fontMetrics(); - const int text_width = HorizontalAdvance(fm, item->text(0)); - - this->field->setGeometry(text_width, 0, this->size.width() - button_size - text_width, this->size.height()); - this->add_button->setGeometry(this->size.width() - button_size, 0, button_size, this->size.height()); -} - -void WidgetSettingList::resizeEvent(QResizeEvent *event) { - this->size = event->size(); - this->Resize(); -} - -bool WidgetSettingList::eventFilter(QObject *target, QEvent *event) { - (void)target; - if (event->type() == QEvent::Wheel) { - event->ignore(); - return true; - } - - return this->field->eventFilter(target, event); -} - -void WidgetSettingList::ResetCompleter() { - if (this->search != nullptr) this->search->deleteLater(); - - this->search = new QCompleter(ConvertValues(this->list), this); - this->search->setCompletionMode(QCompleter::PopupCompletion); - this->search->setModelSorting(QCompleter::CaseSensitivelySortedModel); - this->search->setFilterMode(Qt::MatchContains); - this->search->setCaseSensitivity(Qt::CaseSensitive); - this->search->setMaxVisibleItems(20); - - this->field->setCompleter(this->search); - - this->connect(this->search, SIGNAL(activated(const QString &)), this, SLOT(OnCompleted(const QString &)), Qt::QueuedConnection); -} - -void WidgetSettingList::AddElement(EnabledNumberOrString &element) { - QTreeWidgetItem *child = new QTreeWidgetItem(); - child->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->addChild(child); - - WidgetSettingListElement *widget = new WidgetSettingListElement(this->tree, child, this->meta, this->data_set, element); - this->tree->setItemWidget(child, 0, widget); - - this->connect(widget, SIGNAL(itemChanged()), this, SLOT(OnSettingChanged())); - this->connect(widget, SIGNAL(itemSelected(const QString &)), this, SLOT(OnElementRemoved(const QString &))); -} - -void WidgetSettingList::OnCompleted(const QString &value) { - (void)value; - // We can't do this right away, the completer emits it's signal - // before it's really "complete". If we clear the control too soon - // it clears the completers value too. This might be a Qt bug, but this - // works really well as a work-a-round - OnElementAppended(); -} - -void WidgetSettingList::OnElementAppended() { - const std::string entry = this->field->text().toStdString(); - if (entry.empty()) return; - - if (this->meta.list_only && !IsValueFound(this->meta.list, entry)) { - QMessageBox alert; - alert.setWindowTitle("Invalid value"); - alert.setText(format("'%s' setting doesn't accept '%s' as a value", this->meta.label.c_str(), entry.c_str()).c_str()); - alert.setInformativeText("Please select a value from the list."); - alert.setIcon(QMessageBox::Warning); - alert.exec(); - return; - } - - std::vector &value = this->data().value; - - // Add the value if it's not in the list already - if (IsValueFound(value, entry)) { - QMessageBox alert; - alert.setWindowTitle("Duplicated value"); - alert.setText(format("'%s' setting already has the value '%s' listed", this->meta.label.c_str(), entry.c_str()).c_str()); - alert.setIcon(QMessageBox::Warning); - alert.exec(); - return; - } - - this->field->setText(""); - - value.push_back(entry); - std::sort(value.begin(), value.end()); - ::RemoveValue(this->list, entry); - - emit itemChanged(); -} - -void WidgetSettingList::OnTextEdited(const QString &value) { - assert(this->add_button); - assert(this->field); - - if (value.isEmpty()) { - this->item->setText(0, (this->meta.label + " ").c_str()); - } else if (value.size() >= 1 && !this->item->text(0).isEmpty()) { - this->item->setText(0, ""); - } - - this->Resize(); - - this->add_button->setEnabled(!value.isEmpty()); -} - -void WidgetSettingList::OnElementRemoved(const QString &element) { - NumberOrString list_value(element.toStdString()); - this->list.push_back(list_value); - - RemoveValue(this->data().value, EnabledNumberOrString(list_value)); -} - -void WidgetSettingList::OnSettingChanged() { emit itemChanged(); } - -SettingDataList &WidgetSettingList::data() { - SettingDataList *data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_list.h b/vkconfig3/widget_setting_list.h deleted file mode 100644 index 6fcdb0f34b..0000000000 --- a/vkconfig3/widget_setting_list.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_list.h" - -#include "widget_setting.h" - -#include -#include -#include -#include -#include - -class WidgetSettingList : public WidgetSettingBase { - Q_OBJECT - - public: - explicit WidgetSettingList(QTreeWidget *tree, QTreeWidgetItem *item, const SettingMetaList &meta, SettingDataSet &data_set); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnCompleted(const QString &value); - void OnElementAppended(); - void OnTextEdited(const QString &value); - void OnSettingChanged(); - void OnElementRemoved(const QString &value); - - Q_SIGNALS: - void itemSelected(const QString &value); - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent *event) override; - bool eventFilter(QObject *target, QEvent *event) override; - - private: - void Resize(); - void AddElement(EnabledNumberOrString &element); - void ResetCompleter(); - - SettingDataList &data(); - - const SettingMetaList &meta; - SettingDataSet &data_set; - - QCompleter *search; - QLineEdit *field; - QPushButton *add_button; - QSize size; - - std::vector list; - std::vector value_cached; -}; diff --git a/vkconfig3/widget_setting_list_element.cpp b/vkconfig3/widget_setting_list_element.cpp deleted file mode 100644 index 50ab9672c4..0000000000 --- a/vkconfig3/widget_setting_list_element.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "widget_setting_list_element.h" -#include "widget_setting.h" - -#include "../vkconfig_core/layer.h" -#include "../vkconfig_core/util.h" - -#include - -WidgetSettingListElement::WidgetSettingListElement(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaList& meta, - SettingDataSet& data_set, EnabledNumberOrString& element) - : WidgetSettingBase(tree, item), - meta(meta), - data_set(data_set), - element(element), - button(new QPushButton(this)), - field(new QCheckBox(this)) { - const std::string text = element.key.empty() ? format("%d", element.number) : element.key; - const std::string status = meta.status == STATUS_STABLE ? "" : std::string(" (") + GetToken(this->meta.status) + ")"; - - this->field->setText((text + status).c_str()); - this->field->setFont(this->tree->font()); - this->field->setToolTip(text.c_str()); - this->field->setCheckable(true); - this->connect(this->field, SIGNAL(clicked(bool)), this, SLOT(OnElementChecked(bool))); - - this->button->setText("-"); - this->button->setFont(tree->font()); - this->button->show(); - this->connect(this->button, SIGNAL(clicked()), this, SLOT(OnElementRemoved())); - - this->item->setExpanded(true); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingListElement::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->button->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->blockSignals(true); - std::vector& value = this->data().value; - this->field->setChecked(std::find(value.begin(), value.end(), this->element)->enabled); - this->field->blockSignals(false); - } -} - -void WidgetSettingListElement::resizeEvent(QResizeEvent* event) { - const QSize parent_size = event->size(); - - const QRect field_rect = QRect(0, 0, parent_size.width() - MIN_BUTTON_SIZE, parent_size.height()); - this->field->setGeometry(field_rect); - - const QRect button_rect = QRect(parent_size.width() - MIN_BUTTON_SIZE, 0, MIN_BUTTON_SIZE, parent_size.height()); - this->button->setGeometry(button_rect); -} - -void WidgetSettingListElement::OnElementChecked(bool checked) { - this->element.enabled = checked; - - emit itemChanged(); -} - -void WidgetSettingListElement::OnElementRemoved() { - std::vector& value = this->data().value; - - auto it = std::find(value.begin(), value.end(), this->element); - assert(it != value.end()); - - value.erase(it); - - emit itemSelected(this->field->text()); // Remove the element from the parent WidgetSettingList - emit itemChanged(); // Notify the setting tree that settings have changed -} - -SettingDataList& WidgetSettingListElement::data() { - SettingDataList* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_list_element.h b/vkconfig3/widget_setting_list_element.h deleted file mode 100644 index f7f501497f..0000000000 --- a/vkconfig3/widget_setting_list_element.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_list.h" - -#include "widget_setting.h" - -#include -#include -#include - -class WidgetSettingListElement : public WidgetSettingBase { - Q_OBJECT - public: - explicit WidgetSettingListElement(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaList& meta, - SettingDataSet& data_set, EnabledNumberOrString& element); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnElementRemoved(); - void OnElementChecked(bool checked); - - Q_SIGNALS: - void itemSelected(const QString& value); - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent* event) override; - - private: - SettingDataList& data(); - - const SettingMetaList& meta; - SettingDataSet& data_set; - - EnabledNumberOrString& element; - QPushButton* button; - QCheckBox* field; -}; diff --git a/vkconfig3/widget_setting_string.cpp b/vkconfig3/widget_setting_string.cpp deleted file mode 100644 index 4876d69029..0000000000 --- a/vkconfig3/widget_setting_string.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "widget_setting_string.h" -#include "widget_setting.h" - -#include - -static const int MIN_FIELD_WIDTH = 120; - -WidgetSettingString::WidgetSettingString(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaString& meta, - SettingDataSet& data_set) - : WidgetSettingBase(tree, item), meta(meta), data_set(data_set), field(new QLineEdit(this)) { - this->field->setText(this->data().GetValue()); - QFont font = tree->font(); - if (meta.key == "force_device_uuid") { - font.setFamily("Consolas"); - font.setPointSize(10); - } - this->field->setFont(font); - this->field->setToolTip(this->field->text()); - this->field->show(); - - this->connect(this->field, SIGNAL(textEdited(const QString&)), this, SLOT(OnTextEdited(const QString&))); - - this->item->setText(0, GetLabel(this->meta).c_str()); - this->item->setFont(0, this->tree->font()); - this->item->setToolTip(0, meta.description.c_str()); - this->item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); - this->item->setExpanded(this->meta.expanded); - this->tree->setItemWidget(this->item, 0, this); - - this->Refresh(REFRESH_ENABLE_AND_STATE); -} - -void WidgetSettingString::Refresh(RefreshAreas refresh_areas) { - const SettingDependenceMode enabled = ::CheckDependence(this->meta, data_set); - - this->item->setHidden(enabled == SETTING_DEPENDENCE_HIDE); - this->item->setDisabled(enabled != SETTING_DEPENDENCE_ENABLE); - this->field->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - this->setEnabled(enabled == SETTING_DEPENDENCE_ENABLE); - - if (refresh_areas == REFRESH_ENABLE_AND_STATE) { - if (::CheckSettingOverridden(this->meta)) { - this->DisplayOverride(this->field, this->meta); - } - - this->field->setText(this->data().GetValue()); - } -} - -void WidgetSettingString::Resize() { - const QFontMetrics fm = this->field->fontMetrics(); - const int width = std::max(HorizontalAdvance(fm, this->field->text() + "00"), MIN_FIELD_WIDTH); - - const QRect field_rect = QRect(this->resize.width() - width, 0, width, this->resize.height()); - this->field->setGeometry(field_rect); -} - -void WidgetSettingString::resizeEvent(QResizeEvent* event) { - this->resize = event->size(); - this->Resize(); -} - -void WidgetSettingString::OnTextEdited(const QString& value) { - this->data().SetValue(value.toStdString().c_str()); - this->field->setToolTip(this->field->text()); - - emit itemChanged(); -} - -SettingDataString& WidgetSettingString::data() { - SettingDataString* data = FindSetting(this->data_set, this->meta.key.c_str()); - assert(data != nullptr); - return *data; -} diff --git a/vkconfig3/widget_setting_string.h b/vkconfig3/widget_setting_string.h deleted file mode 100644 index 82a9c2bda2..0000000000 --- a/vkconfig3/widget_setting_string.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#pragma once - -#include "../vkconfig_core/setting_string.h" - -#include "widget_setting.h" - -#include -#include - -class WidgetSettingString : public WidgetSettingBase { - Q_OBJECT - - public: - WidgetSettingString(QTreeWidget* tree, QTreeWidgetItem* item, const SettingMetaString& meta, SettingDataSet& data_set); - - void Refresh(RefreshAreas refresh_areas) override; - - public Q_SLOTS: - void OnTextEdited(const QString& value); - - Q_SIGNALS: - void itemChanged(); - - protected: - void resizeEvent(QResizeEvent* event) override; - - private: - void Resize(); - SettingDataString& data(); - - const SettingMetaString& meta; - SettingDataSet& data_set; - - QLineEdit* field; - QSize resize; -}; diff --git a/vkconfig/CMakeLists.txt b/vkconfig_cmd/CMakeLists.txt similarity index 63% rename from vkconfig/CMakeLists.txt rename to vkconfig_cmd/CMakeLists.txt index 591d8e5679..7e381602bf 100644 --- a/vkconfig/CMakeLists.txt +++ b/vkconfig_cmd/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -20,7 +20,7 @@ else() source_group("Docs Files" FILES ${FILES_DOCS}) - set(FILES_ALL ${FILES_UI} ${FILES_SOURCE} ${FILES_HEADER} ${FILES_DOCS} resources.qrc) + set(FILES_ALL ${FILES_UI} ${FILES_SOURCE} ${FILES_HEADER} ${FILES_DOCS}) if(NOT APPLE) if (NOT DEFINED CMAKE_INSTALL_BINDIR) @@ -28,19 +28,20 @@ else() endif() if(WIN32) - add_executable(vkconfig WIN32 ${FILES_ALL} ${CMAKE_CURRENT_SOURCE_DIR}/resourcefiles/vkconfig.rc) - target_compile_definitions(vkconfig PRIVATE _CRT_SECURE_NO_WARNINGS) - target_compile_options(vkconfig PRIVATE $<$:/MP>) - target_link_libraries(vkconfig Cfgmgr32) + add_executable(vkconfig-cmd ${FILES_ALL}) + target_compile_definitions(vkconfig-cmd PRIVATE _CRT_SECURE_NO_WARNINGS) + target_compile_options(vkconfig-cmd PRIVATE $<$:/MP>) + target_link_libraries(vkconfig-cmd Cfgmgr32) else() - add_executable(vkconfig ${FILES_ALL} ${FILES_UI}) + add_executable(vkconfig-cmd ${FILES_ALL} ${FILES_UI}) endif() - target_link_libraries(vkconfig Vulkan::Headers vkconfig_core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) - target_compile_definitions(vkconfig PRIVATE QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT) - set_target_properties(vkconfig PROPERTIES FOLDER "vkconfig") + target_link_libraries(vkconfig-cmd Vulkan::Headers vkconfig-core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) + target_compile_definitions(vkconfig-cmd PRIVATE QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT) + set_target_properties(vkconfig-cmd PROPERTIES FOLDER "vkconfig") + set_target_properties(vkconfig-cmd PROPERTIES OUTPUT_NAME "vkconfig") - install(TARGETS vkconfig DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(TARGETS vkconfig-cmd DESTINATION ${CMAKE_INSTALL_BINDIR}) if(WIN32) get_target_property(QMAKE_EXE Qt5::qmake IMPORTED_LOCATION) diff --git a/vkconfig/macOS/Info.plist b/vkconfig_cmd/macOS/Info.plist similarity index 100% rename from vkconfig/macOS/Info.plist rename to vkconfig_cmd/macOS/Info.plist diff --git a/vkconfig/macOS/Resources/VulkanIcon.icns b/vkconfig_cmd/macOS/Resources/VulkanIcon.icns similarity index 100% rename from vkconfig/macOS/Resources/VulkanIcon.icns rename to vkconfig_cmd/macOS/Resources/VulkanIcon.icns diff --git a/vkconfig3/macOS/vkconfig.cmake b/vkconfig_cmd/macOS/vkconfig.cmake similarity index 71% rename from vkconfig3/macOS/vkconfig.cmake rename to vkconfig_cmd/macOS/vkconfig.cmake index e64ce1eb80..ade4372653 100644 --- a/vkconfig3/macOS/vkconfig.cmake +++ b/vkconfig_cmd/macOS/vkconfig.cmake @@ -17,7 +17,7 @@ -add_executable(vkconfig +add_executable(vkconfig-cmd MACOSX_BUNDLE ${FILES_ALL} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/VulkanIcon.icns @@ -28,14 +28,14 @@ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/VulkanIc PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") -target_link_libraries(vkconfig vkconfig_core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) -target_link_libraries(vkconfig "-framework Cocoa -framework QuartzCore") +target_link_libraries(vkconfig-cmd vkconfig-core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) +target_link_libraries(vkconfig-cmd "-framework Cocoa -framework QuartzCore") get_target_property(QMAKE_EXE Qt5::qmake IMPORTED_LOCATION) get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY) find_program(MACDEPLOYQT_EXE macdeployqt HINTS "${QT_BIN_DIR}") -add_custom_command(TARGET vkconfig POST_BUILD +add_custom_command(TARGET vkconfig-cmd POST_BUILD COMMAND "${MACDEPLOYQT_EXE}" "${CMAKE_CURRENT_BINARY_DIR}/vkconfig.app/" -always-overwrite @@ -44,15 +44,16 @@ add_custom_command(TARGET vkconfig POST_BUILD COMMENT "Running macdeployqt..." ) -add_custom_command(TARGET vkconfig POST_BUILD +add_custom_command(TARGET vkconfig-cmd POST_BUILD COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/vkconfig.app/Contents/" COMMENT "Copying Info.plist to vkconfig.app..." ) -set_target_properties(vkconfig PROPERTIES SKIP_BUILD_RPATH FALSE) -set_target_properties(vkconfig PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) -set_target_properties(vkconfig PROPERTIES INSTALL_RPATH "") -set_target_properties(vkconfig PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) -install(TARGETS vkconfig BUNDLE DESTINATION "bin") +set_target_properties(vkconfig-cmd PROPERTIES OUTPUT_NAME "vkconfig") +set_target_properties(vkconfig-cmd PROPERTIES SKIP_BUILD_RPATH FALSE) +set_target_properties(vkconfig-cmd PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) +set_target_properties(vkconfig-cmd PROPERTIES INSTALL_RPATH "") +set_target_properties(vkconfig-cmd PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) +install(TARGETS vkconfig-cmd BUNDLE DESTINATION "bin") diff --git a/vkconfig/main.cpp b/vkconfig_cmd/main.cpp similarity index 87% rename from vkconfig/main.cpp rename to vkconfig_cmd/main.cpp index 1335279ac0..204d496771 100644 --- a/vkconfig/main.cpp +++ b/vkconfig_cmd/main.cpp @@ -18,21 +18,14 @@ * - Christophe Riccio */ -#include "main_gui.h" #include "main_reset.h" #include "main_layers.h" #include "main_doc.h" -#include "main_signal.h" #include "../vkconfig_core/path.h" - -#include +#include "../vkconfig_core/configurator_signal.h" int main(int argc, char* argv[]) { - ::vkconfig_version = "vkconfig"; - - InitSignals(); - const CommandLine command_line(argc, argv); if (command_line.error != ERROR_NONE) { @@ -41,6 +34,8 @@ int main(int argc, char* argv[]) { return -1; } + InitSignals(); + switch (command_line.command) { case COMMAND_SHOW_USAGE: { command_line.usage(); @@ -56,10 +51,6 @@ int main(int argc, char* argv[]) { case COMMAND_RESET: { return run_reset(argc, argv, command_line); } - case COMMAND_VULKAN_SDK: - case COMMAND_GUI: { - return run_gui(argc, argv, command_line); - } case COMMAND_DOC: { return run_doc(command_line); } diff --git a/vkconfig/main_doc.cpp b/vkconfig_cmd/main_doc.cpp similarity index 75% rename from vkconfig/main_doc.cpp rename to vkconfig_cmd/main_doc.cpp index 4a8c007e70..29e145db3f 100644 --- a/vkconfig/main_doc.cpp +++ b/vkconfig_cmd/main_doc.cpp @@ -20,8 +20,8 @@ */ #include "main_doc.h" -#include "configurator.h" +#include "../vkconfig_core/configurator.h" #include "../vkconfig_core/layer_manager.h" #include "../vkconfig_core/doc.h" #include "../vkconfig_core/configuration_manager.h" @@ -29,12 +29,7 @@ #include int run_doc_html(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); + LayerManager layers; for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { const Layer& layer = layers.selected_layers[i]; @@ -50,12 +45,7 @@ int run_doc_html(const CommandLine& command_line) { } int run_doc_markdown(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); + LayerManager layers; for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { const Layer& layer = layers.selected_layers[i]; @@ -72,24 +62,20 @@ int run_doc_markdown(const CommandLine& command_line) { int run_doc_settings(const CommandLine& command_line) { int rval = 0; - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - ConfigurationManager configuration_manager(environment); - Configuration config; - LayerManager layers(environment); - Layer* layer; - layers.LoadLayer(command_line.doc_layer_name); - layer = FindByKey(layers.selected_layers, command_line.doc_layer_name.c_str()); + LayerManager layers; + + Layer* layer = layers.Find(command_line.doc_layer_name.c_str()); if (!layer) { fprintf(stderr, "vkconfig: Could not load layer %s\n", command_line.doc_layer_name.c_str()); fprintf(stderr, "Run \"vkconfig layers --list\" to get list of available layers\n"); return -1; } - config = configuration_manager.CreateConfiguration(layers.selected_layers, "Config"); + + ConfigurationManager configuration_manager; + Configuration config = configuration_manager.CreateConfiguration(layers.selected_layers, "Config"); config.parameters = GatherParameters(config.parameters, layers.selected_layers); - config.parameters[0].state = LAYER_STATE_OVERRIDDEN; + config.parameters[0].control = LAYER_CONTROL_ON; ExportSettingsDoc(layers.selected_layers, config, command_line.doc_out_dir + "/vk_layer_settings.txt"); return rval; diff --git a/vkconfig3/main_doc.h b/vkconfig_cmd/main_doc.h similarity index 84% rename from vkconfig3/main_doc.h rename to vkconfig_cmd/main_doc.h index ce23885758..75f5548bfc 100644 --- a/vkconfig3/main_doc.h +++ b/vkconfig_cmd/main_doc.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2022 Valve Corporation - * Copyright (c) 2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ * * Authors: * - David Pinedo + * - Christophe Riccio */ #pragma once diff --git a/vkconfig3/main_layers.cpp b/vkconfig_cmd/main_layers.cpp similarity index 63% rename from vkconfig3/main_layers.cpp rename to vkconfig_cmd/main_layers.cpp index 1e5b041607..b981f00f1e 100644 --- a/vkconfig3/main_layers.cpp +++ b/vkconfig_cmd/main_layers.cpp @@ -19,47 +19,38 @@ */ #include "main_layers.h" -#include "configurator.h" +#include "../vkconfig_core/configurator.h" #include "../vkconfig_core/configuration.h" -#include "../vkconfig_core/override.h" #include "../vkconfig_core/layer_manager.h" #include static int RunLayersOverride(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); + Configurator& configurator = Configurator::Get(); Configuration configuration; - const bool load_result = configuration.Load(layers.selected_layers, command_line.layers_configuration_path.c_str()); + const bool load_result = + configuration.Load(configurator.layers.selected_layers, command_line.layers_configuration_path.c_str()); if (!load_result) { printf("\nFailed to load the layers configuration file...\n"); return -1; } - // With command line, don't store the application list, it's always global, save and restore the setting - const bool use_application_list = environment.HasOverriddenApplications(); - environment.SetUseApplicationList(false); - - const bool override_result = OverrideConfiguration(environment, layers.selected_layers, configuration); - - environment.SetUseApplicationList(use_application_list); + const bool override_result = configurator.Override(); - environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit + configurator.environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit if (override_result) { printf("\nLayers configuration \"%s\" applied to all Vulkan Applications, including Vulkan layers:\n", command_line.layers_configuration_path.c_str()); for (std::size_t i = 0, n = configuration.parameters.size(); i < n; ++i) { const Parameter& parameter = configuration.parameters[i]; - if (parameter.state == LAYER_STATE_APPLICATION_CONTROLLED) continue; + if (parameter.control == LAYER_CONTROL_AUTO) { + continue; + } - printf("\t%s (%s)\n", parameter.key.c_str(), parameter.state == LAYER_STATE_OVERRIDDEN ? "Overridden" : "Excluded"); + printf("\t%s (%s)\n", parameter.key.c_str(), parameter.control == LAYER_CONTROL_ON ? "Overridden" : "Excluded"); } printf("\n (Use \"vkconfig layers --surrender\" to return Vulkan layers control to Vulkan applications.)\n"); } else { @@ -70,14 +61,12 @@ static int RunLayersOverride(const CommandLine& command_line) { } static int RunLayersSurrender(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); + Configurator& configurator = Configurator::Get(); - const bool has_overridden_layers = HasOverride(); - const bool surrender_result = SurrenderConfiguration(environment); + const bool has_overridden_layers = configurator.HasOverride(); + const bool surrender_result = configurator.Surrender(); - environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit + configurator.environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit if (has_overridden_layers) { if (surrender_result) { @@ -94,12 +83,7 @@ static int RunLayersSurrender(const CommandLine& command_line) { } static int RunLayersList(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); + LayerManager layers; if (layers.selected_layers.empty()) { printf("No Vulkan layer found\n"); @@ -115,21 +99,16 @@ static int RunLayersList(const CommandLine& command_line) { } static int RunLayersVerbose(const CommandLine& command_line) { - PathManager paths(command_line.command_vulkan_sdk, SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); - - LayerManager layers(environment); - layers.LoadAllInstalledLayers(); + LayerManager layers; for (std::size_t i = 0, n = layers.selected_layers.size(); i < n; ++i) { const Layer& layer = layers.selected_layers[i]; - printf("%s (%s) %s-%s\n", layer.key.c_str(), GetLayerTypeLabel(layer.type), layer.api_version.str().c_str(), + printf("%s (%s) %s-%s\n", layer.key.c_str(), GetToken(layer.type), layer.api_version.str().c_str(), layer.implementation_version.c_str()); printf("- %s\n", layer.description.c_str()); - printf("- %s\n", layer.manifest_path.c_str()); - printf("- %s\n", layer.binary_path.c_str()); + printf("- %s\n", layer.manifest_path.AbsolutePath().c_str()); + printf("- %s\n", layer.binary_path.AbsolutePath().c_str()); } return 0; diff --git a/vkconfig3/main_layers.h b/vkconfig_cmd/main_layers.h similarity index 89% rename from vkconfig3/main_layers.h rename to vkconfig_cmd/main_layers.h index a4528437b6..81de0eac62 100644 --- a/vkconfig3/main_layers.h +++ b/vkconfig_cmd/main_layers.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/vkconfig3/main_reset.cpp b/vkconfig_cmd/main_reset.cpp similarity index 95% rename from vkconfig3/main_reset.cpp rename to vkconfig_cmd/main_reset.cpp index 3480bd9585..e3f342a84d 100644 --- a/vkconfig3/main_reset.cpp +++ b/vkconfig_cmd/main_reset.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ #include "main_reset.h" -#include "configurator.h" - -#include +#include "../vkconfig_core/configurator.h" #include +#include + static int RunReset(int argc, char* argv[], bool hard) { QCoreApplication::setOrganizationName("LunarG"); QCoreApplication::setOrganizationDomain("lunarg.com"); diff --git a/vkconfig/main_reset.h b/vkconfig_cmd/main_reset.h similarity index 89% rename from vkconfig/main_reset.h rename to vkconfig_cmd/main_reset.h index d777edf378..4f29de61b9 100644 --- a/vkconfig/main_reset.h +++ b/vkconfig_cmd/main_reset.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/vkconfig_core/CMakeLists.txt b/vkconfig_core/CMakeLists.txt index 165ad94c8c..890ad70a15 100644 --- a/vkconfig_core/CMakeLists.txt +++ b/vkconfig_core/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt5 COMPONENTS Core Gui Widgets Network QUIET) @@ -6,59 +6,31 @@ if(Qt5_FOUND) file(GLOB FILES_SOURCE ./*.cpp) file(GLOB FILES_HEADER ./*.h) - file(GLOB FILES_CONFIGURATIONS_2_2_2 ./configurations/2.2.2/*.json) - source_group("Configurations 2.2.2 Files" FILES ${FILES_CONFIGURATIONS_2_2_2}) - - file(GLOB FILES_LAYERS_130 ./layers/130/*.json) - source_group("130 Files" FILES ${FILES_LAYERS_130}) - - file(GLOB FILES_LAYERS_135 ./layers/135/*.json) - source_group("135 Files" FILES ${FILES_LAYERS_135}) - - file(GLOB FILES_LAYERS_141 ./layers/141/*.json) - source_group("141 Files" FILES ${FILES_LAYERS_141}) - - file(GLOB FILES_LAYERS_148 ./layers/148/*.json) - source_group("148 Files" FILES ${FILES_LAYERS_148}) - - file(GLOB FILES_LAYERS_154 ./layers/154/*.json) - source_group("154 Files" FILES ${FILES_LAYERS_154}) - - file(GLOB FILES_LAYERS_162 ./layers/162/*.json) - source_group("162 Files" FILES ${FILES_LAYERS_162}) - - file(GLOB FILES_LAYERS_170 ./layers/170/*.json) - source_group("170 Files" FILES ${FILES_LAYERS_170}) + file(GLOB FILES_CONFIGURATIONS ./configurations/3.0.0/*.json) + source_group("Configurations Files" FILES ${FILES_CONFIGURATIONS}) file(GLOB FILES_LAYERS_SCHEMA ./layers/layers_schema.json) source_group("Schema Files" FILES ${FILES_LAYERS_SCHEMA}) set(FILES_RESOURCES - ${FILES_CONFIGURATIONS_2_2_2} - ${FILES_LAYERS_130} - ${FILES_LAYERS_135} - ${FILES_LAYERS_141} - ${FILES_LAYERS_148} - ${FILES_LAYERS_154} - ${FILES_LAYERS_162} - ${FILES_LAYERS_170} + ${FILES_CONFIGURATIONS} ${FILES_LAYERS_SCHEMA}) set(FILES_ALL ${FILES_SOURCE} ${FILES_HEADER} ${FILES_RESOURCES}) - add_library(vkconfig_core STATIC ${FILES_ALL}) - target_compile_options(vkconfig_core PRIVATE $<$:/MP>) - target_compile_definitions(vkconfig_core PRIVATE QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT) - target_compile_definitions(vkconfig_core PRIVATE INSTALL_FULL_SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") - target_compile_definitions(vkconfig_core PRIVATE INSTALL_FULL_DATAROOTDIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}") - set_target_properties(vkconfig_core PROPERTIES FOLDER "vkconfig_core") + add_library(vkconfig-core STATIC ${FILES_ALL}) + target_compile_options(vkconfig-core PRIVATE $<$:/MP>) + target_compile_definitions(vkconfig-core PRIVATE QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT) + target_compile_definitions(vkconfig-core PRIVATE INSTALL_FULL_SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") + target_compile_definitions(vkconfig-core PRIVATE INSTALL_FULL_DATAROOTDIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}") + set_target_properties(vkconfig-core PROPERTIES FOLDER "vkconfig") if(WIN32) - target_compile_definitions(vkconfig_core PRIVATE _CRT_SECURE_NO_WARNINGS) - target_link_libraries(vkconfig_core Cfgmgr32) + target_compile_definitions(vkconfig-core PRIVATE _CRT_SECURE_NO_WARNINGS) + target_link_libraries(vkconfig-core Cfgmgr32) endif() - target_link_libraries(vkconfig_core Vulkan::Headers valijson Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) + target_link_libraries(vkconfig-core Vulkan::Headers valijson Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) if(BUILD_TESTS) add_subdirectory(test) diff --git a/vkconfig_core/alert.cpp b/vkconfig_core/alert.cpp index efee9f2c2d..97c56af1f0 100644 --- a/vkconfig_core/alert.cpp +++ b/vkconfig_core/alert.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,53 +21,51 @@ #include "alert.h" #include -void Alert::LoaderFailure() { +QMessageBox::Button Alert::StartSingleton() { QMessageBox alert; - alert.QDialog::setWindowTitle("Vulkan Development Status failure..."); - alert.setText("Could not find a Vulkan Loader."); + alert.QDialog::setWindowTitle(format("Cannot start a new instance of %s", VKCONFIG_NAME).c_str()); alert.setIcon(QMessageBox::Critical); - alert.exec(); -} + alert.setDefaultButton(QMessageBox::Cancel); + alert.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); + alert.setText(format("Another instance of %s is currently running. Please close it to continue.", VKCONFIG_NAME).c_str()); + alert.setInformativeText(format("Press OK to continue launching the new instance of %s when the other instance is " + "stopped.\nPress CANCEL to stop the launch of a new %s instance.", + VKCONFIG_NAME, VKCONFIG_NAME) + .c_str()); -void Alert::InstanceFailure() { - QMessageBox alert; - alert.QDialog::setWindowTitle("Vulkan Development Status failure..."); - alert.setText("Cannot find a compatible Vulkan installable client driver (ICD)."); - alert.setIcon(QMessageBox::Critical); - alert.exec(); + return static_cast(alert.exec()); } -void Alert::PhysicalDeviceFailure() { +void Alert::StartLoaderFailure() { QMessageBox alert; - alert.setWindowTitle("Vulkan Development Status failure..."); - alert.setText("Cannot find any Vulkan Physical Devices."); + alert.QDialog::setWindowTitle("Vulkan Configurator failed to start..."); + alert.setText("Could not find a Vulkan Loader."); alert.setIcon(QMessageBox::Critical); alert.exec(); } -void Alert::ApplicationListUnsupported(const char* message) { +void Alert::StartLoaderIncompatibleVersions(const Version& system_loader_version, const Version& required_loader_version) { QMessageBox alert; - alert.QDialog::setWindowTitle("Layers override of a selected list of Vulkan Applications is not available"); - alert.setTextFormat(Qt::RichText); - alert.setText(message); - alert.setInformativeText( - "In order to apply layers override to only a selected list of Vulkan applications, get the latest Vulkan Runtime from " - "HERE. to use this feature or update your Vulkan drivers"); - alert.setIcon(QMessageBox::Warning); + alert.setWindowTitle("Vulkan Configurator failed to start..."); + alert.setText(format("The system has Vulkan Loader %s. The Vulkan Loader %s and older requires that the layers use the " + "same Vulkan Headers minor version.", + system_loader_version.str().c_str(), required_loader_version.str().c_str()) + .c_str()); + alert.setInformativeText("Please update the Vulkan Runtime at https://vulkan.lunarg.com/sdk/home"); + alert.setIcon(QMessageBox::Critical); alert.exec(); } -void Alert::ApplicationListEmpty() { +void Alert::StartPhysicalDeviceFailure() { QMessageBox alert; - alert.setIcon(QMessageBox::Warning); - alert.QDialog::setWindowTitle("Vulkan Layers overriding will apply globally."); - alert.setText("The application list to override is empty. Restricting layers overriding to the selected list is disabled."); - alert.setInformativeText("As a result, Vulkan Layers overriding will apply globally, to all Vulkan applications."); + alert.setWindowTitle("Vulkan Configurator failed to start..."); + alert.setText("Cannot find any Vulkan Physical Devices."); + alert.setIcon(QMessageBox::Critical); alert.exec(); } -void Alert::LayerInvalid(const char* path, const char* message) { - const std::string text = format("%s is not a valid layer manifest. \n\n", path) + message; +void Alert::LayerInvalid(const Path& path, const char* message) { + const std::string text = format("%s is not a valid layer manifest. \n\n", path.AbsolutePath().c_str()) + message; QMessageBox alert; alert.QDialog::setWindowTitle("Failed to load a layer manifest..."); @@ -77,8 +75,8 @@ void Alert::LayerInvalid(const char* path, const char* message) { alert.exec(); } -void Alert::PathInvalid(const char* path, const char* message) { - const std::string text = format("'%s' is not a valid path.", path); +void Alert::PathInvalid(const Path& path, const char* message) { + const std::string text = format("'%s' is not a valid path.", path.AbsolutePath().c_str()); QMessageBox alert; alert.QDialog::setWindowTitle("The select path doesn't exist..."); @@ -112,21 +110,6 @@ QMessageBox::Button Alert::LayerProfiles() { return static_cast(alert.exec()); } -QMessageBox::Button Alert::ConfiguratorSingleton() { - QMessageBox alert; - alert.QDialog::setWindowTitle(format("Cannot start a new instance of %s", VKCONFIG_NAME).c_str()); - alert.setIcon(QMessageBox::Critical); - alert.setDefaultButton(QMessageBox::Cancel); - alert.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); - alert.setText(format("Another instance of %s is currently running. Please close it to continue.", VKCONFIG_NAME).c_str()); - alert.setInformativeText(format("Press OK to continue launching the new instance of %s when the other instance is " - "stopped.\nPress CANCEL to stop the launch of a new %s instance.", - VKCONFIG_NAME, VKCONFIG_NAME) - .c_str()); - - return static_cast(alert.exec()); -} - void Alert::ConfiguratorRestart() { const char* text = "Vulkan Layers are fully configured when creating a Vulkan Instance which typically happens at Vulkan Application start."; @@ -241,10 +224,10 @@ static std::string BuildPropertiesLog(const Layer& layer) { } description += "\n"; - description += layer.manifest_path + "\n"; - description += format("- %s Layers Path \n", GetLayerTypeLabel(layer.type)); + description += layer.manifest_path.AbsolutePath() + "\n"; + description += format("- %s Layers Path \n", GetToken(layer.type)); description += "- File Format: " + layer.file_format_version.str() + "\n"; - description += "- Layer Binary Path:\n " + layer.binary_path + "\n"; + description += "- Layer Binary Path:\n " + layer.binary_path.AbsolutePath() + "\n"; description += "\n"; description += format("Total Settings Count: %d - Total Presets Count: %d", CountSettings(layer.settings), layer.presets.size()); @@ -274,18 +257,6 @@ void Alert::LayerProperties(const Layer* layer) { alert.exec(); } -QMessageBox::Button Alert::LayerIncompatibleVersions(const char* message, const Version& loader_version) { - QMessageBox alert; - alert.setWindowTitle("Incompatible layers versions"); - alert.setText(format("The system has Vulkan Loader %s. The Vulkan Loader 1.3.211 and older requires that the layers use the " - "same Vulkan Headers minor version.", - loader_version.str().c_str()) - .c_str()); - alert.setInformativeText(message); - alert.setIcon(QMessageBox::Critical); - return static_cast(alert.exec()); -} - void Alert::LogFileFailed() { QMessageBox alert; alert.setText("Cannot open log file"); diff --git a/vkconfig_core/alert.h b/vkconfig_core/alert.h index fafbcf5f43..209417c47e 100644 --- a/vkconfig_core/alert.h +++ b/vkconfig_core/alert.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,24 +21,22 @@ #pragma once #include "../vkconfig_core/layer.h" +#include "../vkconfig_core/path.h" #include struct Alert { - static void LoaderFailure(); - static void InstanceFailure(); - static void PhysicalDeviceFailure(); + static QMessageBox::Button StartSingleton(); + static void StartLoaderFailure(); + static void StartLoaderIncompatibleVersions(const Version& system_loader_version, const Version& required_loader_version); + static void StartPhysicalDeviceFailure(); - static void ApplicationListUnsupported(const char* message); - static void ApplicationListEmpty(); - - static void LayerInvalid(const char* path, const char* message); + static void LayerInvalid(const Path& path, const char* message); static QMessageBox::Button LayerImplicitExcluded(const char* layer_name); static QMessageBox::Button LayerProfiles(); - static void PathInvalid(const char* path, const char* message); + static void PathInvalid(const Path& path, const char* message); - static QMessageBox::Button ConfiguratorSingleton(); static void ConfiguratorRestart(); static QMessageBox::Button ConfiguratorResetAll(); static QMessageBox::Button ConfiguratorReloadDefault(); @@ -50,7 +48,6 @@ struct Alert { static void ConfigurationNameASCII(); static void LayerProperties(const Layer* layer); - static QMessageBox::Button LayerIncompatibleVersions(const char* message, const Version& loader_version); static void LogFileFailed(); diff --git a/vkconfig_core/application.cpp b/vkconfig_core/application.cpp index 1189886a21..3122339e57 100644 --- a/vkconfig_core/application.cpp +++ b/vkconfig_core/application.cpp @@ -22,7 +22,7 @@ #include #include - +/* Application::Application(const std::string& name, const std::string& executable_full_path, const std::string& arguments) : app_name(name), executable_path(executable_full_path), @@ -33,3 +33,4 @@ Application::Application(const std::string& name, const std::string& executable_ .toStdString() .c_str()), layers_mode(LAYERS_MODE_BY_CONFIGURATOR_RUNNING) {} +*/ diff --git a/vkconfig_core/application.h b/vkconfig_core/application.h index ce44266d8f..3486813625 100644 --- a/vkconfig_core/application.h +++ b/vkconfig_core/application.h @@ -20,22 +20,28 @@ #pragma once +#include "type_layers_mode.h" #include "path.h" +#include "configuration_info.h" #include +#include -enum LayersMode { LAYERS_MODE_BY_APPLICATIONS = 0, LAYERS_MODE_BY_CONFIGURATOR_RUNNING, LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED }; +struct ApplicationOptions { + std::string label; + Path working_folder; + std::vector arguments; + std::vector environment_variables; + Path log_file; +}; struct Application { - Application() {} - Application(const std::string& name, const std::string& executable_full_path, const std::string& arguments); - - std::string app_name; Path executable_path; - Path working_folder; - std::string arguments; - std::string env; - Path log_file; - LayersMode layers_mode; - std::string layers_configuration; + ConfigurationInfo configuration; + int active_option_index = 0; + std::vector options; + + ApplicationOptions& GetActiveOptions() { return this->options[active_option_index]; } + + const ApplicationOptions& GetActiveOptions() const { return this->options[active_option_index]; } }; diff --git a/vkconfig_core/bitfield.cpp b/vkconfig_core/bitfield.cpp new file mode 100644 index 0000000000..acd008ba19 --- /dev/null +++ b/vkconfig_core/bitfield.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "bitfield.h" + +std::size_t PopCount(int bitfield) { + std::size_t count = 0; + + for (std::size_t i = 0, n = sizeof(bitfield) * 8; i < n; ++i) { + if (bitfield & (1 << i)) { + ++count; + } + } + + return count; +} + +int FindPosition(int bit) { + assert(PopCount(bit) == 1); + + for (int i = 0, n = sizeof(bit) * 8; i < n; ++i) { + if (bit & (1 << i)) { + return i; + } + } + + return -1; +} diff --git a/vkconfig_core/bitfield.h b/vkconfig_core/bitfield.h new file mode 100644 index 0000000000..5be6315937 --- /dev/null +++ b/vkconfig_core/bitfield.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#pragma once + +#include +#include + +std::size_t PopCount(int bitfield); + +int FindPosition(int bit); + +template +inline int GetBit(T value, T first) { + return 1 << (value - first); +} + +template +inline VALUE GetValue(BIT bit, VALUE first) { + return static_cast(FindPosition(bit) + first); +} diff --git a/vkconfig_core/command_line.cpp b/vkconfig_core/command_line.cpp index 9dac1745c5..8efa3ccb43 100644 --- a/vkconfig_core/command_line.cpp +++ b/vkconfig_core/command_line.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022 Valve Corporation - * Copyright (c) 2020-2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -44,7 +45,7 @@ static const CommandHelpDesc command_help_desc[] = { static HelpType GetCommandHelpId(const char* token) { assert(token != nullptr); - for (std::size_t i = 0, n = countof(command_help_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(command_help_desc); i < n; ++i) { if (std::strcmp(command_help_desc[i].token, token) == 0) return command_help_desc[i].arguments; } @@ -58,24 +59,22 @@ struct ModeDesc { }; static const ModeDesc mode_desc[] = { - {COMMAND_NONE, "", HELP_DEFAULT}, // COMMAND_NONE - {COMMAND_SHOW_USAGE, "-h", HELP_HELP}, // COMMAND_SHOW_USAGE - {COMMAND_SHOW_USAGE, "--help", HELP_HELP}, // COMMAND_SHOW_USAGE - {COMMAND_SHOW_USAGE, "help", HELP_HELP}, // COMMAND_SHOW_USAGE - {COMMAND_VERSION, "-v", HELP_VERSION}, // COMMAND_VERSION - {COMMAND_VERSION, "--version", HELP_VERSION}, // COMMAND_VERSION - {COMMAND_VERSION, "version", HELP_VERSION}, // COMMAND_VERSION - {COMMAND_GUI, "gui", HELP_GUI}, // COMMAND_GUI - {COMMAND_LAYERS, "layers", HELP_LAYERS}, // COMMAND_LAYERS - {COMMAND_DOC, "doc", HELP_DOC}, // COMMAND_DOC - {COMMAND_RESET, "reset", HELP_RESET}, // COMMAND_RESET - {COMMAND_VULKAN_SDK, "VULKAN_SDK", HELP_RESET} // COMMAND_VULKAN_SDK + {COMMAND_NONE, "", HELP_DEFAULT}, // COMMAND_NONE + {COMMAND_SHOW_USAGE, "-h", HELP_HELP}, // COMMAND_SHOW_USAGE + {COMMAND_SHOW_USAGE, "--help", HELP_HELP}, // COMMAND_SHOW_USAGE + {COMMAND_SHOW_USAGE, "help", HELP_HELP}, // COMMAND_SHOW_USAGE + {COMMAND_VERSION, "-v", HELP_VERSION}, // COMMAND_VERSION + {COMMAND_VERSION, "--version", HELP_VERSION}, // COMMAND_VERSION + {COMMAND_VERSION, "version", HELP_VERSION}, // COMMAND_VERSION + {COMMAND_LAYERS, "layers", HELP_LAYERS}, // COMMAND_LAYERS + {COMMAND_DOC, "doc", HELP_DOC}, // COMMAND_DOC + {COMMAND_RESET, "reset", HELP_RESET} // COMMAND_RESET }; static CommandType GetModeId(const char* token) { assert(token != nullptr); - for (std::size_t i = 0, n = countof(mode_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(mode_desc); i < n; ++i) { if (std::strcmp(mode_desc[i].token, token) == 0) return mode_desc[i].mode; } @@ -83,7 +82,7 @@ static CommandType GetModeId(const char* token) { } static const ModeDesc& GetModeDesc(CommandType command_type) { - for (std::size_t i = 0, n = countof(mode_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(mode_desc); i < n; ++i) { if (mode_desc[i].mode == command_type) return mode_desc[i]; } @@ -105,7 +104,7 @@ static const CommandResetDesc command_reset_desc[] = {{COMMAND_RESET_SOFT, "--so static CommandResetArg GetCommandResetId(const char* token) { assert(token != nullptr); - for (std::size_t i = 0, n = countof(command_reset_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(command_reset_desc); i < n; ++i) { if (std::strcmp(command_reset_desc[i].token, token) == 0) return command_reset_desc[i].arguments; } @@ -144,7 +143,7 @@ static const CommandDocDesc command_doc_desc[] = { static CommandLayersArg GetCommandLayersId(const char* token) { assert(token != nullptr); - for (std::size_t i = 0, n = countof(command_layers_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(command_layers_desc); i < n; ++i) { if (std::strcmp(command_layers_desc[i].token, token) == 0) return command_layers_desc[i].arguments; } @@ -154,7 +153,7 @@ static CommandLayersArg GetCommandLayersId(const char* token) { static const CommandLayersDesc& GetCommandLayers(CommandLayersArg layers_arg) { assert(layers_arg != COMMAND_LAYERS_NONE); - for (std::size_t i = 0, n = countof(command_layers_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(command_layers_desc); i < n; ++i) { if (command_layers_desc[i].arguments == layers_arg) return command_layers_desc[i]; } @@ -165,7 +164,7 @@ static const CommandLayersDesc& GetCommandLayers(CommandLayersArg layers_arg) { static CommandDocArg GetCommandDocId(const char* token) { assert(token != nullptr); - for (std::size_t i = 0, n = countof(command_doc_desc); i < n; ++i) { + for (std::size_t i = 0, n = std::size(command_doc_desc); i < n; ++i) { if (std::strcmp(command_doc_desc[i].token, token) == 0) return command_doc_desc[i].arguments; } @@ -178,12 +177,10 @@ CommandLine::CommandLine(int argc, char* argv[]) command_layers_arg(_command_layers_arg), layers_configuration_path(_layers_configuration_path), command_doc_arg(_command_doc_arg), - command_vulkan_sdk(_command_vulkan_sdk), doc_layer_name(_doc_layer_name), doc_out_dir(_doc_out_dir), error(_error), error_args(_error_args), - _command(COMMAND_GUI), _command_reset_arg(COMMAND_RESET_NONE), _command_layers_arg(COMMAND_LAYERS_NONE), _command_doc_arg(COMMAND_DOC_NONE), @@ -195,9 +192,6 @@ CommandLine::CommandLine(int argc, char* argv[]) int arg_offset = 1; switch (_command = GetModeId(argv[arg_offset + 0])) { - case COMMAND_VULKAN_SDK: { - _command_vulkan_sdk = argv[arg_offset + 1]; - } break; case COMMAND_LAYERS: { if (argc <= arg_offset + 1) { _error = ERROR_MISSING_COMMAND_ARGUMENT; @@ -297,7 +291,6 @@ CommandLine::CommandLine(int argc, char* argv[]) _error_args.push_back(argv[arg_offset + 0]); break; } - case COMMAND_GUI: case COMMAND_VERSION: { break; } diff --git a/vkconfig_core/command_line.h b/vkconfig_core/command_line.h index 8597e2befd..e2e766eb93 100644 --- a/vkconfig_core/command_line.h +++ b/vkconfig_core/command_line.h @@ -24,16 +24,7 @@ #include #include -enum CommandType { - COMMAND_NONE = 0, - COMMAND_SHOW_USAGE, - COMMAND_VERSION, - COMMAND_GUI, - COMMAND_RESET, - COMMAND_LAYERS, - COMMAND_DOC, - COMMAND_VULKAN_SDK -}; +enum CommandType { COMMAND_NONE = 0, COMMAND_SHOW_USAGE, COMMAND_VERSION, COMMAND_RESET, COMMAND_LAYERS, COMMAND_DOC }; enum CommandLayersArg { COMMAND_LAYERS_NONE = 0, @@ -71,7 +62,6 @@ class CommandLine { const CommandLayersArg& command_layers_arg; const std::string& layers_configuration_path; const CommandDocArg& command_doc_arg; - const std::string& command_vulkan_sdk; const std::string& doc_layer_name; const std::string& doc_out_dir; @@ -87,7 +77,6 @@ class CommandLine { CommandLayersArg _command_layers_arg; std::string _layers_configuration_path; CommandDocArg _command_doc_arg; - std::string _command_vulkan_sdk; std::string _doc_layer_name; std::string _doc_out_dir; diff --git a/vkconfig_core/configuration.cpp b/vkconfig_core/configuration.cpp index fcd2c72a9d..114dc1c206 100644 --- a/vkconfig_core/configuration.cpp +++ b/vkconfig_core/configuration.cpp @@ -23,7 +23,7 @@ #include "util.h" #include "path.h" #include "json.h" -#include "platform.h" +#include "type_platform.h" #include "version.h" #include @@ -39,11 +39,26 @@ #include #include -Configuration::Configuration() : key("New Configuration"), platform_flags(PLATFORM_DESKTOP_BIT), view_advanced_settings(false) {} +Configuration::Configuration() + : key("New Configuration"), version(1), platform_flags(PLATFORM_DESKTOP_BIT), view_advanced_settings(false) {} -bool Configuration::Load2_2(const std::vector& available_layers, const QJsonObject& json_root_object) { +Configuration Configuration::CreateDisabled(const std::vector& available_layers) { + Configuration result; + result.key = "_DisablingConfiguration"; + result.parameters = GatherParameters(result.parameters, available_layers); + + for (std::size_t i = 0, n = result.parameters.size(); i < n; ++i) { + result.parameters[i].control = LAYER_CONTROL_OFF; + } + + return result; +} + +bool Configuration::Load3_0(const std::vector& available_layers, const QJsonObject& json_root_object) { const QJsonValue& json_configuration_value = json_root_object.value("configuration"); - if (json_configuration_value == QJsonValue::Undefined) return false; // Not a configuration file + if (json_configuration_value == QJsonValue::Undefined) { + return false; // Not a configuration file + } const QJsonObject& json_configuration_object = json_configuration_value.toObject(); @@ -52,6 +67,10 @@ bool Configuration::Load2_2(const std::vector& available_layers, const QJ this->description = ReadString(json_configuration_object, "description").c_str(); // Optional configuration values + if (json_configuration_object.value("version") != QJsonValue::Undefined) { + this->version = json_configuration_object.value("version").toVariant().toInt(); + } + if (json_configuration_object.value("expanded_states") != QJsonValue::Undefined) { this->setting_tree_state = json_configuration_object.value("expanded_states").toVariant().toByteArray(); } @@ -69,7 +88,7 @@ bool Configuration::Load2_2(const std::vector& available_layers, const QJ for (std::size_t i = 0, n = paths.size(); i < n; ++i) { const QFileInfo info(paths[i].c_str()); if (info.exists()) { - this->user_defined_paths.push_back(paths[i]); + this->user_defined_paths.push_back(Path(paths[i])); } else { QMessageBox alert; alert.QDialog::setWindowTitle("User-defined layer path doesn't exist"); @@ -93,7 +112,7 @@ bool Configuration::Load2_2(const std::vector& available_layers, const QJ Parameter parameter; parameter.key = ReadStringValue(json_layer_object, "name").c_str(); parameter.overridden_rank = ReadIntValue(json_layer_object, "rank"); - parameter.state = GetLayerState(ReadStringValue(json_layer_object, "state").c_str()); + parameter.control = GetLayerControl(ReadStringValue(json_layer_object, "control").c_str()); const QJsonValue& json_platform_value = json_layer_object.value("platforms"); if (json_platform_value != QJsonValue::Undefined) { @@ -129,37 +148,42 @@ bool Configuration::Load2_2(const std::vector& available_layers, const QJ return true; } -bool Configuration::Load(const std::vector& available_layers, const std::string& full_path) { - assert(!full_path.empty()); +bool Configuration::Load(const std::vector& available_layers, const Path& full_path) { + assert(!full_path.Empty()); this->parameters.clear(); - QFile file(full_path.c_str()); + QFile file(full_path.AbsolutePath().c_str()); const bool result = file.open(QIODevice::ReadOnly | QIODevice::Text); assert(result); - QString json_text = file.readAll(); + std::string json_text = file.readAll().toStdString(); file.close(); QJsonParseError parse_error; - QJsonDocument json_doc = QJsonDocument::fromJson(json_text.toUtf8(), &parse_error); + QJsonDocument json_doc = QJsonDocument::fromJson(json_text.c_str(), &parse_error); if (parse_error.error != QJsonParseError::NoError) { return false; } - return Load2_2(available_layers, json_doc.object()); + Version version(json_doc.object().value("file_format_version").toString().toStdString()); + if (version < (Version(3, 0, 0))) { + return false; // Unsupported version + } + + return Load3_0(available_layers, json_doc.object()); } -bool Configuration::Save(const std::vector& available_layers, const std::string& full_path, bool exporter) const { - assert(!full_path.empty()); +bool Configuration::Save(const std::vector& available_layers, const Path& full_path, bool exporter) const { + assert(!full_path.Empty()); QJsonObject root; - root.insert("file_format_version", Version::LAYER_CONFIG.str().c_str()); + root.insert("file_format_version", Version::VKCONFIG.str().c_str()); // Build the json document QJsonArray excluded_list; for (std::size_t i = 0, n = this->parameters.size(); i < n; ++i) { - if (this->parameters[i].state != LAYER_STATE_EXCLUDED) { + if (this->parameters[i].control != LAYER_CONTROL_OFF) { continue; } excluded_list.append(this->parameters[i].key.c_str()); @@ -169,14 +193,14 @@ bool Configuration::Save(const std::vector& available_layers, const std:: for (std::size_t i = 0, n = this->parameters.size(); i < n; ++i) { const Parameter& parameter = this->parameters[i]; - if (parameter.state == LAYER_STATE_APPLICATION_CONTROLLED) { + if (parameter.control == LAYER_CONTROL_AUTO) { continue; } QJsonObject json_layer; json_layer.insert("name", parameter.key.c_str()); json_layer.insert("rank", parameter.overridden_rank); - json_layer.insert("state", GetToken(parameter.state)); + json_layer.insert("control", GetToken(parameter.control)); SaveStringArray(json_layer, "platforms", GetPlatformTokens(parameter.platform_flags)); QJsonArray json_settings; @@ -203,6 +227,7 @@ bool Configuration::Save(const std::vector& available_layers, const std:: QJsonObject json_configuration; json_configuration.insert("name", this->key.c_str()); + json_configuration.insert("version", this->version); json_configuration.insert("description", this->description.c_str()); SaveStringArray(json_configuration, "platforms", GetPlatformTokens(this->platform_flags)); if (!exporter && !this->setting_tree_state.isEmpty()) { @@ -213,7 +238,7 @@ bool Configuration::Save(const std::vector& available_layers, const std:: QJsonArray json_paths; for (std::size_t i = 0, n = user_defined_paths.size(); i < n; ++i) { - json_paths.append(user_defined_paths[i].c_str()); + json_paths.append(user_defined_paths[i].AbsolutePath().c_str()); } json_configuration.insert("layers_paths", json_paths); @@ -221,7 +246,7 @@ bool Configuration::Save(const std::vector& available_layers, const std:: QJsonDocument doc(root); - QFile json_file(full_path.c_str()); + QFile json_file(full_path.AbsolutePath().c_str()); const bool result = json_file.open(QIODevice::WriteOnly | QIODevice::Text); assert(result); @@ -239,16 +264,14 @@ bool Configuration::Save(const std::vector& available_layers, const std:: } } -void Configuration::Reset(const std::vector& available_layers, const PathManager& path_manager) { - (void)path_manager; - +void Configuration::Reset(const std::vector& available_layers) { // Case 1: reset using built-in configuration files - const QFileInfoList& builtin_configuration_files = GetJSONFiles(":/configurations/"); + const std::vector& builtin_configuration_files = CollectFilePaths(":/configurations/"); for (int i = 0, n = builtin_configuration_files.size(); i < n; ++i) { - const std::string& basename = builtin_configuration_files[i].baseName().toStdString(); + const std::string& basename = builtin_configuration_files[i].Basename(); if (this->key == basename) { - const bool result = this->Load(available_layers, builtin_configuration_files[i].absoluteFilePath().toStdString()); + const bool result = this->Load(available_layers, builtin_configuration_files[i]); assert(result); OrderParameter(this->parameters, available_layers); @@ -257,28 +280,22 @@ void Configuration::Reset(const std::vector& available_layers, const Path } // Case 2: reset using configuration files using saved configurations - const std::string base_config_path = GetPath(BUILTIN_PATH_CONFIG_REF); - - const std::vector& SUPPORTED_CONFIG_FILES = path_manager.SUPPORTED_CONFIG_FILES; + const Path full_path(Get(Path::CONFIGS) + "/" + this->key + ".json"); - for (std::size_t i = 0, n = SUPPORTED_CONFIG_FILES.size(); i < n; ++i) { - const std::string path = base_config_path + SUPPORTED_CONFIG_FILES[i] + "/" + this->key + ".json"; - - std::FILE* file = std::fopen(path.c_str(), "r"); - if (file) { - std::fclose(file); - const bool result = this->Load(available_layers, path); - assert(result); + std::FILE* file = std::fopen(full_path.AbsolutePath().c_str(), "r"); + if (file) { + std::fclose(file); + const bool result = this->Load(available_layers, full_path); + assert(result); - OrderParameter(this->parameters, available_layers); - return; - } + OrderParameter(this->parameters, available_layers); + return; } // Case 3: reset to default values { for (auto it = this->parameters.begin(); it != this->parameters.end(); ++it) { - it->state = LAYER_STATE_APPLICATION_CONTROLLED; + it->control = LAYER_CONTROL_AUTO; it->overridden_rank = Parameter::NO_RANK; for (std::size_t i = 0, n = it->settings.size(); i < n; ++i) { it->settings[i]->Reset(); @@ -295,7 +312,7 @@ bool Configuration::HasOverride() const { continue; } - if (this->parameters[i].state != LAYER_STATE_APPLICATION_CONTROLLED) { + if (this->parameters[i].control != LAYER_CONTROL_AUTO) { return true; } } @@ -304,9 +321,9 @@ bool Configuration::HasOverride() const { } bool Configuration::IsBuiltIn() const { - const QFileInfoList& builtin_configuration_files = GetJSONFiles(":/configurations/"); + const std::vector& builtin_configuration_files = CollectFilePaths(":/configurations/"); for (int i = 0, n = builtin_configuration_files.size(); i < n; ++i) { - const std::string& basename = builtin_configuration_files[i].baseName().toStdString(); + const std::string& basename = builtin_configuration_files[i].Basename(); if (basename == this->key) { return true; diff --git a/vkconfig_core/configuration.h b/vkconfig_core/configuration.h index 02260ce0be..b52270d1fc 100644 --- a/vkconfig_core/configuration.h +++ b/vkconfig_core/configuration.h @@ -22,7 +22,6 @@ #pragma once #include "parameter.h" -#include "path_manager.h" #include @@ -33,27 +32,30 @@ class Configuration { public: Configuration(); - bool Load(const std::vector& available_layers, const std::string& full_path); - bool Save(const std::vector& available_layers, const std::string& full_path, bool exporter = false) const; + static Configuration CreateDisabled(const std::vector& available_layers); + + bool Load(const std::vector& available_layers, const Path& full_path); + bool Save(const std::vector& available_layers, const Path& full_path, bool exporter = false) const; bool HasOverride() const; - void Reset(const std::vector& available_layers, const PathManager& path_manager); + void Reset(const std::vector& available_layers); std::size_t Size() const { return this->parameters.size(); }; std::string key; // User readable display of the configuration name (may contain spaces) + int version; int platform_flags; std::string description; // A friendly description of what this profile does QByteArray setting_tree_state; // Recall editor tree state bool view_advanced_settings; std::vector parameters; - std::vector user_defined_paths; + std::vector user_defined_paths; bool IsBuiltIn() const; private: - bool Load2_2(const std::vector& available_layers, const QJsonObject& json_root_object); + bool Load3_0(const std::vector& available_layers, const QJsonObject& json_root_object); }; std::string MakeConfigurationName(const std::vector& configurations, const std::string& configuration_name); diff --git a/vkconfig3/main_signal.h b/vkconfig_core/configuration_info.cpp similarity index 84% rename from vkconfig3/main_signal.h rename to vkconfig_core/configuration_info.cpp index d9ff6e1a7d..7c42cde38d 100644 --- a/vkconfig3/main_signal.h +++ b/vkconfig_core/configuration_info.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,4 @@ * - Christophe Riccio */ -#pragma once - -void InitSignals(); +#include "configuration_info.h" diff --git a/vkconfig_core/configuration_info.h b/vkconfig_core/configuration_info.h new file mode 100644 index 0000000000..21f05cf7de --- /dev/null +++ b/vkconfig_core/configuration_info.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#pragma once + +#include "type_update.h" +#include "type_layers_mode.h" + +#include + +class ConfigurationInfo { + private: + std::string name = "Validation"; + LayersMode mode = LAYERS_CONTROLLED_BY_APPLICATIONS; + UpdateBits area = UPDATE_NONE; + + public: + const char* GetName() const { return this->name.c_str(); } + + void SetName(const std::string& new_configuration_name) { + if (this->name != new_configuration_name) { + this->name = new_configuration_name; + this->area = UPDATE_ALL; + } + } + + LayersMode GetMode() const { return this->mode; } + + void SetMode(LayersMode new_configuration_mode) { + if (this->mode != new_configuration_mode) { + this->mode = new_configuration_mode; + this->area = UPDATE_ALL; + } + } + + void ForceUpdate(UpdateBits area_bits) { + if (area_bits == UPDATE_NONE) { + this->area = area_bits; + } else { + this->area = static_cast(this->area | area_bits); + } + } +}; diff --git a/vkconfig_core/configuration_manager.cpp b/vkconfig_core/configuration_manager.cpp index 69097f0904..eb73cd5a90 100644 --- a/vkconfig_core/configuration_manager.cpp +++ b/vkconfig_core/configuration_manager.cpp @@ -19,48 +19,31 @@ */ #include "util.h" -#include "path_manager.h" #include "configuration_manager.h" -#include "override.h" +#include "configurator.h" #include "alert.h" -#include -#include - -ConfigurationManager::ConfigurationManager(Environment &environment) : environment(environment) {} +ConfigurationManager::ConfigurationManager() {} ConfigurationManager::~ConfigurationManager() {} void ConfigurationManager::LoadAllConfigurations(const std::vector &available_layers) { this->available_configurations.clear(); - // If this is the first time, we need to create the initial set of - // configuration files. - if (this->environment.first_run) { - this->RemoveConfigurationFiles(); - this->LoadDefaultConfigurations(available_layers); - - this->environment.first_run = false; - } - - const std::string base_config_path = GetPath(BUILTIN_PATH_CONFIG_REF); - - const std::vector &SUPPORTED_CONFIG_FILES = this->environment.paths.SUPPORTED_CONFIG_FILES; + this->LoadConfigurationsPath(available_layers); - for (std::size_t i = 0, n = SUPPORTED_CONFIG_FILES.size(); i < n; ++i) { - const std::string path = base_config_path + SUPPORTED_CONFIG_FILES[i]; - this->LoadConfigurationsPath(available_layers, path.c_str()); - } + // If built-in configurations were updated, replace the stored configuration + this->LoadDefaultConfigurations(available_layers); this->SortConfigurations(); } void ConfigurationManager::LoadDefaultConfigurations(const std::vector &available_layers) { - const QFileInfoList &configuration_files = GetJSONFiles(":/configurations/"); + const std::vector &configuration_files = CollectFilePaths(":/configurations/"); for (int i = 0, n = configuration_files.size(); i < n; ++i) { Configuration configuration; - const bool result = configuration.Load(available_layers, configuration_files[i].absoluteFilePath().toStdString()); + const bool result = configuration.Load(available_layers, configuration_files[i]); assert(result); if (!IsPlatformSupported(configuration.platform_flags)) { @@ -75,8 +58,16 @@ void ConfigurationManager::LoadDefaultConfigurations(const std::vector &a OrderParameter(configuration.parameters, available_layers); - Configuration *found_configuration = FindByKey(this->available_configurations, configuration.key.c_str()); + Configuration *found_configuration = this->FindConfiguration(configuration.key); if (found_configuration == nullptr) { + auto iter = this->removed_built_in_configuration.find(configuration.key); + // If the removed built-in configuration is a version older than the current built-in configuration, we are it back. + if (iter->second < configuration.version) { + this->available_configurations.push_back(configuration); + } + } else if (found_configuration->version < configuration.version) { + // Replaced the old configuration by the new one + this->RemoveConfiguration(available_layers, found_configuration->key); this->available_configurations.push_back(configuration); } } @@ -95,19 +86,11 @@ void ConfigurationManager::SortConfigurations() { std::sort(this->available_configurations.begin(), this->available_configurations.end(), Compare()); } -void ConfigurationManager::LoadConfigurationsPath(const std::vector &available_layers, const char *path) { - const QFileInfoList &configuration_files = GetJSONFiles(path); +void ConfigurationManager::LoadConfigurationsPath(const std::vector &available_layers) { + const std::vector &configuration_files = CollectFilePaths(Get(Path::CONFIGS)); for (int i = 0, n = configuration_files.size(); i < n; ++i) { - const QFileInfo &info = configuration_files[i]; - Configuration configuration; - std::string path = info.absoluteFilePath().toStdString(); - - // Skip "2_2_1/Portability.json" because we replaced the devsim layer by the profiles layer - if (path.find("2_2_1/Portability.json") != std::string::npos) { - path = ":/configurations/Portability.json"; - } - const bool result = configuration.Load(available_layers, path); + const bool result = configuration.Load(available_layers, configuration_files[i]); if (!result) { continue; } @@ -125,10 +108,12 @@ void ConfigurationManager::LoadConfigurationsPath(const std::vector &avai } } +static Path MakeConfigurationPath(const std::string &key) { return (Get(Path::CONFIGS) + "/" + key + ".json").AbsolutePath(); } + void ConfigurationManager::SaveAllConfigurations(const std::vector &available_layers) { for (std::size_t i = 0, n = available_configurations.size(); i < n; ++i) { - const std::string path = GetPath(BUILTIN_PATH_CONFIG_LAST) + "/" + available_configurations[i].key + ".json"; - available_configurations[i].Save(available_layers, path.c_str()); + const Path &path(MakeConfigurationPath(available_configurations[i].key)); + available_configurations[i].Save(available_layers, path); } } @@ -139,12 +124,12 @@ Configuration &ConfigurationManager::CreateConfiguration(const std::vectoravailable_configurations.push_back(configuration); @@ -154,51 +139,31 @@ Configuration &ConfigurationManager::CreateConfiguration(const std::vector &SUPPORTED_CONFIG_FILES = environment.paths.SUPPORTED_CONFIG_FILES; + const std::string base_path = AbsolutePath(Path::CONFIGS); - for (std::size_t i = 0, n = SUPPORTED_CONFIG_FILES.size(); i < n; ++i) { - const std::string path = base_path + SUPPORTED_CONFIG_FILES[i] + "/" + configuration.key + ".json"; + const std::string path = base_path + "/" + configuration.key + ".json"; - std::FILE *file = std::fopen(path.c_str(), "r"); - if (file) { - std::fclose(file); - return true; - } + std::FILE *file = std::fopen(path.c_str(), "r"); + if (file) { + std::fclose(file); + return true; } + return false; } void ConfigurationManager::RemoveConfigurationFiles() { - const std::string base_path = GetPath(BUILTIN_PATH_CONFIG_REF); - - const std::vector &SUPPORTED_CONFIG_FILES = environment.paths.SUPPORTED_CONFIG_FILES; - - for (std::size_t i = 0, n = SUPPORTED_CONFIG_FILES.size(); i < n; ++i) { - const std::string path = base_path + SUPPORTED_CONFIG_FILES[i]; - - const QFileInfoList &configuration_files = GetJSONFiles(path.c_str()); - for (int i = 0, n = configuration_files.size(); i < n; ++i) { - QFile::remove(configuration_files[i].filePath()); - } + const std::vector &configuration_files = CollectFilePaths(Get(Path::CONFIGS)); + for (int i = 0, n = configuration_files.size(); i < n; ++i) { + configuration_files[i].Remove(); } } void ConfigurationManager::RemoveConfigurationFile(const std::string &key) { - const std::string base_path = GetPath(BUILTIN_PATH_CONFIG_REF); - - const std::vector &SUPPORTED_CONFIG_FILES = environment.paths.SUPPORTED_CONFIG_FILES; - - for (std::size_t i = 0, n = SUPPORTED_CONFIG_FILES.size(); i < n; ++i) { - const std::string path = base_path + SUPPORTED_CONFIG_FILES[i]; - - const QFileInfoList &configuration_files = GetJSONFiles(path.c_str()); - for (int j = 0, o = configuration_files.size(); j < o; ++j) { - const QString filename = configuration_files[j].fileName(); - if (filename.toStdString() == key + ".json") { - QFile::remove(configuration_files[j].filePath()); - } + const std::vector &configuration_files = CollectFilePaths(Get(Path::CONFIGS)); + for (int j = 0, o = configuration_files.size(); j < o; ++j) { + if (configuration_files[j].Basename() == key) { + configuration_files[j].Remove(); } } } @@ -206,10 +171,6 @@ void ConfigurationManager::RemoveConfigurationFile(const std::string &key) { void ConfigurationManager::RemoveConfiguration(const std::vector &available_layers, const std::string &configuration_name) { assert(!configuration_name.empty()); - LayersMode saved_mode = this->environment.GetMode(); - this->environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - this->Configure(available_layers); - RemoveConfigurationFile(configuration_name.c_str()); // Update the configuration in the list @@ -217,6 +178,12 @@ void ConfigurationManager::RemoveConfiguration(const std::vector &availab for (std::size_t i = 0, n = this->available_configurations.size(); i < n; ++i) { if (this->available_configurations[i].key == configuration_name) { + int version = this->available_configurations[i].version; + + auto result = this->removed_built_in_configuration.insert(std::make_pair(configuration_name, version)); + if (!result.second) { + this->removed_built_in_configuration[configuration_name] = version; + } continue; } updated_configurations.push_back(this->available_configurations[i]); @@ -224,96 +191,34 @@ void ConfigurationManager::RemoveConfiguration(const std::vector &availab std::swap(updated_configurations, this->available_configurations); this->SortConfigurations(); - - this->environment.SetSelectedConfiguration(""); - this->environment.SetMode(saved_mode); - this->Configure(available_layers); } -void ConfigurationManager::Configure(const std::vector &available_layers) { - const std::string active_configuration_name = this->environment.GetSelectedConfiguration(); - - if (active_configuration_name.empty()) { - this->environment.SetSelectedConfiguration(""); - this->Configure(available_layers, ""); - } else { - Configuration *selected_configuration = FindByKey(this->available_configurations, active_configuration_name.c_str()); - if (selected_configuration == nullptr) { - environment.SetSelectedConfiguration(""); - } - this->Configure(available_layers, this->environment.GetSelectedConfiguration()); +Configuration *ConfigurationManager::FindConfiguration(const std::string &configuration_name) { + if (configuration_name.empty()) { + return nullptr; } -} -void ConfigurationManager::Configure(const std::vector &available_layers, const std::string &configuration_name) { - switch (this->environment.GetMode()) { - default: - case LAYERS_MODE_BY_APPLICATIONS: { - SurrenderConfiguration(this->environment); - } break; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: { - if (configuration_name.empty()) { - ::SurrenderConfiguration(this->environment); - } else { - Configuration *selected_configuration = FindByKey(this->available_configurations, configuration_name.c_str()); - std::string missing_layer; - if (::HasMissingLayer(selected_configuration->parameters, available_layers, missing_layer)) { - ::SurrenderConfiguration(this->environment); - } else { - ::OverrideConfiguration(this->environment, available_layers, *selected_configuration); - } - } - } break; - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: { - Configuration temp_configuration; - temp_configuration.key = "_TempConfiguration"; - temp_configuration.parameters = GatherParameters(temp_configuration.parameters, available_layers); - - for (std::size_t i = 0, n = temp_configuration.parameters.size(); i < n; ++i) { - temp_configuration.parameters[i].state = LAYER_STATE_EXCLUDED; - } - - ::OverrideConfiguration(environment, available_layers, temp_configuration); - } break; + if (this->available_configurations.empty()) { + return nullptr; } + + return FindByKey(this->available_configurations, configuration_name.c_str()); } -Configuration *ConfigurationManager::FindActiveConfiguration() { - if (this->environment.GetSelectedConfiguration().empty()) { +const Configuration *ConfigurationManager::FindConfiguration(const std::string &configuration_name) const { + if (configuration_name.empty()) { return nullptr; } - return FindByKey(this->available_configurations, this->environment.GetSelectedConfiguration().c_str()); -} - -bool ConfigurationManager::HasActiveConfiguration(const std::vector &available_layers) const { - switch (environment.GetMode()) { - case LAYERS_MODE_BY_APPLICATIONS: - return false; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: { - const std::string configuration_name = this->environment.GetSelectedConfiguration(); - if (configuration_name.empty()) { - return false; - } else { - const Configuration *selected_configuration = FindByKey(this->available_configurations, configuration_name.c_str()); - if (selected_configuration != nullptr) { - std::string missing_layer; - return !::HasMissingLayer(selected_configuration->parameters, available_layers, missing_layer); - } else { - return false; - } - } - } - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: - return true; + if (this->available_configurations.empty()) { + return nullptr; } - return false; + return FindByKey(this->available_configurations, configuration_name.c_str()); } -std::string ConfigurationManager::ImportConfiguration(const std::vector &available_layers, - const std::string &full_import_path) { - assert(!full_import_path.empty()); +std::string ConfigurationManager::ImportConfiguration(const std::vector &available_layers, const Path &full_import_path) { + assert(!full_import_path.Empty()); Configuration configuration; if (!configuration.Load(available_layers, full_import_path)) { @@ -321,7 +226,7 @@ std::string ConfigurationManager::ImportConfiguration(const std::vector & msg.setIcon(QMessageBox::Critical); msg.setWindowTitle("Import of Layers Configuration error"); msg.setText("Cannot access the source configuration file."); - msg.setInformativeText(full_import_path.c_str()); + msg.setInformativeText(full_import_path.AbsolutePath().c_str()); msg.exec(); return ""; } @@ -333,10 +238,10 @@ std::string ConfigurationManager::ImportConfiguration(const std::vector & return configuration.key; } -void ConfigurationManager::ExportConfiguration(const std::vector &available_layers, const std::string &full_export_path, +void ConfigurationManager::ExportConfiguration(const std::vector &available_layers, const Path &full_export_path, const std::string &configuration_name) { assert(!configuration_name.empty()); - assert(!full_export_path.empty()); + assert(!full_export_path.Empty()); Configuration *configuration = FindByKey(available_configurations, configuration_name.c_str()); assert(configuration); @@ -346,61 +251,24 @@ void ConfigurationManager::ExportConfiguration(const std::vector &availab msg.setIcon(QMessageBox::Critical); msg.setWindowTitle("Export of Layers Configuration error"); msg.setText("Cannot create the destination configuration file."); - msg.setInformativeText(full_export_path.c_str()); + msg.setInformativeText(full_export_path.AbsolutePath().c_str()); msg.exec(); } } -void ConfigurationManager::ResetDefaultsConfigurations(const std::vector &available_layers) { - this->environment.Reset(Environment::DEFAULT); - +void ConfigurationManager::Reset(const std::vector &available_layers) { // Now we need to kind of restart everything - this->LoadAllConfigurations(available_layers); - this->SaveAllConfigurations(available_layers); -} - -void ConfigurationManager::ReloadDefaultsConfigurations(const std::vector &available_layers) { - // Now we need to kind of restart everything - LoadDefaultConfigurations(available_layers); - - this->Configure(available_layers); -} - -void ConfigurationManager::FirstDefaultsConfigurations(const std::vector &available_layers) { - const QFileInfoList &configuration_files = GetJSONFiles(":/configurations/"); - - for (int i = 0, n = configuration_files.size(); i < n; ++i) { - if (environment.IsDefaultConfigurationInit(configuration_files[i].baseName().toStdString())) { - continue; - } - - environment.InitDefaultConfiguration(configuration_files[i].baseName().toStdString()); - - Configuration configuration; - const bool result = configuration.Load(available_layers, configuration_files[i].absoluteFilePath().toStdString()); - assert(result); - - if (!IsPlatformSupported(configuration.platform_flags)) { - continue; - } - - if (FindByKey(available_configurations, configuration.key.c_str()) != nullptr) { - continue; - } - - OrderParameter(configuration.parameters, available_layers); - available_configurations.push_back(configuration); - } + this->LoadDefaultConfigurations(available_layers); } bool ConfigurationManager::CheckApiVersions(const std::vector &available_layers, Configuration *selected_configuration, std::string &log_versions) const { - return CompareLayersVersions(available_layers, selected_configuration, environment.api_version, log_versions, true); + return this->CompareLayersVersions(available_layers, selected_configuration, Version::VKCONFIG, log_versions, true); } bool ConfigurationManager::CheckLayersVersions(const std::vector &available_layers, Configuration *selected_configuration, std::string &log_versions) const { - return CompareLayersVersions(available_layers, selected_configuration, Version::VERSION_NULL, log_versions, false); + return this->CompareLayersVersions(available_layers, selected_configuration, Version::VERSION_NULL, log_versions, false); } bool ConfigurationManager::CompareLayersVersions(const std::vector &available_layers, Configuration *selected_configuration, @@ -415,7 +283,9 @@ bool ConfigurationManager::CompareLayersVersions(const std::vector &avail ++param_index) { const Parameter ¶meter = selected_configuration->parameters[param_index]; - if (parameter.state != LAYER_STATE_OVERRIDDEN) continue; + if (parameter.control != LAYER_CONTROL_ON) { + continue; + } for (std::size_t layer_index = 0, layer_count = available_layers.size(); layer_index < layer_count; ++layer_index) { const Layer &layer = available_layers[layer_index]; diff --git a/vkconfig_core/configuration_manager.h b/vkconfig_core/configuration_manager.h index 99c1a03aaa..36c6023fe0 100644 --- a/vkconfig_core/configuration_manager.h +++ b/vkconfig_core/configuration_manager.h @@ -21,15 +21,14 @@ #pragma once #include "configuration.h" -#include "environment.h" -#include "path_manager.h" +#include "path.h" #include #include class ConfigurationManager { public: - ConfigurationManager(Environment& environment); + ConfigurationManager(); ~ConfigurationManager(); void LoadAllConfigurations(const std::vector& available_layers); @@ -41,23 +40,14 @@ class ConfigurationManager { void RemoveConfiguration(const std::vector& available_layers, const std::string& configuration_name); - std::string ImportConfiguration(const std::vector& available_layers, const std::string& full_import_path); - void ExportConfiguration(const std::vector& available_layers, const std::string& full_export_path, + std::string ImportConfiguration(const std::vector& available_layers, const Path& full_import_path); + void ExportConfiguration(const std::vector& available_layers, const Path& full_export_path, const std::string& configuration_name); - Configuration* FindActiveConfiguration(); - bool HasActiveConfiguration(const std::vector& available_layers) const; + const Configuration* FindConfiguration(const std::string& configuration_name) const; + Configuration* FindConfiguration(const std::string& configuration_name); - // The only function that actually configure the system, the Vulkan Loader, the Vulkan layer settings, creating and deleting - // system files - void Configure(const std::vector& available_layers, const std::string& configuration_name); - void Configure(const std::vector& available_layers); - - void ResetDefaultsConfigurations(const std::vector& available_layers); - - void ReloadDefaultsConfigurations(const std::vector& available_layers); - - void FirstDefaultsConfigurations(const std::vector& available_layers); + void Reset(const std::vector& available_layers); void SortConfigurations(); @@ -79,8 +69,9 @@ class ConfigurationManager { void RemoveConfigurationFiles(); - void LoadConfigurationsPath(const std::vector& available_layers, const char* path); + void LoadConfigurationsPath(const std::vector& available_layers); void LoadDefaultConfigurations(const std::vector& available_layers); - Environment& environment; + std::vector default_configuration_filenames; + std::map removed_built_in_configuration; }; diff --git a/vkconfig_core/configurations/2.2.2/API dump.json b/vkconfig_core/configurations/3.0.0/API dump.json similarity index 81% rename from vkconfig_core/configurations/2.2.2/API dump.json rename to vkconfig_core/configurations/3.0.0/API dump.json index 4dbfa1f2d6..7c8e698cf3 100644 --- a/vkconfig_core/configurations/2.2.2/API dump.json +++ b/vkconfig_core/configurations/3.0.0/API dump.json @@ -1,7 +1,8 @@ { - "file_format_version": "2.2.1", + "file_format_version": "3.0.0", "configuration": { "name": "API dump", + "version": 1, "platforms": [ "WINDOWS", "LINUX", @@ -14,7 +15,7 @@ "rank": 0, "settings": [ ], - "state": "OVERRIDDEN" + "control": "on" } ] } diff --git a/vkconfig_core/configurations/2.2.2/Crash Diagnostic.json b/vkconfig_core/configurations/3.0.0/Crash Diagnostic.json similarity index 96% rename from vkconfig_core/configurations/2.2.2/Crash Diagnostic.json rename to vkconfig_core/configurations/3.0.0/Crash Diagnostic.json index 2e8abbfb25..31ea3cccb5 100644 --- a/vkconfig_core/configurations/2.2.2/Crash Diagnostic.json +++ b/vkconfig_core/configurations/3.0.0/Crash Diagnostic.json @@ -1,5 +1,13 @@ { + "file_format_version": "3.0.0", "configuration": { + "name": "Crash Diagnostic", + "version": 1, + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS" + ], "description": "Crash Diagnostic Layer is a crash/hang debugging tool that helps determines GPU progress in a Vulkan application.", "layers": [ { @@ -81,14 +89,6 @@ ], "state": "OVERRIDDEN" } - ], - "name": "Crash Diagnostic", - "platforms": [ - "WINDOWS", - "LINUX", - "MACOS" - ], - "view_advanced_settings": false - }, - "file_format_version": "2.2.3" + ] + } } diff --git a/vkconfig_core/configurations/2.2.2/Frame Capture.json b/vkconfig_core/configurations/3.0.0/Frame Capture.json similarity index 86% rename from vkconfig_core/configurations/2.2.2/Frame Capture.json rename to vkconfig_core/configurations/3.0.0/Frame Capture.json index 58a28be6c6..02e75cda9d 100644 --- a/vkconfig_core/configurations/2.2.2/Frame Capture.json +++ b/vkconfig_core/configurations/3.0.0/Frame Capture.json @@ -1,7 +1,8 @@ { - "file_format_version": "2.2.1", + "file_format_version": "3.0.0", "configuration": { "name": "Frame Capture", + "version": 1, "platforms": [ "WINDOWS", "LINUX" @@ -18,7 +19,7 @@ "value": "${VK_LOCAL}/gfxrecon_capture.gfxr" } ], - "state": "OVERRIDDEN" + "control": "on" } ] } diff --git a/vkconfig_core/configurations/2.2.2/Portability.json b/vkconfig_core/configurations/3.0.0/Portability.json similarity index 87% rename from vkconfig_core/configurations/2.2.2/Portability.json rename to vkconfig_core/configurations/3.0.0/Portability.json index 0a1cec7425..c49e7ce96a 100644 --- a/vkconfig_core/configurations/2.2.2/Portability.json +++ b/vkconfig_core/configurations/3.0.0/Portability.json @@ -1,7 +1,8 @@ { - "file_format_version": "2.2.1", + "file_format_version": "3.0.0", "configuration": { "name": "Portability", + "version": 1, "platforms": [ "WINDOWS", "LINUX", @@ -14,14 +15,14 @@ "rank": -1, "settings": [ ], - "state": "EXCLUDED" + "control": "off" }, { "name": "VK_LAYER_LUNARG_gfxreconstruct", "rank": -1, "settings": [ ], - "state": "EXCLUDED", + "control": "off", "platforms": [ "WINDOWS", "LINUX" @@ -32,7 +33,7 @@ "rank": -1, "settings": [ ], - "state": "EXCLUDED", + "control": "off", "platforms": [ "WINDOWS", "LINUX" @@ -43,7 +44,7 @@ "rank": -1, "settings": [ ], - "state": "EXCLUDED", + "control": "off", "platforms": [ "WINDOWS", "LINUX" @@ -54,14 +55,14 @@ "rank": -1, "settings": [ ], - "state": "EXCLUDED" + "control": "off" }, { "name": "VK_LAYER_KHRONOS_validation", "rank": 4, "settings": [ ], - "state": "OVERRIDDEN" + "control": "on" }, { "name": "VK_LAYER_KHRONOS_profiles", @@ -78,7 +79,7 @@ "value": "VP_LUNARG_desktop_baseline_2023" } ], - "state": "OVERRIDDEN" + "control": "on" } ] } diff --git a/vkconfig_core/configurations/2.2.2/Synchronization.json b/vkconfig_core/configurations/3.0.0/Synchronization.json similarity index 96% rename from vkconfig_core/configurations/2.2.2/Synchronization.json rename to vkconfig_core/configurations/3.0.0/Synchronization.json index b8450842a0..17abe0cc41 100644 --- a/vkconfig_core/configurations/2.2.2/Synchronization.json +++ b/vkconfig_core/configurations/3.0.0/Synchronization.json @@ -1,7 +1,8 @@ { - "file_format_version": "2.2.1", + "file_format_version": "3.0.0", "configuration": { "name": "Synchronization", + "version": 1, "platforms": [ "WINDOWS", "LINUX", @@ -89,7 +90,7 @@ "value": false } ], - "state": "OVERRIDDEN" + "control": "on" }, { "name": "VK_LAYER_KHRONOS_synchronization2", @@ -101,7 +102,7 @@ "value": false } ], - "state": "OVERRIDDEN" + "control": "on" } ] } diff --git a/vkconfig_core/configurations/2.2.2/Validation.json b/vkconfig_core/configurations/3.0.0/Validation.json similarity index 84% rename from vkconfig_core/configurations/2.2.2/Validation.json rename to vkconfig_core/configurations/3.0.0/Validation.json index 0cf968746e..ef745c2fdf 100644 --- a/vkconfig_core/configurations/2.2.2/Validation.json +++ b/vkconfig_core/configurations/3.0.0/Validation.json @@ -1,7 +1,8 @@ { - "file_format_version": "2.2.1", + "file_format_version": "3.0.0", "configuration": { "name": "Validation", + "version": 1, "platforms": [ "WINDOWS", "LINUX", @@ -14,7 +15,7 @@ "rank": 0, "settings": [ ], - "state": "OVERRIDDEN" + "control": "on" } ] } diff --git a/vkconfig_core/configurator.cpp b/vkconfig_core/configurator.cpp new file mode 100644 index 0000000000..11ae7c3828 --- /dev/null +++ b/vkconfig_core/configurator.cpp @@ -0,0 +1,387 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Lenny Komow + * - Richard S. Wright Jr. + * - Christophe Riccio + */ + +#include "configurator.h" +#include "registry.h" +#include "vulkan_info.h" +#include "util.h" +#include "path.h" +#include "alert.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +static QJsonObject CreateJsonSettingObject(const Configurator::LoaderSettings& loader_settings) { + QJsonArray json_layers; + for (std::size_t j = 0, o = loader_settings.layers.size(); j < o; ++j) { + const Configurator::LoaderLayerSettings& layer = loader_settings.layers[j]; + + QJsonObject json_layer; + json_layer.insert("name", layer.key.c_str()); + json_layer.insert("path", layer.path.c_str()); + json_layer.insert("control", ToLowerCase(::GetToken(layer.control)).c_str()); + json_layer.insert("treat_as_implicit_manifest", layer.implicit); + json_layers.append(json_layer); + } + + QJsonArray json_stderr_log; + const std::vector& stderr_log = GetLogTokens(loader_settings.stderr_log_flags); + for (std::size_t i = 0, n = stderr_log.size(); i < n; ++i) { + json_stderr_log.append(stderr_log[i].c_str()); + } + + QJsonObject json_settings; + + if (!loader_settings.executable_path.empty()) { + QJsonArray json_app_keys; + json_app_keys.append(loader_settings.executable_path.c_str()); + json_settings.insert("app_keys", json_app_keys); + } + + json_settings.insert("layers", json_layers); + json_settings.insert("stderr_log", json_stderr_log); + return json_settings; +} + +void Configurator::BuildLoaderSettings(const ConfigurationInfo& info, const std::string& executable_path, + std::vector& loader_settings_array) const { + LoaderSettings result; + result.executable_path = executable_path; + + static Configuration disbled_configuration = Configuration::CreateDisabled(this->layers.selected_layers); + const Configuration* configuration = nullptr; + + switch (info.GetMode()) { + case LAYERS_CONTROLLED_BY_APPLICATIONS: + return; + case LAYERS_CONTROLLED_BY_CONFIGURATOR: { + configuration = this->configurations.FindConfiguration(info.GetName()); + } break; + case LAYERS_DISABLED_BY_CONFIGURATOR: { + configuration = &disbled_configuration; + } break; + } + assert(configuration != nullptr); + + for (std::size_t i = 0, n = configuration->parameters.size(); i < n; ++i) { + LoaderLayerSettings loader_layer_settings; + + const Parameter& parameter = configuration->parameters[i]; + if (!(parameter.platform_flags & (1 << VKC_PLATFORM))) { + continue; + } + + const Layer* layer = FindByKey(this->layers.selected_layers, parameter.key.c_str()); + if (layer == nullptr) { + continue; + } + + // Extract just the path + loader_layer_settings.key = parameter.key; + if (layer != nullptr) { + loader_layer_settings.path = layer->manifest_path.AbsolutePath(); + } + loader_layer_settings.control = parameter.control; + loader_layer_settings.implicit = layer != nullptr ? layer->type == LAYER_TYPE_IMPLICIT : false; + + result.layers.push_back(loader_layer_settings); + } + + loader_settings_array.push_back(result); +} + +// Create and write vk_loader_settings.json file +bool Configurator::WriteLoaderSettings(const Path& loader_settings_path) { + assert(!loader_settings_path.Empty()); + + std::vector loader_settings_array; + + if (this->environment.GetPerApplicationConfig()) { + for (std::size_t i = 0, n = this->environment.GetApplications().size(); i < n; ++i) { + const Application& application = this->environment.GetApplication(i); + + this->BuildLoaderSettings(application.configuration, application.executable_path.AbsolutePath(), loader_settings_array); + } + } else { + BuildLoaderSettings(this->environment.global_configuration, "", loader_settings_array); + } + + if (loader_settings_array.empty()) { + return this->Surrender(); + } else { + QJsonObject root; + root.insert("file_format_version", "1.0.0"); + if (loader_settings_array.size() > 1) { + QJsonArray json_settings_array; + for (std::size_t i = 0, n = loader_settings_array.size(); i < n; ++i) { + json_settings_array.append(CreateJsonSettingObject(loader_settings_array[i])); + } + root.insert("settings_array", json_settings_array); + } else if (!loader_settings_array.empty()) { + root.insert("settings", CreateJsonSettingObject(loader_settings_array[0])); + } + QJsonDocument doc(root); + + QFile json_file(loader_settings_path.AbsolutePath().c_str()); + const bool result_layers_file = json_file.open(QIODevice::WriteOnly | QIODevice::Text); + assert(result_layers_file); + json_file.write(doc.toJson()); + json_file.close(); + + return result_layers_file; + } +} + +// Create and write vk_layer_settings.txt file +bool Configurator::WriteLayersSettings(const Path& layers_settings_path) { + std::vector layers_settings_array; + + if (this->environment.GetPerApplicationConfig()) { + const std::vector& applications = this->environment.GetApplications(); + + for (std::size_t i = 0, n = applications.size(); i < n; ++i) { + LayersSettings settings; + settings.configuration_name = applications[i].configuration.GetName(); + settings.executable_path = applications[i].executable_path; + settings.settings_path = applications[i].GetActiveOptions().working_folder; + layers_settings_array.push_back(settings); + } + } else { + LayersSettings settings; + settings.configuration_name = this->environment.global_configuration.GetName(); + settings.settings_path = layers_settings_path; + layers_settings_array.push_back(settings); + } + + bool has_missing_layers = false; + bool result_settings_file = true; + + for (std::size_t i = 0, n = layers_settings_array.size(); i < n; ++i) { + const LayersSettings& layers_settings = layers_settings_array[i]; + + Configuration* configuration = this->configurations.FindConfiguration(layers_settings.configuration_name); + if (configuration == nullptr) { + if (layers_settings.executable_path.Empty()) { + fprintf(stderr, "Fail to apply unknown '%s' global configuration\n", layers_settings.configuration_name.c_str()); + } else { + fprintf(stderr, "Fail to apply unknown '%s' configuration to '%s'\n", layers_settings.configuration_name.c_str(), + layers_settings.executable_path.AbsolutePath().c_str()); + } + + result_settings_file = false; + continue; + } + + QFile file(layers_settings.settings_path.AbsolutePath().c_str()); + result_settings_file = result_settings_file && file.open(QIODevice::WriteOnly | QIODevice::Text); + if (!result_settings_file) { + fprintf(stderr, "Cannot open file %s\n", layers_settings.settings_path.AbsolutePath().c_str()); + continue; + } + QTextStream stream(&file); + + // Loop through all the layers + for (std::size_t j = 0, n = configuration->parameters.size(); j < n; ++j) { + const Parameter& parameter = configuration->parameters[j]; + if (!(parameter.platform_flags & (1 << VKC_PLATFORM))) { + continue; + } + + const Layer* layer = FindByKey(this->layers.selected_layers, parameter.key.c_str()); + if (layer == nullptr) { + has_missing_layers = true; + continue; + } + + if (parameter.control != LAYER_CONTROL_ON) { + continue; + } + + stream << "\n"; + stream << "# " << layer->key.c_str() << "\n\n"; + + std::string lc_layer_name = GetLayerSettingPrefix(layer->key); + + for (std::size_t i = 0, m = parameter.settings.size(); i < m; ++i) { + const SettingData* setting_data = parameter.settings[i]; + + // Skip groups - they aren't settings, so not relevant in this output + if (setting_data->type == SETTING_GROUP) { + continue; + } + + // Skip missing settings + const SettingMeta* meta = FindSetting(layer->settings, setting_data->key.c_str()); + if (meta == nullptr) { + continue; + } + + // Skip overriden settings + if (::CheckSettingOverridden(*meta)) { + continue; + } + + stream << "# "; + stream << meta->label.c_str(); + stream << "\n# =====================\n# ."; + stream << meta->key.c_str() << "\n"; + + // Break up description into smaller words + std::string description = meta->description; + std::vector words; + std::size_t pos; + while ((pos = description.find(" ")) != std::string::npos) { + words.push_back(description.substr(0, pos)); + description.erase(0, pos + 1); + } + if (description.size() > 0) words.push_back(description); + if (words.size() > 0) { + stream << "#"; + std::size_t nchars = 2; + for (auto word : words) { + if (word.size() + nchars > 80) { + stream << "\n#"; + nchars = 2; + } + stream << " " << word.c_str(); + nchars += (word.size() + 1); + } + } + stream << "\n"; + + // If feature has unmet dependency, output it but comment it out + if (::CheckDependence(*meta, parameter.settings) != SETTING_DEPENDENCE_ENABLE) { + stream << "#"; + } + + stream << lc_layer_name.c_str() << setting_data->key.c_str() << " = "; + stream << setting_data->Export(EXPORT_MODE_OVERRIDE).c_str(); + stream << "\n\n"; + } + } + file.close(); + } + + return result_settings_file && !has_missing_layers; +} + +Configurator& Configurator::Get() { + static Configurator configurator; + return configurator; +} + +Configurator::Configurator() : environment(), layers(), configurations() {} + +Configurator::~Configurator() { + configurations.SaveAllConfigurations(layers.selected_layers); + + this->Surrender(); +} + +bool Configurator::Init() { + // Load simple app settings, the additional search paths, and the + // override app list. + this->layers.LoadAllInstalledLayers(); + + if (this->environment.has_crashed) { + this->environment.has_crashed = false; + + if (Alert::ConfiguratorCrashed() == QMessageBox::No) { + this->configurations.LoadAllConfigurations(this->layers.selected_layers); + } + } else { + this->configurations.LoadAllConfigurations(this->layers.selected_layers); + } + + this->Override(); + + return true; +} + +bool Configurator::Override() { + const Path& loader_settings_path = ::Get(Path::LOADER_SETTINGS); + const Path& layers_settings_path = ::Get(Path::LAYERS_SETTINGS); + + // Clean up + this->Surrender(); + + // vk_loader_settings.json + const bool result_layers = this->WriteLoaderSettings(loader_settings_path); + + // vk_layer_settings.txt + const bool result_settings = this->WriteLayersSettings(layers_settings_path); + + // On Windows only, we need to write these values to the registry +#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS + AppendRegistryEntriesForLayers(loader_settings_path.AbsolutePath().c_str(), layers_settings_path.AbsolutePath().c_str()); +#endif + + return result_settings && result_layers; +} + +bool Configurator::Surrender() { + const Path& loader_settings_path = ::Get(Path::LOADER_SETTINGS); + const Path& layers_settings_path = ::Get(Path::LAYERS_SETTINGS); + + const bool result_loader_settings = loader_settings_path.Remove(); + const bool result_layers_settings = layers_settings_path.Remove(); + +#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS + RemoveRegistryEntriesForLayers(loader_settings_path.AbsolutePath().c_str(), layers_settings_path.AbsolutePath().c_str()); +#endif + + this->environment.global_configuration.ForceUpdate(UPDATE_ALL); + + return result_loader_settings && result_layers_settings; +} + +bool Configurator::HasOverride() const { + const Path& loader_settings_path = ::Get(Path::LOADER_SETTINGS); + const Path& layers_settings_path = ::Get(Path::LAYERS_SETTINGS); + + return loader_settings_path.Exists() || layers_settings_path.Exists(); +} + +void Configurator::ResetToDefault(bool hard) { + this->environment.Reset(Environment::CLEAR); + this->layers.LoadAllInstalledLayers(); + this->configurations.Reset(this->layers.selected_layers); +} + +Configuration* Configurator::GetActiveConfiguration() { + const ConfigurationInfo& info = this->environment.GetActiveConfigurationInfo(); + return this->configurations.FindConfiguration(info.GetName()); +} + +const Configuration* Configurator::GetActiveConfiguration() const { + const ConfigurationInfo& info = this->environment.GetActiveConfigurationInfo(); + return this->configurations.FindConfiguration(info.GetName()); +} + +bool Configurator::HasActiveConfiguration() const { return true; } diff --git a/vkconfig/configurator.h b/vkconfig_core/configurator.h similarity index 53% rename from vkconfig/configurator.h rename to vkconfig_core/configurator.h index 5aab5c54fd..0e50464f6d 100644 --- a/vkconfig/configurator.h +++ b/vkconfig_core/configurator.h @@ -24,52 +24,62 @@ #include "../vkconfig_core/version.h" #include "../vkconfig_core/layer.h" #include "../vkconfig_core/layer_manager.h" -#include "../vkconfig_core/path_manager.h" #include "../vkconfig_core/environment.h" #include "../vkconfig_core/configuration_manager.h" -#include "../vkconfig_core/platform.h" - -static const std::vector SUPPORTED_CONFIG_FILES = {"_2_2_3", "_2_2_2", "_2_2_1"}; +#include "../vkconfig_core/type_platform.h" +#include "../vkconfig_core/vulkan_info.h" class Configurator { public: - static Configurator& Get(const std::string& VULKAN_SDK = ""); - bool Init(); + struct LayersSettings { + std::string configuration_name; + Path executable_path; + Path settings_path; + }; - // The list of applications affected - public: - bool SupportDifferentLayerVersions(Version* return_loader_version = nullptr) const; + struct LoaderLayerSettings { + std::string key; + std::string path; + LayerControl control = LAYER_CONTROL_AUTO; + bool implicit = false; + }; - // If return_loader_version is not null, the function will return the loader version - // If quiet is false, message box will be generate - bool SupportApplicationList(Version* return_loader_version = nullptr) const; + struct LoaderSettings { + std::string executable_path; + std::vector layers; + LogFlags stderr_log_flags = LOG_ERROR; + }; - bool HasActiveOverrideOnApplicationListOnly() const { - return SupportApplicationList() && environment.HasOverriddenApplications(); - } + static Configurator& Get(); + bool Init(); - void ActivateConfiguration(const std::string& configuration_name); + public: + bool Surrender(); + bool Override(); + bool HasOverride() const; void ResetToDefault(bool hard); - std::string profile_file; - - std::vector GetDeviceNames() const; + Configuration* GetActiveConfiguration(); + const Configuration* GetActiveConfiguration() const; + bool HasActiveConfiguration() const; private: - Configurator(const std::string& VULKAN_SDK); + Configurator(); ~Configurator(); Configurator(const Configurator&) = delete; Configurator& operator=(const Configurator&) = delete; - void UpdateDevices(); - void CopyResourceFiles(); + bool WriteLayersSettings(const Path& layers_settings_path); + bool WriteLoaderSettings(const Path& loader_settings_path); + + void BuildLoaderSettings(const ConfigurationInfo& info, const std::string& executable_path, + std::vector& loader_settings_array) const; public: - PathManager path; Environment environment; LayerManager layers; ConfigurationManager configurations; - std::vector device_names; + VulkanSystemInfo vulkan_system_info; }; diff --git a/vkconfig/main_signal.cpp b/vkconfig_core/configurator_signal.cpp similarity index 78% rename from vkconfig/main_signal.cpp rename to vkconfig_core/configurator_signal.cpp index 1e057852f0..21cf767614 100644 --- a/vkconfig/main_signal.cpp +++ b/vkconfig_core/configurator_signal.cpp @@ -18,29 +18,22 @@ * - Christophe Riccio */ -#include "../vkconfig_core/override.h" -#include "../vkconfig_core/layer_manager.h" - -#include "main_signal.h" #include "configurator.h" -#include +#include "signal.h" #include void SurrenderConfiguration(int signal) { (void)signal; - // Indicate that Vulkan Configurator crashed to handle it on next run - { - QSettings settings; - settings.setValue("crashed", true); - } + Configurator& configurator = Configurator::Get(); - PathManager paths("", SUPPORTED_CONFIG_FILES); - Environment environment(paths); + // Indicate that Vulkan Configurator crashed to handle it on next run + configurator.environment.has_crashed = true; - SurrenderConfiguration(environment); + // Delete the layers configurations files + configurator.Surrender(); } void InitSignals() { diff --git a/vkconfig/main_signal.h b/vkconfig_core/configurator_signal.h similarity index 88% rename from vkconfig/main_signal.h rename to vkconfig_core/configurator_signal.h index d9ff6e1a7d..44abac55b4 100644 --- a/vkconfig/main_signal.h +++ b/vkconfig_core/configurator_signal.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/vkconfig_core/doc.cpp b/vkconfig_core/doc.cpp index 1f36e15cb4..20786e2743 100644 --- a/vkconfig_core/doc.cpp +++ b/vkconfig_core/doc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022 Valve Corporation - * Copyright (c) 2020-2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include "doc.h" #include "setting_flags.h" -#include "override.h" +#include "configurator.h" #include @@ -322,9 +322,10 @@ void ExportHtmlDoc(const Layer& layer, const std::string& path) { text += "
    \n"; text += format("\t
  • API Version: %s
  • \n", layer.api_version.str().c_str()); text += format("\t
  • Implementation Version: %s
  • \n", layer.implementation_version.c_str()); - text += format("\t
  • Layer Manifest: %s
      \n", QFileInfo(layer.manifest_path.c_str()).fileName().toStdString().c_str()); + text += format("\t
    • Layer Manifest: %s
        \n", + QFileInfo(layer.manifest_path.RelativePath().c_str()).fileName().toStdString().c_str()); text += format("\t\t
      • File Format: %s
      • \n", layer.file_format_version.str().c_str()); - text += format("\t\t
      • Layer Binary Path: %s
      • \n", layer.binary_path.c_str()); + text += format("\t\t
      • Layer Binary Path: %s
      • \n", layer.binary_path.RelativePath().c_str()); text += "\t
    • \n"; if (layer.platforms != 0) { text += format("\t
    • Platforms: %s
    • \n", BuildPlatformsHtml(layer.platforms).c_str()); @@ -407,10 +408,12 @@ void ExportMarkdownDoc(const Layer& layer, const std::string& path) { text += "### Layer Properties\n\n"; text += "- API Version: " + layer.api_version.str() + "\n"; text += "- Implementation Version: " + layer.implementation_version + "\n"; - text += "- Layer Manifest: " + QFileInfo(layer.manifest_path.c_str()).fileName().toStdString() + "\n"; + text += "- Layer Manifest: " + QFileInfo(layer.manifest_path.RelativePath().c_str()).fileName().toStdString() + "\n"; text += " - File Format: " + layer.file_format_version.str() + "\n"; text += " - Layer Binary: "; - text += (layer.binary_path.rfind("./", 0) == 0 ? layer.binary_path.substr(2) : layer.binary_path) + "\n"; + text += (layer.binary_path.RelativePath().rfind("./", 0) == 0 ? layer.binary_path.RelativePath().substr(2) + : layer.binary_path.RelativePath()) + + "\n"; if (layer.platforms != 0) { text += "- Platforms: " + BuildPlatformsMarkdown(layer.platforms) + "\n"; @@ -464,8 +467,10 @@ void ExportMarkdownDoc(const Layer& layer, const std::string& path) { } void ExportSettingsDoc(const std::vector& available_layers, const Configuration& configuration, const std::string& path) { + /* TODO if (WriteLayersSettings(available_layers, configuration, path)) printf("vkconfig: settings written to %s\n", path.c_str()); else printf("vkconfig: could not write %s\n", path.c_str()); + */ } diff --git a/vkconfig_core/environment.cpp b/vkconfig_core/environment.cpp index c5087a6c4d..07e80d47e6 100644 --- a/vkconfig_core/environment.cpp +++ b/vkconfig_core/environment.cpp @@ -19,11 +19,13 @@ */ #include "environment.h" -#include "platform.h" #include "setting.h" #include "util.h" -#include +#include "type_platform.h" +#include "type_layers_mode.h" +#include "type_log.h" + #include #include #include @@ -43,7 +45,7 @@ static const char* GetApplicationSuffix() { ".app", // PLATFORM_MACOS "N/A" // PLATFORM_ANDROID }; - static_assert(countof(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); return TABLE[VKC_PLATFORM]; } @@ -67,129 +69,51 @@ static const char* GetLayoutStateToken(LayoutState state) { "launcherCollapsed", // LAYOUT_LAUNCHER_COLLAPSED "launcherOnClear" // LAYOUT_LAUNCHER_CLEAR_ON }; - static_assert(countof(table) == LAYOUT_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(table) == LAYOUT_COUNT, "The tranlation table size doesn't match the enum number of elements"); return table[state]; } -std::string GetLoaderMessageToken(LoaderMessageType message_type) { - static const char* LOADER_MESSAGE_TOKENS[]{ - "error", // LOADER_MESSAGE_ERROR - "warn", // LOADER_MESSAGE_WARN - "info", // LOADER_MESSAGE_INFO - "debug", // LOADER_MESSAGE_DEBUG - "layer", // LOADER_MESSAGE_LAYER - "implem" // LOADER_MESSAGE_IMPLEMENTATION - }; - - static_assert(countof(LOADER_MESSAGE_TOKENS) == LOADER_MESSAGE_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - return LOADER_MESSAGE_TOKENS[message_type - LOADER_MESSAGE_FIRST]; -} - -std::string GetLoaderMessageTokens(int mesage_types) { - std::vector results; - - for (int i = LOADER_MESSAGE_FIRST, l = LOADER_MESSAGE_LAST; i <= l; ++i) { - if (mesage_types & (1 << i)) { - results.push_back(GetLoaderMessageToken(static_cast(i))); - } - } - - return Merge(results, ","); -} - -int GetLoaderMessageTypes(const std::string& values) { - std::vector split_values = Split(values, ","); - - int result = 0; - - for (std::size_t i = 0, n = split_values.size(); i < n; ++i) { - const LoaderMessageType message_type = GetLoaderMessageType(split_values[i]); - if (message_type == LOADER_MESSAGE_NONE) { - continue; - } - result |= (1 << message_type); - } - - return result; -} - -LoaderMessageType GetLoaderMessageType(const std::string& value) { - for (int i = LOADER_MESSAGE_FIRST, n = LOADER_MESSAGE_LAST; i <= n; ++i) { - const LoaderMessageType message_type = static_cast(i); - if (::GetLoaderMessageToken(message_type) == value) return message_type; - } - - return LOADER_MESSAGE_NONE; -} - -Environment::Environment(PathManager& paths, const Version& api_version) - : api_version(api_version), +Environment::Environment(Mode mode) + : mode(mode), + active_tab(TAB_DIAGNOSTIC), + has_crashed(false), use_system_tray(false), use_per_application_configuration(false), - loader_message_types(::GetLoaderMessageTypes(qgetenv("VK_LOADER_DEBUG").toStdString())), - paths_manager(paths), - paths(paths_manager) { - const bool result = Load(); - assert(result); + loader_message_types_flags(::GetLogFlags(qgetenv("VK_LOADER_DEBUG").toStdString())), + hide_message_boxes_flags(0) { + if (mode == MODE_AUTO_LOAD_SAVE) { + const bool result = Load(); + assert(result); + } } Environment::~Environment() { - const bool result = Save(); - assert(result); + if (mode == MODE_AUTO_LOAD_SAVE) { + const bool result = Save(); + assert(result); + } } void Environment::Reset(ResetMode mode) { switch (mode) { case DEFAULT: { - this->first_run = true; - this->vkconfig2_version = Version::VKCONFIG; - this->vkconfig3_version = Version::VKCONFIG3; - this->layers_mode = LAYERS_MODE_BY_CONFIGURATOR_RUNNING; + this->global_configuration = ConfigurationInfo(); this->use_per_application_configuration = false; - this->use_application_list = false; this->use_system_tray = false; - this->selected_configuration = "Validation"; - this->active_application.clear(); - this->user_defined_layers_paths[USER_DEFINED_LAYERS_PATHS_GUI].clear(); + this->active_executable_index = 0; - applications = CreateDefaultApplications(); + this->applications = CreateDefaultApplications(); break; } case CLEAR: { this->Reset(DEFAULT); - QSettings settings; - settings.setValue("VKCONFIG_WIDGET_SETTING_INT", false); - settings.setValue("VKCONFIG_WIDGET_SETTING_FLOAT", false); - settings.setValue("VKCONFIG_WIDGET_SETTING_FRAMES", false); - settings.setValue("VKCONFIG_WARN_MISSING_LAYERS_IGNORE", false); - settings.setValue("VKCONFIG_WARN_CORE_SHADER_IGNORE", false); - - settings.setValue(VKCONFIG_KEY_MESSAGE_NEED_APPLICATION_RESTART, false); - settings.setValue("overrideActive", false); - settings.setValue("applyPerApplication", false); - settings.setValue("keepActiveOnExit", false); - - settings.setValue("restartWarning", false); - settings.setValue("warnAboutShutdownState", false); - - const std::string loader_debug_message(qgetenv("VK_LOADER_DEBUG")); - if (loader_debug_message.empty()) { - this->loader_message_types = 0; - } else { - this->loader_message_types = ::GetLoaderMessageTypes(loader_debug_message); - } - settings.setValue(VKCONFIG_KEY_LOADER_MESSAGE, static_cast(this->loader_message_types)); break; } case SYSTEM: { const bool result_env = Load(); assert(result_env); - const bool result_path = paths_manager.Load(); - assert(result_path); break; } default: { @@ -199,197 +123,222 @@ void Environment::Reset(ResetMode mode) { } } +std::string GetPath() { + static const char* TABLE[] = { + "/AppData/Local/LunarG", // ENVIRONMENT_WIN32 + "/.local/share/vulkan" // ENVIRONMENT_UNIX + }; + static_assert(std::size(TABLE) == ENVIRONMENT_COUNT, "The tranlation table size doesn't match the enum number of elements"); + + const std::string home = QDir().homePath().toStdString(); + return home + TABLE[VKC_ENV]; +} + bool Environment::Load() { Reset(DEFAULT); - QSettings settings; - - // Load "first_run" - this->first_run = settings.value(VKCONFIG_KEY_INITIALIZE_FILES, first_run).toBool(); + const Path& vkconfig_init_path = ::Get(Path::INIT); + QFile file(vkconfig_init_path.AbsolutePath().c_str()); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QString data = file.readAll(); + file.close(); - // Load "version": If the version doesn't exist of it's an old version of vkconfig - this->vkconfig2_version = - Version(settings.value(VKCONFIG_KEY_VKCONFIG_VERSION, Version::VKCONFIG.str().c_str()).toString().toStdString()); + const QJsonDocument& json_doc = QJsonDocument::fromJson(data.toLocal8Bit()); + const QJsonObject& json_root_object = json_doc.object(); - // Load "version": If the version doesn't exist of it's an old version of vkconfig - this->vkconfig3_version = - Version(settings.value(VKCONFIG_KEY_VKCONFIG3_VERSION, Version::VKCONFIG3.str().c_str()).toString().toStdString()); + const Version file_format_version = Version(json_root_object.value("file_format_version").toString().toStdString()); + if (file_format_version > Version::VKCONFIG) { + return false; // Vulkan Configurator needs to be updated + } - // Load 'override_mode" - this->layers_mode = static_cast(settings.value(VKCONFIG_KEY_LAYERS_MODE, QVariant(layers_mode)).toInt()); + // interface json object + const QJsonObject& json_interface_object = json_root_object.value("interface").toObject(); + this->active_tab = GetTabType(json_interface_object.value("active_tab").toString().toStdString().c_str()); + this->has_crashed = json_interface_object.value("has_crashed").toBool(); + + // diagnostic json object + const QJsonObject& json_diagnostic_object = json_root_object.value("diagnostic").toObject(); + const QJsonArray& json_loader_messages_array = json_diagnostic_object.value("loader_messages").toArray(); + this->loader_message_types_flags = 0; + for (int i = 0, n = json_loader_messages_array.size(); i < n; ++i) { + const std::string& token = json_loader_messages_array[i].toString().toStdString(); + this->loader_message_types_flags |= GetLogBit(token.c_str()); + } - this->use_per_application_configuration = - static_cast(settings.value(VKCONFIG_KEY_STATE_PER_APPLICATION, this->use_application_list).toBool()); - this->use_application_list = - static_cast(settings.value(VKCONFIG_KEY_STATE_APPLICATION_LIST, this->use_application_list).toBool()); - this->use_system_tray = static_cast(settings.value(VKCONFIG_KEY_STATE_SYSTEM_TRAY, this->use_system_tray).toBool()); + // applications json object + const QJsonObject& json_applications_object = json_root_object.value("applications").toObject(); - // Load loader debug message state - this->loader_message_types = settings.value(VKCONFIG_KEY_LOADER_MESSAGE, static_cast(this->loader_message_types)).toInt(); + this->active_executable_index = json_applications_object.value("active_executable_index").toInt(); - // Load active configuration - this->selected_configuration = - settings.value(VKCONFIG_KEY_ACTIVE_CONFIGURATION, this->selected_configuration.c_str()).toString().toStdString(); + const QJsonObject& json_list_object = json_applications_object.value("list").toObject(); - this->active_application = - settings.value(VKCONFIG_KEY_ACTIVE_APPLICATION, this->active_application.c_str()).toString().toStdString(); + const QStringList& json_list_keys = json_list_object.keys(); - // Load layout state - for (std::size_t i = 0; i < LAYOUT_COUNT; ++i) { - this->layout_states[i] = settings.value(GetLayoutStateToken(static_cast(i))).toByteArray(); - } + this->applications.clear(); + for (int i = 0, n = json_list_keys.length(); i < n; ++i) { + Application application; - // Load default configuration already init - this->default_configuration_filenames = ConvertString(settings.value("default_configuration_files").toStringList()); + const QJsonObject& json_application_object = json_list_object.value(json_list_keys[i]).toObject(); + application.executable_path = json_list_keys[i].toStdString(); + application.configuration.SetName(json_application_object.value("configuration").toString().toStdString()); + application.configuration.SetMode( + ::GetLayersMode(json_application_object.value("mode").toString().toStdString().c_str())); + application.active_option_index = json_application_object.value("active_option_index").toInt(); - const char* SEPARATOR = GetToken(PARSE_ENV_VAR); + const QJsonArray& json_options_array = json_application_object.value("options").toArray(); + for (int j = 0, o = json_options_array.size(); j < o; ++j) { + const QJsonObject& json_options_object = json_options_array[j].toObject(); - // See if the VK_LAYER_PATH environment variable is set. If so, parse it and - // assemble a list of paths that take precidence for layer discovery. - const QString VK_LAYER_PATH(qgetenv("VK_LAYER_PATH")); - if (!VK_LAYER_PATH.isEmpty()) { - this->user_defined_layers_paths[USER_DEFINED_LAYERS_PATHS_ENV_SET] = - ConvertString(QString(qgetenv("VK_LAYER_PATH")).split(SEPARATOR)); - } else { - this->user_defined_layers_paths[USER_DEFINED_LAYERS_PATHS_ENV_SET].clear(); - } + ApplicationOptions application_options; - // See if the VK_ADD_LAYER_PATH environment variable is set. If so, parse it and - // assemble a list of paths that take precidence for layer discovery. - const QString VK_ADD_LAYER_PATH(qgetenv("VK_ADD_LAYER_PATH")); - if (!VK_ADD_LAYER_PATH.isEmpty()) { - this->user_defined_layers_paths[USER_DEFINED_LAYERS_PATHS_ENV_ADD] = - ConvertString(QString(qgetenv("VK_ADD_LAYER_PATH")).split(SEPARATOR)); - } else { - this->user_defined_layers_paths[USER_DEFINED_LAYERS_PATHS_ENV_ADD].clear(); - } + application_options.label = json_options_object.value("label").toString().toStdString(); + application_options.working_folder = json_options_object.value("working_folder").toString().toStdString(); - // Load application list - const bool result = LoadApplications(); - assert(result); + const QJsonArray& json_command_lines_array = json_options_object.value("arguments").toArray(); + for (int k = 0, p = json_command_lines_array.size(); k < p; ++k) { + application_options.arguments.push_back(json_command_lines_array[k].toString().toStdString()); + } - return result; -} + const QJsonArray& json_environment_variables_array = json_options_object.value("environment_variables").toArray(); + for (int k = 0, p = json_environment_variables_array.size(); k < p; ++k) { + application_options.environment_variables.push_back( + json_environment_variables_array[k].toString().toStdString()); + } -bool Environment::LoadApplications() { - const std::string& application_list_json = GetPath(BUILTIN_PATH_APPLIST); - QFile file(application_list_json.c_str()); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // if applist.json exist, load saved applications - QString data = file.readAll(); - file.close(); + application_options.log_file = json_options_array[j].toObject().value("log_file").toString().toStdString(); - applications.clear(); - - if (!data.isEmpty()) { - const QJsonDocument& json_doc = QJsonDocument::fromJson(data.toLocal8Bit()); - assert(json_doc.isObject()); - if (!json_doc.isEmpty()) { - // Get the list of apps - const QJsonObject& json_doc_object = json_doc.object(); - const QStringList& app_keys = json_doc_object.keys(); - - for (int i = 0, n = app_keys.length(); i < n; ++i) { - const QJsonValue& app_value = json_doc_object.value(app_keys[i]); - const QJsonObject& app_object = app_value.toObject(); - - Application application; - application.app_name = app_object.value("app_name").toString().toStdString(); - application.executable_path = app_object.value("app_path").toString().toStdString(); - application.working_folder = app_object.value("app_folder").toString().toStdString(); - application.layers_mode = app_object.value("exclude_override").toBool() ? LAYERS_MODE_BY_APPLICATIONS - : LAYERS_MODE_BY_CONFIGURATOR_RUNNING; - application.log_file = app_object.value("log_file").toString().toStdString(); - if (application.app_name.length() == 0) { - std::string path = application.executable_path.c_str(); - if (path.find(GetNativeSeparator()) != std::string::npos) { - application.app_name = path.substr(path.rfind(GetNativeSeparator()) + 1); - } else { - application.app_name = path; - } - } - - // Arguments are in an array to make room for adding more in a future version - const QJsonArray& args = app_object.value("command_lines").toArray(); - application.arguments = args[0].toString().toStdString(); - - applications.push_back(application); - } + application.options.push_back(application_options); } + + this->applications.push_back(application); } - applications = RemoveMissingApplications(applications); - applications = UpdateDefaultApplications(applications); - if (applications.empty()) applications = CreateDefaultApplications(); + // configurations json object + const QJsonObject& json_configurations_object = json_root_object.value("configurations").toObject(); + this->use_per_application_configuration = json_configurations_object.value("use_per_application").toBool(); + this->global_configuration.SetName(json_configurations_object.value("configuration").toString().toStdString()); + this->global_configuration.SetMode( + ::GetLayersMode(json_configurations_object.value("mode").toString().toStdString().c_str())); + + // preferences json object + const QJsonObject& json_preferences_object = json_root_object.value("preferences").toObject(); + this->use_system_tray = json_preferences_object.value("use_system_tray").toBool(); + this->home_sdk_path = json_preferences_object.value("VK_HOME").toString().toStdString(); + if (this->home_sdk_path.Empty()) { + this->home_sdk_path = ::Get(Path::HOME); + } + + const QJsonArray& json_hide_message_boxes_array = json_preferences_object.value("hide_message_boxes").toArray(); + this->hide_message_boxes_flags = 0; + for (int i = 0, n = json_hide_message_boxes_array.size(); i < n; ++i) { + const std::string& token = json_hide_message_boxes_array[i].toString().toStdString(); + this->hide_message_boxes_flags |= GetLogBit(token.c_str()); + } } return true; } bool Environment::Save() const { - QSettings settings; + const Path& vkconfig_init_path = ::Get(Path::INIT); + + QFile file(vkconfig_init_path.AbsolutePath().c_str()); + const bool result = file.open(QIODevice::WriteOnly | QIODevice::Text); + assert(result); - // Save 'first_run' - settings.setValue(VKCONFIG_KEY_INITIALIZE_FILES, this->first_run); + QJsonObject json_root_object; + json_root_object.insert("file_format_version", Version::VKCONFIG.str().c_str()); - // Save 'version' - settings.setValue(VKCONFIG_KEY_VKCONFIG_VERSION, Version::LAYER_CONFIG.str().c_str()); + QJsonObject json_interface_object; + json_interface_object.insert("active_tab", GetToken(this->active_tab)); + json_interface_object.insert("has_crashed", this->has_crashed); + json_root_object.insert("interface", json_interface_object); - settings.setValue(VKCONFIG_KEY_LAYERS_MODE, this->layers_mode); - settings.setValue(VKCONFIG_KEY_STATE_PER_APPLICATION, this->use_per_application_configuration); - settings.setValue(VKCONFIG_KEY_STATE_APPLICATION_LIST, this->use_application_list); - settings.setValue(VKCONFIG_KEY_STATE_SYSTEM_TRAY, this->use_system_tray); + QJsonObject json_diagnostic_object; - // Save 'loader_message' - settings.setValue(VKCONFIG_KEY_LOADER_MESSAGE, static_cast(this->loader_message_types)); + QJsonArray json_loader_messages_array; + for (int i = LOG_FIRST, n = LOG_COUNT; i < n; ++i) { + LogType type = static_cast(i); + if (this->loader_message_types_flags & (1 << i)) { + json_loader_messages_array.append(GetToken(type)); + } + } + json_diagnostic_object.insert("loader_messages", json_loader_messages_array); - // Save active configuration - settings.setValue(VKCONFIG_KEY_ACTIVE_CONFIGURATION, this->selected_configuration.c_str()); + json_root_object.insert("diagnostic", json_diagnostic_object); - // Save active application - settings.setValue(VKCONFIG_KEY_ACTIVE_APPLICATION, this->active_application.c_str()); + QJsonObject json_applications_object; + json_applications_object.insert("active_executable", this->active_executable_index); + QJsonObject json_applications_list_object; - // Save layout state - for (std::size_t i = 0; i < LAYOUT_COUNT; ++i) { - settings.setValue(GetLayoutStateToken(static_cast(i)), this->layout_states[i]); + for (std::size_t i = 0, n = this->applications.size(); i < n; ++i) { + const Application& application = this->applications[i]; + + QJsonObject json_application_object; + json_application_object.insert("configuration", application.configuration.GetName()); + json_application_object.insert("mode", ::GetToken(application.configuration.GetMode())); + json_application_object.insert("active_option", application.active_option_index); + + QJsonArray json_options_array; + for (std::size_t j = 0, o = application.options.size(); j < o; ++j) { + const ApplicationOptions& options = application.options[j]; + + QJsonArray json_arg_array; + for (std::size_t k = 0, p = options.arguments.size(); k < p; ++k) { + json_arg_array.append(options.arguments[k].c_str()); + } + + QJsonArray json_env_array; + for (std::size_t k = 0, p = options.environment_variables.size(); k < p; ++k) { + json_env_array.append(options.environment_variables[k].c_str()); + } + + QJsonObject json_option_object; + json_option_object.insert("label", options.label.c_str()); + json_option_object.insert("working_folder", options.working_folder.AbsolutePath().c_str()); + json_option_object.insert("arguments", json_arg_array); + json_option_object.insert("environment_variables", json_env_array); + json_option_object.insert("log_file", options.log_file.AbsolutePath().c_str()); + + json_options_array.append(json_option_object); + } + json_application_object.insert("options", json_options_array); + + json_applications_list_object.insert(application.executable_path.AbsolutePath().c_str(), json_application_object); } - // Save default configuration initizalized - settings.setValue("default_configuration_files", ConvertString(this->default_configuration_filenames)); + json_applications_object.insert("list", json_applications_list_object); - const bool result = SaveApplications(); - assert(result); + json_root_object.insert("applications", json_applications_object); - return true; -} + QJsonObject json_layers_object; -bool Environment::SaveApplications() const { - QJsonObject root; + json_root_object.insert("layers", json_layers_object); - for (std::size_t i = 0, n = applications.size(); i < n; ++i) { - // Build an array of appnames with associated data - QJsonObject application_object; - application_object.insert("app_name", applications[i].app_name.c_str()); - application_object.insert("app_path", applications[i].executable_path.c_str()); - application_object.insert("app_folder", applications[i].working_folder.c_str()); - application_object.insert("exclude_override", applications[i].layers_mode == LAYERS_MODE_BY_APPLICATIONS); - application_object.insert("log_file", applications[i].log_file.c_str()); - - // Ground work for mulitiple sets of command line arguments - QJsonArray argsArray; - argsArray.append(QJsonValue(applications[i].arguments.c_str())); - - application_object.insert("command_lines", argsArray); - root.insert(QFileInfo(applications[i].app_name.c_str()).fileName(), application_object); + QJsonObject json_configurations_object; + json_configurations_object.insert("use_per_application", this->use_per_application_configuration); + json_configurations_object.insert("configuration", this->global_configuration.GetName()); + json_configurations_object.insert("mode", ::GetToken(this->global_configuration.GetMode())); + + json_root_object.insert("configurations", json_configurations_object); + + QJsonObject json_preferences_object; + json_preferences_object.insert("use_system_tray", this->use_system_tray); + json_preferences_object.insert("VK_HOME", this->home_sdk_path.RelativePath().c_str()); + + QJsonArray json_hide_message_boxes_array; + for (int i = LOG_FIRST, n = LOG_COUNT; i < n; ++i) { + LogType type = static_cast(i); + if (this->hide_message_boxes_flags & (1 << i)) { + json_hide_message_boxes_array.append(GetToken(type)); + } } + json_preferences_object.insert("hide_message_boxes", json_hide_message_boxes_array); - const std::string& app_list_json = GetPath(BUILTIN_PATH_APPLIST); - assert(QFileInfo(app_list_json.c_str()).absoluteDir().exists()); + json_root_object.insert("preferences", json_preferences_object); - QFile file(app_list_json.c_str()); - const bool result = file.open(QIODevice::WriteOnly | QIODevice::Text); - assert(result); - QJsonDocument doc(root); - file.write(doc.toJson()); + QJsonDocument json_doc(json_root_object); + file.write(json_doc.toJson()); file.close(); return true; @@ -397,23 +346,16 @@ bool Environment::SaveApplications() const { void Environment::SelectActiveApplication(std::size_t application_index) { assert(application_index < this->applications.size()); - - this->SetActiveApplication(this->applications[application_index].app_name); + this->active_executable_index = application_index; } int Environment::GetActiveApplicationIndex() const { - for (std::size_t i = 0, n = this->applications.size(); i < n; ++i) { - if (this->applications[i].app_name == this->active_application) { - return static_cast(i); - } - } - - return 0; // Not found, but the list is present, so return the first item. + return this->active_executable_index; // Not found, but the list is present, so return the first item. } bool Environment::HasOverriddenApplications() const { for (std::size_t i = 0, n = this->applications.size(); i < n; ++i) { - if (this->applications[i].layers_mode != LAYERS_MODE_BY_APPLICATIONS) { + if (this->applications[i].configuration.GetMode() != LAYERS_CONTROLLED_BY_APPLICATIONS) { return true; } } @@ -439,7 +381,9 @@ bool Environment::RemoveApplication(std::size_t application_index) { new_applications.reserve(this->applications.size() - 1); for (std::size_t i = 0, n = this->applications.size(); i < n; ++i) { - if (i == application_index) continue; + if (i == application_index) { + continue; + } new_applications.push_back(this->applications[i]); } @@ -447,16 +391,32 @@ bool Environment::RemoveApplication(std::size_t application_index) { return true; } +const ConfigurationInfo& Environment::GetActiveConfigurationInfo() const { + if (this->GetPerApplicationConfig()) { + return this->GetActiveApplication().configuration; + } else { + return this->global_configuration; + } +} + +ConfigurationInfo& Environment::GetActiveConfigurationInfo() { + if (this->GetPerApplicationConfig()) { + return this->GetActiveApplication().configuration; + } else { + return this->global_configuration; + } +} + const Application& Environment::GetActiveApplication() const { assert(!this->applications.empty()); - for (std::size_t i = 0, n = this->applications.size(); i < n; ++i) { - if (this->applications[i].app_name == this->active_application) { - return this->applications[i]; - } - } + return this->applications[this->active_executable_index]; // Not found, but the list is present, so return the first item. +} - return this->applications[0]; // Not found, but the list is present, so return the first item. +Application& Environment::GetActiveApplication() { + assert(!this->applications.empty()); + + return this->applications[this->active_executable_index]; // Not found, but the list is present, so return the first item. } const Application& Environment::GetApplication(std::size_t application_index) const { @@ -475,16 +435,6 @@ bool Environment::GetPerApplicationConfig() const { return this->use_per_applica void Environment::SetPerApplicationConfig(bool enable) { this->use_per_application_configuration = enable; } -bool Environment::GetUseApplicationList() const { - return this->use_application_list && this->layers_mode != LAYERS_MODE_BY_APPLICATIONS; -} - -void Environment::SetUseApplicationList(bool enable) { this->use_application_list = enable; } - -LayersMode Environment::GetMode() const { return this->layers_mode; } - -void Environment::SetMode(LayersMode mode) { this->layers_mode = mode; } - void Environment::Set(LayoutState state, const QByteArray& data) { assert(state >= LAYOUT_FIRST && state <= LAYOUT_LAST); this->layout_states[state] = data; @@ -495,20 +445,6 @@ const QByteArray& Environment::Get(LayoutState state) const { return this->layout_states[state]; } -bool Environment::IsDefaultConfigurationInit(const std::string& default_configuration_filename) const { - for (std::size_t i = 0, n = this->default_configuration_filenames.size(); i < n; ++i) { - if (this->default_configuration_filenames[i] == default_configuration_filename) { - return true; - } - } - - return false; -} - -void Environment::InitDefaultConfiguration(const std::string& configuration_filename) { - AppendString(this->default_configuration_filenames, configuration_filename); -} - /////////////////////////////////////////////////////////////////////////// /// This is only used on macOS to extract the executable from the bundle. /// You have to look at the plist.info file, you can't just assume whatever @@ -518,8 +454,8 @@ void Environment::InitDefaultConfiguration(const std::string& configuration_file /// Note, not ALL macOS executables are in a bundle, so if a non-bundled /// executable is fed in here, it will silently just return without /// modifying the path (which will be the correct behavior) -bool ExactExecutableFromAppBundle(std::string& app_path) { - std::string path = app_path; +bool ExactExecutableFromAppBundle(Path& app_path) { + std::string path = app_path.AbsolutePath(); path += "/Contents/"; std::string list_file = path + "Info.plist"; QFile file(list_file.c_str()); @@ -554,7 +490,7 @@ bool ExactExecutableFromAppBundle(std::string& app_path) { path += cExeName; // Return original if not found, but root if found - app_path = path; + app_path = Path(path); delete[] cExeName; break; @@ -566,75 +502,88 @@ bool ExactExecutableFromAppBundle(std::string& app_path) { return true; } -std::string Environment::GetDefaultExecutablePath(const std::string& executable_name) const { +DefaultPath Environment::GetDefaultExecutablePath(const std::string& executable_name) const { static const char* DEFAULT_PATH = VKC_PLATFORM == VKC_PLATFORM_MACOS ? "/../.." : ""; + DefaultPath default_path{"." + executable_name, "."}; + // Using VULKAN_SDK environement variable - const std::string env("${VULKAN_SDK}"); - if (!env.empty()) { + const Path env = ::Get(Path::SDK); + if (!env.Empty()) { static const char* TABLE[] = { "/Bin", // ENVIRONMENT_WIN32 "/bin", // ENVIRONMENT_UNIX }; - static_assert(countof(TABLE) == ENVIRONMENT_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(TABLE) == ENVIRONMENT_COUNT); - const std::string search_path = env + TABLE[VKC_ENV] + DEFAULT_PATH + executable_name.c_str(); - const QFileInfo file_info(ReplaceBuiltInVariable(search_path).c_str()); - if (file_info.exists()) { - return search_path; + const Path search_path(env + TABLE[VKC_ENV] + DEFAULT_PATH + executable_name.c_str()); + if (search_path.Exists()) { + default_path.executable_path = Path(search_path.AbsolutePath(), true); + default_path.working_folder = Path(search_path.AbsoluteDir(), true); + return default_path; } } - // Such the default applications from package installation (Linux) + // Search the default applications from package installation (Linux) if (VKC_PLATFORM == VKC_PLATFORM_LINUX) { - const std::string search_path = std::string("/usr/bin") + DEFAULT_PATH + executable_name.c_str(); - const QFileInfo file_info(ReplaceBuiltInVariable(search_path).c_str()); - if (file_info.exists()) { - return search_path; + const Path search_path(std::string("/usr/bin") + DEFAULT_PATH + executable_name); + if (search_path.Exists()) { + default_path.executable_path = Path(search_path.AbsolutePath(), true); + default_path.working_folder = Path(search_path.AbsoluteDir(), true); + return default_path; } } else if (VKC_PLATFORM == VKC_PLATFORM_MACOS) { - const std::string search_path = std::string("/Applications") + executable_name.c_str(); - std::string replaced_string = ReplaceBuiltInVariable(search_path); - const QFileInfo file_info(search_path.c_str()); - if (file_info.exists() && ExactExecutableFromAppBundle(replaced_string)) { - return replaced_string; + Path search_path(std::string("/Applications") + executable_name); + if (search_path.Exists() && ExactExecutableFromAppBundle(search_path)) { + default_path.executable_path = Path(search_path.AbsolutePath(), true); + default_path.working_folder = Path(search_path.AbsoluteDir(), true); + return default_path; } } // Using relative path to vkconfig in case SDK is not "installed" if (VKC_PLATFORM == VKC_PLATFORM_MACOS) { - const std::string search_path = std::string("..") + DEFAULT_PATH + executable_name.c_str(); - std::string replaced_string = ReplaceBuiltInVariable(search_path); - const QFileInfo file_info(replaced_string.c_str()); - if (file_info.exists() && ExactExecutableFromAppBundle(replaced_string)) { - return replaced_string; + Path search_path(std::string("..") + DEFAULT_PATH + executable_name); + if (search_path.Exists() && ExactExecutableFromAppBundle(search_path)) { + default_path.executable_path = Path(search_path.AbsolutePath(), true); + default_path.working_folder = Path(search_path.AbsoluteDir(), true); + return default_path; } } else { - const std::string search_path = std::string(".") + DEFAULT_PATH + executable_name.c_str(); - const QFileInfo file_info(ReplaceBuiltInVariable(search_path).c_str()); - if (file_info.exists()) { - return search_path; + Path search_path(std::string(".") + DEFAULT_PATH + executable_name); + if (search_path.Exists()) { + default_path.executable_path = Path(search_path.AbsolutePath(), true); + default_path.working_folder = Path(search_path.AbsoluteDir(), true); + return default_path; } } - return "./" + executable_name; + return default_path; } -static const DefaultApplication defaults_applications[] = {{"vkcube", ConvertNativeSeparators("/vkcube"), "--suppress_popups"}, - {"vkcubepp", ConvertNativeSeparators("/vkcubepp"), "--suppress_popups"}}; +static const DefaultApplication defaults_applications[] = {{"vkcube", "/vkcube", "--suppress_popups"}, + {"vkcubepp", "/vkcubepp", "--suppress_popups"}}; Application Environment::CreateDefaultApplication(const DefaultApplication& default_application) const { - const std::string executable_path = GetDefaultExecutablePath((default_application.key + GetApplicationSuffix()).c_str()); - if (executable_path.empty()) Application(); // application could not be found.. - - Application application(default_application.name, executable_path, default_application.arguments); + const DefaultPath& default_paths = GetDefaultExecutablePath((default_application.key + GetApplicationSuffix()).c_str()); + if (default_paths.executable_path.Empty()) { + Application(); // application could not be found.. + } + ApplicationOptions options; + options.label = "Default"; + options.working_folder = default_paths.working_folder; // On all operating systems, but Windows we keep running into problems with this ending up // somewhere the user isn't allowed to create and write files. For consistncy sake, the log // initially will be set to the users home folder across all OS's. This is highly visible // in the application launcher and should not present a usability issue. The developer can // easily change this later to anywhere they like. - application.log_file = std::string("${VK_LOCAL}") + default_application.key + ".txt"; + options.log_file = std::string("${VK_LOCAL}") + default_application.key + ".txt"; + + Application application; + application.executable_path = Path(default_paths.executable_path.AbsolutePath(), true); + application.options.push_back(options); + application.active_option_index = 0; return application; } @@ -642,10 +591,12 @@ Application Environment::CreateDefaultApplication(const DefaultApplication& defa std::vector Environment::CreateDefaultApplications() const { std::vector new_applications; - for (std::size_t name_index = 0, name_count = countof(defaults_applications); name_index < name_count; ++name_index) { + for (std::size_t name_index = 0, name_count = std::size(defaults_applications); name_index < name_count; ++name_index) { const Application& application = CreateDefaultApplication(defaults_applications[name_index]); - if (application.executable_path.empty()) continue; + if (application.executable_path.Empty()) { + continue; + } new_applications.push_back(application); } @@ -660,8 +611,10 @@ std::vector Environment::RemoveMissingApplications(const std::vecto for (std::size_t i = 0, n = applications.size(); i < n; ++i) { const Application& application = applications[i]; - const QFileInfo file_info(application.executable_path.c_str()); - if (!file_info.exists()) continue; + const QFileInfo file_info(application.executable_path.AbsolutePath().c_str()); + if (!file_info.exists()) { + continue; + } valid_applications.push_back(application); } @@ -673,7 +626,7 @@ std::vector Environment::UpdateDefaultApplications(const std::vecto std::vector search_applications; std::vector updated_applications = applications; - for (std::size_t default_index = 0, default_count = countof(defaults_applications); default_index < default_count; + for (std::size_t default_index = 0, default_count = std::size(defaults_applications); default_index < default_count; ++default_index) { const std::string defaults_name = defaults_applications[default_index].key + GetApplicationSuffix(); @@ -684,7 +637,7 @@ std::vector Environment::UpdateDefaultApplications(const std::vecto application_index < application_count; ++application_index) { const Application& application = search_applications[application_index]; - if (QString(application.executable_path.c_str()).endsWith(defaults_name.c_str())) { + if (QString(application.executable_path.AbsolutePath().c_str()).endsWith(defaults_name.c_str())) { updated_applications.push_back(CreateDefaultApplication(defaults_applications[default_index])); } else { updated_applications.push_back(application); diff --git a/vkconfig_core/environment.h b/vkconfig_core/environment.h index 44101fe310..6e74a7b28c 100644 --- a/vkconfig_core/environment.h +++ b/vkconfig_core/environment.h @@ -21,9 +21,9 @@ #pragma once #include "version.h" -#include "environment_key.h" #include "application.h" -#include "path_manager.h" +#include "type_tab.h" +#include "type_log.h" #include @@ -53,98 +53,22 @@ enum LayoutState { enum { LAYOUT_COUNT = LAYOUT_LAST - LAYOUT_FIRST + 1 }; -enum UserDefinedLayersPaths { - USER_DEFINED_LAYERS_PATHS_ENV_SET = 0, // VK_LAYER_PATH - USER_DEFINED_LAYERS_PATHS_ENV_ADD, // VK_ADD_LAYER_PATH - USER_DEFINED_LAYERS_PATHS_GUI, - - USER_DEFINED_LAYERS_PATHS_FIRST = USER_DEFINED_LAYERS_PATHS_ENV_SET, - USER_DEFINED_LAYERS_PATHS_LAST = USER_DEFINED_LAYERS_PATHS_GUI, -}; - -enum { USER_DEFINED_LAYERS_PATHS_COUNT = USER_DEFINED_LAYERS_PATHS_LAST - USER_DEFINED_LAYERS_PATHS_FIRST + 1 }; - -enum LoaderMessageType { - LOADER_MESSAGE_NONE = 0, - LOADER_MESSAGE_ERROR, - LOADER_MESSAGE_WARN, - LOADER_MESSAGE_INFO, - LOADER_MESSAGE_DEBUG, - LOADER_MESSAGE_LAYER, - LOADER_MESSAGE_IMPLEMENTATION, - LOADER_MESSAGE_ALL, - - LOADER_MESSAGE_FIRST = LOADER_MESSAGE_ERROR, - LOADER_MESSAGE_LAST = LOADER_MESSAGE_IMPLEMENTATION, -}; - -enum { LOADER_MESSAGE_COUNT = LOADER_MESSAGE_LAST - LOADER_MESSAGE_FIRST + 1 }; - -enum { - LOADER_MESSAGE_ERROR_BIT = (1 << LOADER_MESSAGE_ERROR), - LOADER_MESSAGE_WARN_BIT = (1 << LOADER_MESSAGE_WARN), - LOADER_MESSAGE_INFO_BIT = (1 << LOADER_MESSAGE_INFO), - LOADER_MESSAGE_DEBUG_BIT = (1 << LOADER_MESSAGE_DEBUG), - LOADER_MESSAGE_LAYER_BIT = (1 << LOADER_MESSAGE_LAYER), - LOADER_MESSAGE_IMPLEMENTATION_BIT = (1 << LOADER_MESSAGE_IMPLEMENTATION), - LOADER_MESSAGE_ALL_BIT = LOADER_MESSAGE_ERROR_BIT | LOADER_MESSAGE_WARN_BIT | LOADER_MESSAGE_INFO_BIT | - LOADER_MESSAGE_DEBUG_BIT | LOADER_MESSAGE_LAYER_BIT | LOADER_MESSAGE_IMPLEMENTATION_BIT -}; - -inline int GetLoaderMessageFlags(LoaderMessageType level) { - int flags = 0; - - switch (level) { - default: - case LOADER_MESSAGE_ALL: - case LOADER_MESSAGE_IMPLEMENTATION: - flags |= LOADER_MESSAGE_IMPLEMENTATION_BIT; - case LOADER_MESSAGE_LAYER: - flags |= LOADER_MESSAGE_LAYER_BIT; - case LOADER_MESSAGE_DEBUG: - flags |= LOADER_MESSAGE_DEBUG_BIT; - case LOADER_MESSAGE_INFO: - flags |= LOADER_MESSAGE_INFO_BIT; - case LOADER_MESSAGE_WARN: - flags |= LOADER_MESSAGE_WARN_BIT; - case LOADER_MESSAGE_ERROR: - flags |= LOADER_MESSAGE_ERROR_BIT; - case LOADER_MESSAGE_NONE: - flags |= 0; - } - - return flags; -} - -inline LoaderMessageType GetLoaderMessageType(int flags) { - if (flags == LOADER_MESSAGE_ALL_BIT) { - return LOADER_MESSAGE_ALL; - } else if (flags & LOADER_MESSAGE_IMPLEMENTATION_BIT) { - return LOADER_MESSAGE_IMPLEMENTATION; - } else if (flags & LOADER_MESSAGE_LAYER_BIT) { - return LOADER_MESSAGE_LAYER; - } else if (flags & LOADER_MESSAGE_DEBUG_BIT) { - return LOADER_MESSAGE_DEBUG; - } else if (flags & LOADER_MESSAGE_INFO_BIT) { - return LOADER_MESSAGE_INFO; - } else if (flags & LOADER_MESSAGE_WARN_BIT) { - return LOADER_MESSAGE_WARN; - } else if (flags & LOADER_MESSAGE_ERROR_BIT) { - return LOADER_MESSAGE_ERROR; - } else { - return LOADER_MESSAGE_NONE; - } -} - struct DefaultApplication { std::string name; std::string key; std::string arguments; }; +struct DefaultPath { + Path executable_path; + Path working_folder; +}; + class Environment { public: - Environment(PathManager& paths, const Version& api_version = Version::VKHEADER); + enum Mode { MODE_AUTO_LOAD_SAVE = 0, MODE_UNINITIALIZED }; + + Environment(Mode mode = MODE_AUTO_LOAD_SAVE); ~Environment(); enum ResetMode { DEFAULT = 0, CLEAR, SYSTEM }; @@ -152,9 +76,7 @@ class Environment { void Reset(ResetMode mode); bool Load(); - bool LoadApplications(); bool Save() const; - bool SaveApplications() const; void SelectActiveApplication(std::size_t application_index); int GetActiveApplicationIndex() const; @@ -162,91 +84,61 @@ class Environment { bool AppendApplication(const Application& application); bool RemoveApplication(std::size_t application_index); - void SetActiveApplication(const std::string& name) { this->active_application = name; } + const ConfigurationInfo& GetActiveConfigurationInfo() const; + ConfigurationInfo& GetActiveConfigurationInfo(); + const std::vector& GetApplications() const { return applications; } const Application& GetActiveApplication() const; + Application& GetActiveApplication(); const Application& GetApplication(std::size_t application_index) const; Application& GetApplication(std::size_t application_index); - const std::string& GetSelectedConfiguration() const { return this->selected_configuration; } - void SetSelectedConfiguration(const std::string& name) { this->selected_configuration = name; } - const QByteArray& Get(LayoutState state) const; void Set(LayoutState state, const QByteArray& data); bool GetPerApplicationConfig() const; void SetPerApplicationConfig(bool enable); - bool GetUseApplicationList() const; - void SetUseApplicationList(bool enable); - bool GetUseSystemTray() const { return this->use_system_tray; } void SetUseSystemTray(bool enable) { this->use_system_tray = enable; } - LayersMode GetMode() const; - void SetMode(LayersMode mode); - - int GetLoaderMessageTypes() const { return this->loader_message_types; } - void SetLoaderMessageTypes(int types) { this->loader_message_types = types; } - - bool first_run; - const Version api_version; + LogFlags GetLoaderMessageFlags() const { return this->loader_message_types_flags; } + void SetLoaderMessageFlags(LogFlags flags) { this->loader_message_types_flags = flags; } - void SetPerConfigUserDefinedLayersPaths(const std::vector& paths) { - std::vector& custom_layer_paths_gui = user_defined_layers_paths[USER_DEFINED_LAYERS_PATHS_GUI]; - custom_layer_paths_gui.clear(); - for (std::size_t i = 0, n = paths.size(); i < n; ++i) { - custom_layer_paths_gui.push_back(ConvertNativeSeparators(paths[i]).c_str()); - } - } + // Search for all the applications in the list, an remove the application which executable can't be found + std::vector RemoveMissingApplications(const std::vector& applications) const; - const std::vector& GetUserDefinedLayersPaths(UserDefinedLayersPaths user_defined_layers_paths_id) const { - return user_defined_layers_paths[user_defined_layers_paths_id]; - } + bool has_crashed; + int hide_message_boxes_flags; - bool IsDefaultConfigurationInit(const std::string& configuration_filename) const; - void InitDefaultConfiguration(const std::string& configuration_filename); + Path path_export; + Path path_import; - // Search for all the applications in the list, an remove the application which executable can't be found - std::vector RemoveMissingApplications(const std::vector& applications) const; + ConfigurationInfo global_configuration; private: Environment(const Environment&) = delete; Environment& operator=(const Environment&) = delete; - Version vkconfig2_version; - Version vkconfig3_version; - LayersMode layers_mode; - bool use_application_list; + const Mode mode; + + TabType active_tab; bool use_system_tray; bool use_per_application_configuration; - int loader_message_types; + LogFlags loader_message_types_flags; + Path home_sdk_path; - std::string selected_configuration; - std::string active_application; + int active_executable_index; std::array layout_states; - std::array, USER_DEFINED_LAYERS_PATHS_COUNT> user_defined_layers_paths; std::vector applications; - PathManager& paths_manager; - - std::vector default_configuration_filenames; - // Update default applications path to use relative path (really useful only on Windows) std::vector UpdateDefaultApplications(const std::vector& applications) const; // Create a list of default applications, eg vkcube std::vector CreateDefaultApplications() const; Application CreateDefaultApplication(const DefaultApplication& default_application) const; - std::string GetDefaultExecutablePath(const std::string& executable_name) const; - - public: - const PathManager& paths; + DefaultPath GetDefaultExecutablePath(const std::string& executable_name) const; }; -bool ExactExecutableFromAppBundle(std::string& path); - -LoaderMessageType GetLoaderMessageType(const std::string& value); -int GetLoaderMessageTypes(const std::string& values); -std::string GetLoaderMessageToken(LoaderMessageType mesage_type); -std::string GetLoaderMessageTokens(int mesage_types); +bool ExactExecutableFromAppBundle(Path& path); diff --git a/vkconfig_core/environment_key.h b/vkconfig_core/environment_key.h deleted file mode 100644 index ab5f7a1cd3..0000000000 --- a/vkconfig_core/environment_key.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024-2024 Valve Corporation - * Copyright (c) 2024-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -// Saved settings for the application -#define VKCONFIG_KEY_STATE_PER_APPLICATION "STATE_PerApplication" -#define VKCONFIG_KEY_STATE_APPLICATION_LIST "STATE_Applicationlist" -#define VKCONFIG_KEY_STATE_SYSTEM_TRAY "STATE_SystemTray" - -#define VKCONFIG_KEY_MESSAGE_SYSTEM_TRAY "MESSAGE_SystemTray" -#define VKCONFIG_KEY_MESSAGE_NEED_APPLICATION_RESTART "MESSAGE_NeedApplicationRestart" - -#define VKCONFIG_KEY_INITIALIZE_FILES "FirstTimeRun" -#define VKCONFIG_KEY_LAYERS_MODE "LayersMode" -#define VKCONFIG_KEY_LOADER_MESSAGE "LoaderMessage" - -#define VKCONFIG_KEY_ACTIVE_CONFIGURATION "ActiveConfiguration" -#define VKCONFIG_KEY_ACTIVE_APPLICATION "ActiveApplication" - -#define VKCONFIG_KEY_VKCONFIG_VERSION "vkConfigVersion" -#define VKCONFIG_KEY_VKCONFIG3_VERSION "vkConfig3Version" -#define VKCONFIG_KEY_CUSTOM_PATHS "customPaths" diff --git a/vkconfig_core/header.cpp b/vkconfig_core/header.cpp index 8aa22be48b..014371fa78 100644 --- a/vkconfig_core/header.cpp +++ b/vkconfig_core/header.cpp @@ -45,7 +45,7 @@ const char* GetToken(SettingView state) { "ADVANCED", // SETTING_VIEW_ADVANCED "HIDDEN", // SETTING_VIEW_HIDDEN }; - static_assert(countof(table) == SETTING_VIEW_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(table) == SETTING_VIEW_COUNT, "The tranlation table size doesn't match the enum number of elements"); return table[state]; } diff --git a/vkconfig_core/header.h b/vkconfig_core/header.h index 1a23636187..38fcec5160 100644 --- a/vkconfig_core/header.h +++ b/vkconfig_core/header.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,8 @@ #pragma once -#include "platform.h" +#include "type_platform.h" +#include "type_status.h" #include "json.h" #include diff --git a/vkconfig_core/help.cpp b/vkconfig_core/help.cpp index cbeddea984..41933a8925 100644 --- a/vkconfig_core/help.cpp +++ b/vkconfig_core/help.cpp @@ -20,7 +20,7 @@ #include "help.h" #include "util.h" -#include "platform.h" +#include "type_platform.h" #include diff --git a/vkconfig_core/json.h b/vkconfig_core/json.h index 383a2240f2..822cb8e6dd 100644 --- a/vkconfig_core/json.h +++ b/vkconfig_core/json.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/vkconfig_core/json_validator.cpp b/vkconfig_core/json_validator.cpp index 95c9fd5eec..fc16d67cca 100644 --- a/vkconfig_core/json_validator.cpp +++ b/vkconfig_core/json_validator.cpp @@ -49,7 +49,7 @@ bool JsonValidator::Check(const QString &json_data) { assert(!json_data.isEmpty()); if (!schema) { - const QJsonDocument schema_document = ParseJsonFile(":/layers/schema.json"); + const QJsonDocument schema_document = ParseJsonFile(":/vkconfig/schema.json"); schema.reset(new Schema); diff --git a/vkconfig_core/json_validator.h b/vkconfig_core/json_validator.h index c354bc8770..70f8a09538 100644 --- a/vkconfig_core/json_validator.h +++ b/vkconfig_core/json_validator.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/vkconfig_core/layer.cpp b/vkconfig_core/layer.cpp index 4d08c04343..f0790aaaf2 100644 --- a/vkconfig_core/layer.cpp +++ b/vkconfig_core/layer.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022 Valve Corporation - * Copyright (c) 2020-2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ #include "setting_int.h" #include "setting_list.h" #include "setting_string.h" -#include "platform.h" +#include "type_platform.h" #include "util.h" #include "path.h" #include "json.h" @@ -47,42 +47,13 @@ #include #include -static std::string GetBuiltinFolder(const Version& version) { - QDir dir(":/layers"); - dir.setFilter(QDir::Dirs); - QFileInfoList list = dir.entryInfoList(); - - std::vector version_supported; - - for (int i = 0, n = list.size(); i < n; ++i) { - const std::string value = list[i].baseName().toStdString(); - if (!IsNumber(value)) continue; - version_supported.push_back(std::atoi(value.c_str())); - } - - std::sort(version_supported.begin(), version_supported.end()); - - const int searched_version = version.GetPatch(); - - for (int i = static_cast(version_supported.size()) - 1; i >= 0; --i) { - const int current_version = version_supported[i]; - - if (searched_version < current_version) continue; - - return format(":/layers/%d", current_version); - } - - return ":/layers/170"; -} - const char* Layer::NO_PRESET = "User-Defined Settings"; -Layer::Layer() : status(STATUS_STABLE), platforms(PLATFORM_DESKTOP_BIT), type(LAYER_TYPE_EXPLICIT) {} +Layer::Layer() : status(STATUS_STABLE), platforms(PLATFORM_DESKTOP_BIT) {} -Layer::Layer(const std::string& key, const LayerType layer_type) - : key(key), status(STATUS_STABLE), platforms(PLATFORM_DESKTOP_BIT), type(layer_type) {} +Layer::Layer(const std::string& key) : key(key), status(STATUS_STABLE), platforms(PLATFORM_DESKTOP_BIT) {} -Layer::Layer(const std::string& key, const LayerType layer_type, const Version& file_format_version, const Version& api_version, +Layer::Layer(const std::string& key, const Version& file_format_version, const Version& api_version, const std::string& implementation_version, const std::string& library_path) : key(key), file_format_version(file_format_version), @@ -90,12 +61,11 @@ Layer::Layer(const std::string& key, const LayerType layer_type, const Version& api_version(api_version), implementation_version(implementation_version), status(STATUS_STABLE), - platforms(PLATFORM_DESKTOP_BIT), - type(layer_type) {} + platforms(PLATFORM_DESKTOP_BIT) {} // Todo: Load the layer with Vulkan API bool Layer::IsValid() const { - return file_format_version != Version::VERSION_NULL && !key.empty() && !binary_path.empty() && + return file_format_version != Version::VERSION_NULL && !key.empty() && !binary_path.Empty() && api_version != Version::VERSION_NULL && !implementation_version.empty(); } @@ -164,181 +134,14 @@ SettingMeta* Layer::Instantiate(SettingMetaSet& meta_set, const std::string& key return setting_meta; } -bool Layer::Load(const std::vector& available_layers, const std::string& full_path_to_file, LayerType layer_type) { - this->type = layer_type; // Set layer type, no way to know this from the json file - - if (full_path_to_file.empty()) return false; - - QFile file(full_path_to_file.c_str()); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - return false; - } - - QString json_text = file.readAll(); - file.close(); - - this->manifest_path = full_path_to_file; - - // Convert the text to a JSON document & validate it. - // It does need to be a valid json formatted file. - QJsonParseError json_parse_error; - const QJsonDocument& json_document = QJsonDocument::fromJson(json_text.toUtf8(), &json_parse_error); - if (json_parse_error.error != QJsonParseError::NoError) { - return false; - } - - // Make sure it's not empty - if (json_document.isNull() || json_document.isEmpty()) { - return false; - } - - // First check it's a layer manifest, ignore otherwise. - const QJsonObject& json_root_object = json_document.object(); - if (json_root_object.value("file_format_version") == QJsonValue::Undefined) { - return false; // Not a layer JSON file - } - if (json_root_object.value("layer") == QJsonValue::Undefined) { - return false; // Not a layer JSON file - } - - this->file_format_version = ReadVersionValue(json_root_object, "file_format_version"); - if (this->file_format_version.GetMajor() > 1) { - Alert::LayerInvalid(full_path_to_file.c_str(), - format("Unsupported layer file format: %s", this->file_format_version.str().c_str()).c_str()); - return false; - } - - const QJsonObject& json_layer_object = ReadObject(json_root_object, "layer"); - - std::string current_last_modified = QFileInfo(full_path_to_file.c_str()).lastModified().toString(Qt::ISODate).toStdString(); - - QSettings settings; - std::string cached_last_modified = settings.value(full_path_to_file.c_str()).toString().toStdString(); - - this->key = ReadStringValue(json_layer_object, "name"); +bool Layer::Load(const Path& full_path_to_file, LayerType type) { + this->type = type; // Set layer type, no way to know this from the json file - if (this->key == "VK_LAYER_LUNARG_override") { + if (full_path_to_file.Empty()) { return false; } - // Check if a layer with the same name is already in the list - if (FindByKey(available_layers, this->key.c_str()) != nullptr) { - return false; - } - - this->api_version = ReadVersionValue(json_layer_object, "api_version"); - - const bool is_builtin_layer_file = - full_path_to_file.rfind(":/") == 0; // Check whether the path start with ":/" for resource file paths. - - JsonValidator validator; - - const bool should_validate = current_last_modified != cached_last_modified; - const bool is_valid = should_validate ? validator.Check(json_text) : true; - - if (should_validate && is_valid) { - settings.setValue(full_path_to_file.c_str(), current_last_modified.c_str()); - } - - const QJsonValue& json_library_path_value = json_layer_object.value("library_path"); - if (json_library_path_value != QJsonValue::Undefined) { - this->binary_path = json_library_path_value.toString().toStdString(); - } - - this->implementation_version = ReadStringValue(json_layer_object, "implementation_version"); - if (json_layer_object.value("status") != QJsonValue::Undefined) { - this->status = GetStatusType(ReadStringValue(json_layer_object, "status").c_str()); - } - if (json_layer_object.value("platforms") != QJsonValue::Undefined) { - this->platforms = GetPlatformFlags(ReadStringArray(json_layer_object, "platforms")); - } - this->description = ReadStringValue(json_layer_object, "description"); - if (json_layer_object.value("introduction") != QJsonValue::Undefined) { - this->introduction = ReadStringValue(json_layer_object, "introduction"); - } - if (json_layer_object.value("url") != QJsonValue::Undefined) { - this->url = ReadStringValue(json_layer_object, "url"); - } - - if (json_layer_object.value("disable_environment") != QJsonValue::Undefined) { - const QJsonObject& json_env_object = json_layer_object.value("disable_environment").toObject(); - const QStringList keys = json_env_object.keys(); - this->disable_env = keys[0].toStdString(); - this->disable_value = ReadStringValue(json_env_object, this->disable_env.c_str()) == "1"; - } - if (json_layer_object.value("enable_environment") != QJsonValue::Undefined) { - const QJsonObject& json_env_object = json_layer_object.value("enable_environment").toObject(); - const QStringList keys = json_env_object.keys(); - this->enable_env = keys[0].toStdString(); - this->enable_value = ReadStringValue(json_env_object, this->enable_env.c_str()) == "1"; - } - - if (!is_valid && this->key != "VK_LAYER_LUNARG_override") { - if (!is_builtin_layer_file || (is_builtin_layer_file && this->api_version >= Version(1, 2, 170))) { - Alert::LayerInvalid(full_path_to_file.c_str(), validator.message.toStdString().c_str()); - return false; - } - } - - const QJsonValue& json_features_value = json_layer_object.value("features"); - if (json_features_value != QJsonValue::Undefined) { - const QJsonObject& json_features_object = json_features_value.toObject(); - - // Load layer settings - const QJsonValue& json_settings_value = json_features_object.value("settings"); - if (json_settings_value != QJsonValue::Undefined) { - AddSettingsSet(this->settings, nullptr, json_settings_value); - } - - // Load layer presets - const QJsonValue& json_presets_value = json_features_object.value("presets"); - if (json_presets_value != QJsonValue::Undefined) { - assert(json_presets_value.isArray()); - const QJsonArray& json_preset_array = json_presets_value.toArray(); - for (int preset_index = 0, preset_count = json_preset_array.size(); preset_index < preset_count; ++preset_index) { - const QJsonObject& json_preset_object = json_preset_array[preset_index].toObject(); - - LayerPreset preset; - preset.platform_flags = this->platforms; - preset.status = this->status; - LoadMetaHeader(preset, json_preset_object); - - const QJsonArray& json_setting_array = ReadArray(json_preset_object, "settings"); - for (int setting_index = 0, setting_count = json_setting_array.size(); setting_index < setting_count; - ++setting_index) { - AddSettingData((SettingDataSet&)preset.settings, json_setting_array[setting_index]); - } - - this->presets.push_back(preset); - } - } - } - - // Override old built-in layer settings - if (!is_builtin_layer_file && this->api_version <= Version(1, 2, 176)) { - const std::string path = GetBuiltinFolder(this->api_version) + "/" + this->key + ".json"; - - Layer default_layer; - if (default_layer.Load(available_layers, path, this->type)) { - this->introduction = default_layer.introduction; - this->url = default_layer.url; - this->platforms = default_layer.platforms; - this->status = default_layer.status; - std::swap(this->settings, default_layer.settings); - std::swap(this->presets, default_layer.presets); - this->memory = default_layer.memory; - } - } - - return this->IsValid(); // Not all JSON file are layer JSON valid -} - -bool Layer::Load(const std::string& full_path_to_file, LayerType layer_type) { - this->type = layer_type; // Set layer type, no way to know this from the json file - - if (full_path_to_file.empty()) return false; - - QFile file(full_path_to_file.c_str()); + QFile file(full_path_to_file.AbsolutePath().c_str()); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { return false; } @@ -372,17 +175,17 @@ bool Layer::Load(const std::string& full_path_to_file, LayerType layer_type) { this->file_format_version = ReadVersionValue(json_root_object, "file_format_version"); if (this->file_format_version.GetMajor() > 1) { - Alert::LayerInvalid(full_path_to_file.c_str(), - format("Unsupported layer file format: %s", this->file_format_version.str().c_str()).c_str()); + const std::string message = format("Unsupported layer file format: %s", this->file_format_version.str().c_str()); + Alert::LayerInvalid(full_path_to_file, message.c_str()); return false; } const QJsonObject& json_layer_object = ReadObject(json_root_object, "layer"); - std::string current_last_modified = QFileInfo(full_path_to_file.c_str()).lastModified().toString(Qt::ISODate).toStdString(); + std::string current_last_modified = full_path_to_file.LastModified(); QSettings settings; - std::string cached_last_modified = settings.value(full_path_to_file.c_str()).toString().toStdString(); + std::string cached_last_modified = settings.value(full_path_to_file.AbsolutePath().c_str()).toString().toStdString(); this->key = ReadStringValue(json_layer_object, "name"); @@ -392,16 +195,13 @@ bool Layer::Load(const std::string& full_path_to_file, LayerType layer_type) { this->api_version = ReadVersionValue(json_layer_object, "api_version"); - const bool is_builtin_layer_file = - full_path_to_file.rfind(":/") == 0; // Check whether the path start with ":/" for resource file paths. - JsonValidator validator; const bool should_validate = current_last_modified != cached_last_modified; const bool is_valid = should_validate ? validator.Check(json_text) : true; if (should_validate && is_valid) { - settings.setValue(full_path_to_file.c_str(), current_last_modified.c_str()); + settings.setValue(full_path_to_file.AbsolutePath().c_str(), current_last_modified.c_str()); } const QJsonValue& json_library_path_value = json_layer_object.value("library_path"); @@ -437,11 +237,9 @@ bool Layer::Load(const std::string& full_path_to_file, LayerType layer_type) { this->enable_value = ReadStringValue(json_env_object, this->enable_env.c_str()) == "1"; } - if (!is_valid && this->key != "VK_LAYER_LUNARG_override") { - if (!is_builtin_layer_file || (is_builtin_layer_file && this->api_version >= Version(1, 2, 170))) { - Alert::LayerInvalid(full_path_to_file.c_str(), validator.message.toStdString().c_str()); - return false; - } + if (!is_valid) { + Alert::LayerInvalid(full_path_to_file, validator.message.toStdString().c_str()); + return false; } const QJsonValue& json_features_value = json_layer_object.value("features"); @@ -478,22 +276,6 @@ bool Layer::Load(const std::string& full_path_to_file, LayerType layer_type) { } } - // Override old built-in layer settings - if (!is_builtin_layer_file && this->api_version <= Version(1, 2, 176)) { - const std::string path = GetBuiltinFolder(this->api_version) + "/" + this->key + ".json"; - - Layer default_layer; - if (default_layer.Load(path, this->type)) { - this->introduction = default_layer.introduction; - this->url = default_layer.url; - this->platforms = default_layer.platforms; - this->status = default_layer.status; - std::swap(this->settings, default_layer.settings); - std::swap(this->presets, default_layer.presets); - this->memory = default_layer.memory; - } - } - return this->IsValid(); // Not all JSON file are layer JSON valid } @@ -539,7 +321,7 @@ void Layer::AddSettingsSet(SettingMetaSet& settings, const SettingMeta* parent, if (setting_meta->type == SETTING_LOAD_FILE) { const SettingMetaFileLoad& setting_file = static_cast(*setting_meta); if (setting_file.format == "PROFILE") { - const std::string& value = ReplaceBuiltInVariable(setting_file.default_value); + const std::string& value = setting_file.default_value.AbsolutePath(); const QJsonDocument& doc = ParseJsonFile(value.c_str()); if (!doc.isNull() && !doc.isEmpty()) { diff --git a/vkconfig_core/layer.h b/vkconfig_core/layer.h index dad1e5b6d8..9d049dbb75 100644 --- a/vkconfig_core/layer.h +++ b/vkconfig_core/layer.h @@ -23,8 +23,9 @@ #include "setting.h" #include "layer_preset.h" -#include "layer_type.h" #include "version.h" +#include "path.h" +#include "type_layer_type.h" #include #include @@ -38,8 +39,8 @@ class Layer { static const char* NO_PRESET; Layer(); - Layer(const std::string& key, const LayerType layer_type); - Layer(const std::string& key, const LayerType layer_type, const Version& file_format_version, const Version& api_version, + Layer(const std::string& key); + Layer(const std::string& key, const Version& file_format_version, const Version& api_version, const std::string& implementation_version, const std::string& library_path); bool IsValid() const; @@ -55,7 +56,7 @@ class Layer { public: std::string key; Version file_format_version; - std::string binary_path; + Path binary_path; Version api_version; std::string implementation_version; StatusType status; @@ -63,8 +64,8 @@ class Layer { std::string introduction; std::string url; int platforms; - std::string manifest_path; - LayerType type; + Path manifest_path; + LayerType type = LAYER_TYPE_EXPLICIT; QJsonDocument profile; std::string disable_env; std::string enable_env; @@ -74,9 +75,7 @@ class Layer { std::vector settings; std::vector presets; - bool Load(const std::vector& available_layers, const std::string& full_path_to_file, LayerType layer_type); - - bool Load(const std::string& full_path_to_file, LayerType layer_type); + bool Load(const Path& full_path_to_file, LayerType type = LAYER_TYPE_EXPLICIT); private: Layer& operator=(const Layer&) = delete; diff --git a/vkconfig_core/layer_manager.cpp b/vkconfig_core/layer_manager.cpp index 3e53b4a8d9..0ecdd92b02 100644 --- a/vkconfig_core/layer_manager.cpp +++ b/vkconfig_core/layer_manager.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022 Valve Corporation - * Copyright (c) 2020-2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,272 +20,167 @@ #include "layer_manager.h" #include "util.h" -#include "platform.h" +#include "type_platform.h" #include "registry.h" -#include -#include -#include - -/// Going back and forth between the Windows registry and looking for files -/// in specific folders is just a mess. This class consolidates all that into -/// one single abstraction that knows whether to look in the registry or in -/// a folder with QDir. -/// This is a little weird because generally QSettings is for going back -/// and forth between the Registry or .ini files. Here, I'm going from -/// the registry to directory entries. -class PathFinder { - private: - QStringList files; - - public: - PathFinder() {} - - // Constructor does all the work. Abstracts away instances where we might - // be searching a disk path, or a registry path. - // TBD, does this really need it's own file/module? - PathFinder(const std::string &path, bool force_file_system = (VKC_PLATFORM != VKC_PLATFORM_WINDOWS)) { - if (!force_file_system) { - QSettings settings(path.c_str(), QSettings::NativeFormat); - files = settings.allKeys(); - } else { - QDir dir(path.c_str()); - QFileInfoList file_info_list = dir.entryInfoList(QStringList() << "*.json", QDir::Files); - - for (int file_index = 0; file_index < file_info_list.size(); ++file_index) { - files << file_info_list[file_index].filePath(); - } - } +LayerType GetLayerType(LayersPaths Layers_paths_type) { + if (Layers_paths_type == LAYERS_PATHS_IMPLICIT) { + return LAYER_TYPE_IMPLICIT; + } else { + return LAYER_TYPE_EXPLICIT; } +} - int FileCount() const { return files.size(); } - std::string GetFileName(int i) const { return files[i].toStdString(); } -}; +std::vector GetImplicitLayerPaths() { + std::vector result; #if VKC_PLATFORM == VKC_PLATFORM_WINDOWS -static const char *SEARCH_PATHS[] = {"HKEY_LOCAL_MACHINE\\Software\\Khronos\\Vulkan\\ExplicitLayers", - "HKEY_LOCAL_MACHINE\\Software\\Khronos\\Vulkan\\ImplicitLayers", - "HKEY_CURRENT_USER\\Software\\Khronos\\Vulkan\\ExplicitLayers", - "HKEY_CURRENT_USER\\Software\\Khronos\\Vulkan\\ImplicitLayers", - "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Class\\...\\VulkanExplicitLayers", - "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Class\\...\\VulkanImplicitLayers"}; + static const char *REGISTRY_PATHS[] = { + "HKEY_LOCAL_MACHINE\\Software\\Khronos\\Vulkan\\ImplicitLayers", + "HKEY_CURRENT_USER\\Software\\Khronos\\Vulkan\\ImplicitLayers", + "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Class\\...\\VulkanImplicitLayers"}; + + for (std::size_t i = 0, n = std::size(REGISTRY_PATHS); i < n; ++i) { + const std::vector ®istry_paths = LoadRegistryLayers(REGISTRY_PATHS[i]); + result.insert(result.begin(), registry_paths.begin(), registry_paths.end()); + } #else -static const char *SEARCH_PATHS[] = { - "/usr/local/etc/vulkan/explicit_layer.d", // Not used on macOS, okay to just ignore - "/usr/local/etc/vulkan/implicit_layer.d", // Not used on macOS, okay to just ignore - "/usr/local/share/vulkan/explicit_layer.d", - "/usr/local/share/vulkan/implicit_layer.d", - "/etc/vulkan/explicit_layer.d", - "/etc/vulkan/implicit_layer.d", - "/usr/share/vulkan/explicit_layer.d", - "/usr/share/vulkan/implicit_layer.d", - ".local/share/vulkan/explicit_layer.d", - ".local/share/vulkan/implicit_layer.d", + static const char *LAYERS_PATHS[] = { + "/usr/local/etc/vulkan/implicit_layer.d", // Not used on macOS, okay to just ignore + "/usr/local/share/vulkan/implicit_layer.d", + "/etc/vulkan/implicit_layer.d", + "/usr/share/vulkan/implicit_layer.d", + ".local/share/vulkan/implicit_layer.d", #ifdef INSTALL_FULL_DATAROOTDIR - INSTALL_FULL_DATAROOTDIR "/vulkan/explicit_layer.d", - INSTALL_FULL_DATAROOTDIR "/vulkan/implicit_layer.d", + INSTALL_FULL_DATAROOTDIR "/vulkan/implicit_layer.d", #endif #ifdef INSTALL_FULL_SYSCONFDIR - INSTALL_FULL_SYSCONFDIR "/vulkan/explicit_layer.d", - INSTALL_FULL_SYSCONFDIR "/vulkan/implicit_layer.d", + INSTALL_FULL_SYSCONFDIR "/vulkan/implicit_layer.d", #endif -}; -#endif - -LayerManager::LayerManager(const Environment &environment) : environment(environment) { this->selected_layers.reserve(10); } + }; -void LayerManager::Clear() { this->selected_layers.clear(); } + for (std::size_t i = 0, n = std::size(LAYERS_PATHS); i < n; ++i) { + result.push_back(LAYERS_PATHS[i]); + } +#endif -bool LayerManager::Empty() const { return this->selected_layers.empty(); } + return result; +} -std::vector LayerManager::BuildPathList() const { - std::vector list; +std::vector GetExplicitLayerPaths() { + std::vector result; - // FIRST: If VK_LAYER_PATH is set it has precedence over other layers. - { - const std::vector &paths = environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_SET); - for (std::size_t i = 0, n = paths.size(); i < n; ++i) { - list.push_back(paths[i]); - } - } +#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS + static const char *REGISTRY_PATHS[] = { + "HKEY_LOCAL_MACHINE\\Software\\Khronos\\Vulkan\\ExplicitLayers", + "HKEY_CURRENT_USER\\Software\\Khronos\\Vulkan\\ExplicitLayers", + "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Class\\...\\VulkanExplicitLayers"}; - // SECOND: Any per layers configuration user-defined path from Vulkan Configurator? Search for those too - { - const std::vector &paths = environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_GUI); - for (std::size_t i = 0, n = paths.size(); i < n; ++i) { - list.push_back(paths[i]); - } + for (std::size_t i = 0, n = std::size(REGISTRY_PATHS); i < n; ++i) { + const std::vector ®istry_paths = LoadRegistryLayers(REGISTRY_PATHS[i]); + result.insert(result.begin(), registry_paths.begin(), registry_paths.end()); } +#else + static const char *LAYERS_PATHS[] = { + "/usr/local/etc/vulkan/explicit_layer.d", // Not used on macOS, okay to just ignore + "/usr/local/share/vulkan/explicit_layer.d", + "/etc/vulkan/explicit_layer.d", + "/usr/share/vulkan/explicit_layer.d", + ".local/share/vulkan/explicit_layer.d", +#ifdef INSTALL_FULL_DATAROOTDIR + INSTALL_FULL_DATAROOTDIR "/vulkan/explicit_layer.d", +#endif +#ifdef INSTALL_FULL_SYSCONFDIR + INSTALL_FULL_SYSCONFDIR "/vulkan/explicit_layer.d", +#endif + }; - // THIRD: Add VK_ADD_LAYER_PATH layers - { - const std::vector &paths = environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_ADD); - for (std::size_t i = 0, n = paths.size(); i < n; ++i) { - list.push_back(paths[i]); - } + for (std::size_t i = 0, n = std::size(LAYERS_PATHS); i < n; ++i) { + result.push_back(LAYERS_PATHS[i]); } +#endif - // FOURTH: Standard layer paths, in standard locations. The above has always taken precedence - { - for (std::size_t i = 0, n = countof(SEARCH_PATHS); i < n; i++) { - list.push_back(SEARCH_PATHS[i]); - } - } + return result; +} - // FIFTH: Standard layer paths, in standard locations. The above has always taken precedence - if (!qgetenv("VULKAN_SDK").isEmpty()) { - list.push_back(GetPath(BUILTIN_PATH_EXPLICIT_LAYERS)); - } +LayerManager::LayerManager(const std::vector &user_defined_paths) { + this->paths[LAYERS_PATHS_IMPLICIT] = GetImplicitLayerPaths(); - return list; -} + this->paths[LAYERS_PATHS_EXPLICIT] = GetExplicitLayerPaths(); -// Find all installed layers on the system. -void LayerManager::LoadAllInstalledLayers() { - this->selected_layers.clear(); + const char *SEPARATOR = GetToken(PARSE_ENV_VAR); - // FIRST: If VK_LAYER_PATH is set it has precedence over other layers. - const std::vector &env_user_defined_layers_paths_set = - environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_SET); - for (std::size_t i = 0, n = env_user_defined_layers_paths_set.size(); i < n; ++i) { - LoadLayersFromPath(env_user_defined_layers_paths_set[i]); + const std::vector &VK_LAYER_PATH = Split(qgetenv("VK_LAYER_PATH").toStdString(), SEPARATOR); + for (std::size_t i = 0, n = VK_LAYER_PATH.size(); i < n; ++i) { + this->paths[LAYERS_PATHS_ENV_SET].push_back(Path(VK_LAYER_PATH[i])); } - // SECOND: Any per layers configuration user-defined path from Vulkan Configurator? Search for those too - const std::vector &gui_config_user_defined_layers_paths = - environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_GUI); - for (std::size_t i = 0, n = gui_config_user_defined_layers_paths.size(); i < n; ++i) { - LoadLayersFromPath(gui_config_user_defined_layers_paths[i]); + const std::vector &VK_ADD_LAYER_PATH = Split(qgetenv("VK_ADD_LAYER_PATH").toStdString(), SEPARATOR); + for (std::size_t i = 0, n = VK_LAYER_PATH.size(); i < n; ++i) { + this->paths[LAYERS_PATHS_ENV_SET].push_back(Path(VK_ADD_LAYER_PATH[i])); } - // THIRD: Add VK_ADD_LAYER_PATH layers - const std::vector &env_user_defined_layers_paths_add = - environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_ADD); - for (std::size_t i = 0, n = env_user_defined_layers_paths_add.size(); i < n; ++i) { - LoadLayersFromPath(env_user_defined_layers_paths_add[i]); - } + this->paths[LAYERS_PATHS_GUI].insert(this->paths[LAYERS_PATHS_GUI].begin(), user_defined_paths.begin(), + user_defined_paths.end()); - // FOURTH: Standard layer paths, in standard locations. The above has always taken precedence - for (std::size_t i = 0, n = countof(SEARCH_PATHS); i < n; i++) { - LoadLayersFromPath(SEARCH_PATHS[i]); - } + this->paths[LAYERS_PATHS_SDK].push_back(::Get(Path::SDK)); - // FIFTH: See if thee is anyting in the VULKAN_SDK path that wasn't already found elsewhere - if (!qgetenv("VULKAN_SDK").isEmpty()) { - LoadLayersFromPath(GetPath(BUILTIN_PATH_EXPLICIT_LAYERS)); - } + this->LoadAllInstalledLayers(); } -// Load a single layer -void LayerManager::LoadLayer(const std::string &layer_name) { - this->selected_layers.clear(); - - // FIRST: If VK_LAYER_PATH is set it has precedence over other layers. - const std::vector &env_user_defined_layers_paths_set = - environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_SET); - for (std::size_t i = 0, n = env_user_defined_layers_paths_set.size(); i < n; ++i) { - if (LoadLayerFromPath(layer_name, env_user_defined_layers_paths_set[i])) return; - } +void LayerManager::Clear() { this->selected_layers.clear(); } - // SECOND: Any per layers configuration user-defined path from Vulkan Configurator? Search for those too - const std::vector &gui_config_user_defined_layers_paths = - environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_GUI); - for (std::size_t i = 0, n = gui_config_user_defined_layers_paths.size(); i < n; ++i) { - if (LoadLayerFromPath(layer_name, gui_config_user_defined_layers_paths[i])) return; - } +bool LayerManager::Empty() const { return this->selected_layers.empty(); } - // THIRD: Add VK_ADD_LAYER_PATH layers - const std::vector &env_user_defined_layers_paths_add = - environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_ADD); - for (std::size_t i = 0, n = env_user_defined_layers_paths_add.size(); i < n; ++i) { - if (LoadLayerFromPath(layer_name, env_user_defined_layers_paths_add[i])) return; - } +std::size_t LayerManager::Size() const { return this->selected_layers.size(); } - // FOURTH: Standard layer paths, in standard locations. The above has always taken precedence - for (std::size_t i = 0, n = countof(SEARCH_PATHS); i < n; i++) { - if (LoadLayerFromPath(layer_name, SEARCH_PATHS[i])) return; - } +Layer *LayerManager::Find(const std::string &layer_name) { + assert(!layer_name.empty()); - // FIFTH: See if thee is anyting in the VULKAN_SDK path that wasn't already found elsewhere - if (!qgetenv("VULKAN_SDK").isEmpty()) { - if (LoadLayerFromPath(layer_name, GetPath(BUILTIN_PATH_EXPLICIT_LAYERS))) return; - } + return FindByKey(this->selected_layers, layer_name.c_str()); } -/// Search a folder and load up all the layers found there. This does NOT -/// load the default settings for each layer. This is just a master list of -/// layers found. Do NOT load duplicate layer names. The type of layer (explicit or implicit) is -/// determined from the path name. -void LayerManager::LoadLayersFromPath(const std::string &path) { - // On Windows custom files are in the file system. On non Windows all layers are - // searched this way - LayerType type = LAYER_TYPE_USER_DEFINED; - if (QString(path.c_str()).contains("explicit", Qt::CaseInsensitive)) type = LAYER_TYPE_EXPLICIT; - if (QString(path.c_str()).contains("implicit", Qt::CaseInsensitive)) type = LAYER_TYPE_IMPLICIT; - - PathFinder file_list; - - if (VKC_PLATFORM == VKC_PLATFORM_WINDOWS) { - if (QString(path.c_str()).contains("...")) { -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS - LoadRegistryLayers(path.c_str(), this->selected_layers, type); -#endif - return; - } +const Layer *LayerManager::Find(const std::string &layer_name) const { + assert(!layer_name.empty()); - file_list = PathFinder(path, (type == LAYER_TYPE_USER_DEFINED)); - } else if (VKC_PLATFORM == VKC_PLATFORM_LINUX || VKC_PLATFORM == VKC_PLATFORM_MACOS) { - // On Linux/Mac, we also need the home folder - std::string search_path = path; - if (path[0] == '.') { - search_path = QDir().homePath().toStdString() + "/" + path; - } + return FindByKey(this->selected_layers, layer_name.c_str()); +} - file_list = PathFinder(search_path, true); - } else { - assert(0); // Platform unknown - } +// Find all installed layers on the system. +void LayerManager::LoadAllInstalledLayers() { + this->selected_layers.clear(); - for (int i = 0, n = file_list.FileCount(); i < n; ++i) { - Layer layer; - if (layer.Load(this->selected_layers, file_list.GetFileName(i).c_str(), type)) { - // Make sure this layer name has not already been added - if (FindByKey(this->selected_layers, layer.key.c_str()) != nullptr) continue; + for (std::size_t group_index = 0, group_count = LAYERS_PATHS_COUNT; group_index < group_count; ++group_index) { + const LayerType layer_type = ::GetLayerType(static_cast(group_index)); - // Good to go, add the layer - this->selected_layers.push_back(layer); + const std::vector &paths_group = this->paths[group_index]; + for (std::size_t i = 0, n = paths_group.size(); i < n; ++i) { + this->LoadLayersFromPath(paths_group[i], layer_type); } } } -// Attempt to load the named layer from the given path -bool LayerManager::LoadLayerFromPath(const std::string &layer_name, const std::string &path) { - LayerType type = LAYER_TYPE_USER_DEFINED; - if (QString(path.c_str()).contains("explicit", Qt::CaseInsensitive)) type = LAYER_TYPE_EXPLICIT; - if (QString(path.c_str()).contains("implicit", Qt::CaseInsensitive)) type = LAYER_TYPE_IMPLICIT; +void LayerManager::LoadLayersFromPath(const Path &layers_path, LayerType type) { + const std::vector &layers_paths = layers_path.IsDir() ? CollectFilePaths(layers_path) : GetVector(layers_path); - PathFinder file_list; + for (std::size_t i = 0, n = layers_paths.size(); i < n; ++i) { + Layer layer; + if (layer.Load(layers_paths[i], type)) { + if (this->IsAvailable(layer)) { + continue; + } - if (VKC_PLATFORM == VKC_PLATFORM_LINUX || VKC_PLATFORM == VKC_PLATFORM_MACOS) { - // On Linux/Mac, we also need the home folder - std::string search_path = path; - if (path[0] == '.') { - search_path = QDir().homePath().toStdString() + "/" + path; + this->selected_layers.push_back(layer); } - file_list = PathFinder(search_path, true); - } else { - file_list = PathFinder(path, true); } +} - for (int i = 0, n = file_list.FileCount(); i < n; ++i) { - Layer layer; - if (layer.Load(this->selected_layers, file_list.GetFileName(i).c_str(), type)) { - // Add this layer if the layer name matches, then return - if (layer_name == layer.key) { - this->selected_layers.push_back(layer); - return true; - } +bool LayerManager::IsAvailable(const Layer &layer) const { + for (std::size_t i = 0, n = this->selected_layers.size(); i < n; ++i) { + if (this->selected_layers[i].key == layer.key && this->selected_layers[i].api_version == layer.api_version) { + return true; } } + return false; } diff --git a/vkconfig_core/layer_manager.h b/vkconfig_core/layer_manager.h index 572a29c32a..339a286a65 100644 --- a/vkconfig_core/layer_manager.h +++ b/vkconfig_core/layer_manager.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022 Valve Corporation - * Copyright (c) 2020-2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,31 +21,46 @@ #pragma once #include "layer.h" -#include "environment.h" - -#include +#include "path.h" #include #include #include +enum LayersPaths { + LAYERS_PATHS_IMPLICIT = 0, + LAYERS_PATHS_EXPLICIT, + LAYERS_PATHS_ENV_SET, // From $VK_LAYER_PATH + LAYERS_PATHS_ENV_ADD, // from $VK_ADD_LAYER_PATH + LAYERS_PATHS_GUI, + LAYERS_PATHS_SDK, + + LAYERS_PATHS_FIRST = LAYERS_PATHS_IMPLICIT, + LAYERS_PATHS_LAST = LAYERS_PATHS_SDK, +}; + +enum { LAYERS_PATHS_COUNT = LAYERS_PATHS_LAST - LAYERS_PATHS_FIRST + 1 }; + +LayerType GetLayerType(LayersPaths Layers_paths_type); + class LayerManager { public: - LayerManager(const Environment& environment); + LayerManager(const std::vector& user_defined_paths = std::vector()); void Clear(); bool Empty() const; + std::size_t Size() const; - void LoadAllInstalledLayers(); - void LoadLayer(const std::string& layer_name); - void LoadLayersFromPath(const std::string& path); + Layer* Find(const std::string& layer_name); + const Layer* Find(const std::string& layer_name) const; - std::vector BuildPathList() const; + void LoadAllInstalledLayers(); + void LoadLayersFromPath(const Path& layers_path, LayerType type = LAYER_TYPE_EXPLICIT); std::vector selected_layers; - const Environment& environment; - private: - bool LoadLayerFromPath(const std::string& layer_name, const std::string& path); + bool IsAvailable(const Layer& layer) const; + + std::array, LAYERS_PATHS_COUNT> paths; }; diff --git a/vkconfig_core/layer_state.cpp b/vkconfig_core/layer_state.cpp deleted file mode 100644 index 403ff2e301..0000000000 --- a/vkconfig_core/layer_state.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "layer_state.h" - -#include "util.h" - -#include -#include - -const char* GetToken(LayerState state) { - static const char* table[] = { - "APPLICATION_CONTROLLED", // LAYER_STATE_APPLICATION_CONTROLLED - "OVERRIDDEN", // LAYER_STATE_OVERRIDDEN - "EXCLUDED" // LAYER_STATE_EXCLUDED - }; - static_assert(countof(table) == LAYER_STATE_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - return table[state]; -} - -LayerState GetLayerState(const char* token) { - for (std::size_t i = 0, n = LAYER_STATE_COUNT; i < n; ++i) { - const LayerState layer_state = static_cast(i); - if (std::strcmp(GetToken(layer_state), token) == 0) return layer_state; - } - - assert(0); - return static_cast(-1); -} diff --git a/vkconfig_core/layer_state.h b/vkconfig_core/layer_state.h deleted file mode 100644 index 7913faa909..0000000000 --- a/vkconfig_core/layer_state.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -enum LayerState { - LAYER_STATE_APPLICATION_CONTROLLED = 0, // The Vulkan application configured this layer at will - LAYER_STATE_OVERRIDDEN = 1, // Force on/override this layer and configure it regarless of the Vulkan application - LAYER_STATE_EXCLUDED = 2, // Force off/exclude this layer regarless of the Vulkan application - - LAYER_STATE_FIRST = LAYER_STATE_APPLICATION_CONTROLLED, - LAYER_STATE_LAST = LAYER_STATE_EXCLUDED -}; - -enum { LAYER_STATE_COUNT = LAYER_STATE_LAST - LAYER_STATE_FIRST + 1 }; - -const char* GetToken(LayerState state); -LayerState GetLayerState(const char* token); diff --git a/vkconfig_core/layer_type.cpp b/vkconfig_core/layer_type.cpp deleted file mode 100644 index 342e9f4567..0000000000 --- a/vkconfig_core/layer_type.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Richard S. Wright Jr. - * - Christophe Riccio - */ - -#include "layer_type.h" - -#include "util.h" - -#include - -const char* GetLayerTypeLabel(LayerType type) { - assert(type >= LAYER_TYPE_FIRST && type <= LAYER_TYPE_LAST); - - static const char* table[] = { - "Explicit", // LAYER_TYPE_EXPLICIT - "Implicit", // LAYER_TYPE_IMPLICIT - "User-Defined" // LAYER_TYPE_USER_DEFINED - }; - static_assert(countof(table) == LAYER_TYPE_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - return table[type]; -} diff --git a/vkconfig_core/layers/130/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/130/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index ea1a9eff2c..0000000000 --- a/vkconfig_core/layers/130/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,328 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.1.130", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", - "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "status": "BETA", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Activating this feature instruments shader programs to generate additional diagnostic data.", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve a descriptorSet binding slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - } - ], - "default": [] - } - ] - } - } -} diff --git a/vkconfig_core/layers/130/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/layers/130/VK_LAYER_LUNARG_api_dump.json deleted file mode 100644 index 0762910f38..0000000000 --- a/vkconfig_core/layers/130/VK_LAYER_LUNARG_api_dump.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_api_dump", - "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.1.130", - "implementation_version": "2", - "description": "LunarG API dump layer", - "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "presets": [ - { - "label": "Console Output", - "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "stdout" - }, - { - "key": "file", - "value": false - } - ] - }, - { - "label": "Text Output", - "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.txt" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "HTML Output", - "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "html" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.html" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "JSON Output", - "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "json" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.json" - }, - { - "key": "file", - "value": true - } - ] - } - ], - "settings": [ - { - "key": "output_range", - "env": "VK_APIDUMP_OUTPUT_RANGE", - "label": "Output Range", - "description": "Comma separated list of frames to output or a range of frames with a start, count, and optional interval separated by a dash. A count of 0 will output every frame after the start of the range. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "0-0" - }, - { - "key": "output_format", - "env": "VK_APIDUMP_OUTPUT_FORMAT", - "label": "Output Format", - "description": "Specifies the format used for output; can be HTML, JSON, or Text (default -- outputs plain text)", - "type": "ENUM", - "flags": [ - { - "key": "text", - "label": "Text", - "description": "Plain text" - }, - { - "key": "html", - "label": "HTML", - "description": "HTML" - }, - { - "key": "json", - "label": "JSON", - "description": "Json" - } - ], - "default": "text" - }, - { - "key": "file", - "label": "Output to File", - "description": "Setting this to true indicates that output should be written to file instead of stdout", - "type": "BOOL", - "default": false, - "settings": [ - { - "key": "log_filename", - "env": "VK_APIDUMP_LOG_FILENAME", - "label": "Log Filename", - "description": "Specifies the file to dump to when output files are enabled", - "type": "SAVE_FILE", - "filter": "*.txt,*.html,*.json", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "file", - "value": true - } - ] - } - } - ] - }, - { - "key": "flush", - "env": "VK_APIDUMP_FLUSH", - "label": "Log Flush After Write", - "description": "Setting this to true causes IO to be flushed after each API call that is written", - "type": "BOOL", - "default": true - }, - { - "key": "name_size", - "label": "Name Size", - "description": "The number of characters the name of a variable should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 1 - }, - "unit": "chars" - }, - { - "key": "show_types", - "label": "Show Types", - "description": "Dump types in addition to values", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "type_size", - "label": "Type Size", - "description": "The number of characters the name of a type should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 0 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "show_types", - "value": true - } - ] - } - } - ] - }, - { - "key": "show_timestamp", - "env": "VK_APIDUMP_TIMESTAMP", - "label": "Show Timestamp", - "description": "Show the timestamp of function calls since start in microseconds", - "type": "BOOL", - "default": false - }, - { - "key": "show_shader", - "label": "Show Shader", - "description": "Dump the shader binary code in pCode", - "type": "BOOL", - "default": false - }, - { - "key": "detailed", - "env": "VK_APIDUMP_DETAILED", - "label": "Show Parameter Details", - "description": "Dump parameter details in addition to API calls", - "type": "BOOL", - "default": true - }, - { - "key": "no_addr", - "env": "VK_APIDUMP_NO_ADDR", - "label": "Hide Addresses", - "description": "Dump \"address\" in place of hex addresses", - "type": "BOOL", - "default": false - }, - { - "key": "use_spaces", - "label": "Use Spaces", - "description": "Setting this to true causes all tab characters to be replaced with spaces", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "indent_size", - "label": "Indent Size", - "description": "Specifies the number of spaces that a tab is equal to", - "type": "INT", - "default": 4, - "range": { - "min": 1, - "max": 16 - }, - "unit": "chars", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "use_spaces", - "value": true - } - ] - } - } - ] - } - ] - } - } -} - diff --git a/vkconfig_core/layers/130/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/layers/130/VK_LAYER_LUNARG_monitor.json deleted file mode 100644 index 53021b0e20..0000000000 --- a/vkconfig_core/layers/130/VK_LAYER_LUNARG_monitor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "file_format_version": "1.0.0", - "layer": { - "name": "VK_LAYER_LUNARG_monitor", - "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.1.130", - "implementation_version": "1", - "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ] - } -} diff --git a/vkconfig_core/layers/130/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/layers/130/VK_LAYER_LUNARG_screenshot.json deleted file mode 100644 index f51617c810..0000000000 --- a/vkconfig_core/layers/130/VK_LAYER_LUNARG_screenshot.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_screenshot", - "type": "GLOBAL", - "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.1.130", - "implementation_version": "1", - "description": "LunarG image capture layer", - "introduction": "The screenshot layer records frames to image files.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "settings": [ - { - "key": "frames", - "env": "VK_SCREENSHOT_FRAMES", - "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "" - }, - { - "key": "dir", - "env": "VK_SCREENSHOT_DIR", - "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", - "type": "SAVE_FOLDER", - "default": "" - }, - { - "key": "format", - "env": "VK_SCREENSHOT_FORMAT", - "label": "Format", - "description": "This can be set to a color space for the output.", - "type": "ENUM", - "flags": [ - { - "key": "UNORM", - "label": "UNORM", - "description": "" - }, - { - "key": "SNORM", - "label": "SNORM", - "description": "" - }, - { - "key": "USCALED", - "label": "USCALED", - "description": "" - }, - { - "key": "SSCALED", - "label": "SSCALED", - "description": "" - }, - { - "key": "UINT", - "label": "UINT", - "description": "" - }, - { - "key": "SINT", - "label": "SINT", - "description": "" - }, - { - "key": "SRGB", - "label": "SRGB", - "description": "" - }, - { - "key": "USE_SWAPCHAIN_COLORSPACE", - "label": "USE_SWAPCHAIN_COLORSPACE", - "description": "" - } - ], - "default": "USE_SWAPCHAIN_COLORSPACE" - } - ] - } - } -} diff --git a/vkconfig_core/layers/135/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/135/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index 8184fc52a2..0000000000 --- a/vkconfig_core/layers/135/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,329 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.2.135", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "editor_state": "01110111111111111111111001111111111110", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", - "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "status": "BETA", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Activating this feature instruments shader programs to generate additional diagnostic data.", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve a descriptorSet binding slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - } - ], - "default": [] - } - ] - } - } -} diff --git a/vkconfig_core/layers/135/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/layers/135/VK_LAYER_LUNARG_api_dump.json deleted file mode 100644 index f25e549148..0000000000 --- a/vkconfig_core/layers/135/VK_LAYER_LUNARG_api_dump.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_api_dump", - "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.2.135", - "implementation_version": "2", - "description": "LunarG API dump layer", - "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "presets": [ - { - "label": "Console Output", - "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "stdout" - }, - { - "key": "file", - "value": false - } - ] - }, - { - "label": "Text Output", - "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.txt" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "HTML Output", - "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "html" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.html" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "JSON Output", - "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "json" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.json" - }, - { - "key": "file", - "value": true - } - ] - } - ], - "settings": [ - { - "key": "output_range", - "env": "VK_APIDUMP_OUTPUT_RANGE", - "label": "Output Range", - "description": "Comma separated list of frames to output or a range of frames with a start, count, and optional interval separated by a dash. A count of 0 will output every frame after the start of the range. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "0-0" - }, - { - "key": "output_format", - "env": "VK_APIDUMP_OUTPUT_FORMAT", - "label": "Output Format", - "description": "Specifies the format used for output; can be HTML, JSON, or Text (default -- outputs plain text)", - "type": "ENUM", - "flags": [ - { - "key": "text", - "label": "Text", - "description": "Plain text" - }, - { - "key": "html", - "label": "HTML", - "description": "HTML" - }, - { - "key": "json", - "label": "JSON", - "description": "Json" - } - ], - "default": "text" - }, - { - "key": "file", - "label": "Output to File", - "description": "Setting this to true indicates that output should be written to file instead of stdout", - "type": "BOOL", - "default": false, - "settings": [ - { - "key": "log_filename", - "env": "VK_APIDUMP_LOG_FILENAME", - "label": "Log Filename", - "description": "Specifies the file to dump to when output files are enabled", - "type": "SAVE_FILE", - "filter": "*.txt,*.html,*.json", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "file", - "value": true - } - ] - } - } - ] - }, - { - "key": "flush", - "env": "VK_APIDUMP_FLUSH", - "label": "Log Flush After Write", - "description": "Setting this to true causes IO to be flushed after each API call that is written", - "type": "BOOL", - "default": true - }, - { - "key": "name_size", - "label": "Name Size", - "description": "The number of characters the name of a variable should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 1 - }, - "unit": "chars" - }, - { - "key": "show_types", - "label": "Show Types", - "description": "Dump types in addition to values", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "type_size", - "label": "Type Size", - "description": "The number of characters the name of a type should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 0 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "show_types", - "value": true - } - ] - } - } - ] - }, - { - "key": "show_timestamp", - "env": "VK_APIDUMP_TIMESTAMP", - "label": "Show Timestamp", - "description": "Show the timestamp of function calls since start in microseconds", - "type": "BOOL", - "default": false - }, - { - "key": "show_shader", - "label": "Show Shader", - "description": "Dump the shader binary code in pCode", - "type": "BOOL", - "default": false - }, - { - "key": "detailed", - "env": "VK_APIDUMP_DETAILED", - "label": "Show Parameter Details", - "description": "Dump parameter details in addition to API calls", - "type": "BOOL", - "default": true - }, - { - "key": "no_addr", - "env": "VK_APIDUMP_NO_ADDR", - "label": "Hide Addresses", - "description": "Dump \"address\" in place of hex addresses", - "type": "BOOL", - "default": false - }, - { - "key": "use_spaces", - "label": "Use Spaces", - "description": "Setting this to true causes all tab characters to be replaced with spaces", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "indent_size", - "label": "Indent Size", - "description": "Specifies the number of spaces that a tab is equal to", - "type": "INT", - "default": 4, - "range": { - "min": 1, - "max": 16 - }, - "unit": "chars", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "use_spaces", - "value": true - } - ] - } - } - ] - } - ] - } - - } -} diff --git a/vkconfig_core/layers/135/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/layers/135/VK_LAYER_LUNARG_monitor.json deleted file mode 100644 index 8461bbbed6..0000000000 --- a/vkconfig_core/layers/135/VK_LAYER_LUNARG_monitor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "file_format_version": "1.0.0", - "layer": { - "name": "VK_LAYER_LUNARG_monitor", - "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.2.135", - "implementation_version": "1", - "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ] - } -} diff --git a/vkconfig_core/layers/141/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/141/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index 77afb7965c..0000000000 --- a/vkconfig_core/layers/141/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,358 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.2.148", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", - "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Shader Printf", - "description": "Debug shader code by \"printing\" any values of interest to the debug callback or stdout.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT", - "label": "Debug Printf", - "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback", - "url": "${LUNARG_SDK}/debug_printf.html", - "status": "STABLE", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Activating this feature instruments shader programs to generate additional diagnostic data.", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve a descriptorSet binding slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - } - ], - "default": [] - } - ] - } - } -} diff --git a/vkconfig_core/layers/141/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/layers/141/VK_LAYER_LUNARG_api_dump.json deleted file mode 100644 index 4a011ea5a4..0000000000 --- a/vkconfig_core/layers/141/VK_LAYER_LUNARG_api_dump.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_api_dump", - "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.2.141", - "implementation_version": "2", - "description": "LunarG API dump layer", - "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "presets": [ - { - "label": "Console Output", - "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "stdout" - }, - { - "key": "file", - "value": false - } - ] - }, - { - "label": "Text Output", - "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.txt" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "HTML Output", - "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "html" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.html" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "JSON Output", - "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "json" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.json" - }, - { - "key": "file", - "value": true - } - ] - } - ], - "settings": [ - { - "key": "output_range", - "env": "VK_APIDUMP_OUTPUT_RANGE", - "label": "Output Range", - "description": "Comma separated list of frames to output or a range of frames with a start, count, and optional interval separated by a dash. A count of 0 will output every frame after the start of the range. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "0-0" - }, - { - "key": "output_format", - "env": "VK_APIDUMP_OUTPUT_FORMAT", - "label": "Output Format", - "description": "Specifies the format used for output; can be HTML, JSON, or Text (default -- outputs plain text)", - "type": "ENUM", - "flags": [ - { - "key": "text", - "label": "Text", - "description": "Plain text" - }, - { - "key": "html", - "label": "HTML", - "description": "HTML" - }, - { - "key": "json", - "label": "JSON", - "description": "Json" - } - ], - "default": "text" - }, - { - "key": "file", - "label": "Output to File", - "description": "Setting this to true indicates that output should be written to file instead of stdout", - "type": "BOOL", - "default": false, - "settings": [ - { - "key": "log_filename", - "env": "VK_APIDUMP_LOG_FILENAME", - "label": "Log Filename", - "description": "Specifies the file to dump to when output files are enabled", - "type": "SAVE_FILE", - "filter": "*.txt,*.html,*.json", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "file", - "value": true - } - ] - } - } - ] - }, - { - "key": "flush", - "env": "VK_APIDUMP_FLUSH", - "label": "Log Flush After Write", - "description": "Setting this to true causes IO to be flushed after each API call that is written", - "type": "BOOL", - "default": true - }, - { - "key": "name_size", - "label": "Name Size", - "description": "The number of characters the name of a variable should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 1 - }, - "unit": "chars" - }, - { - "key": "show_types", - "label": "Show Types", - "description": "Dump types in addition to values", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "type_size", - "label": "Type Size", - "description": "The number of characters the name of a type should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 0 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "show_types", - "value": true - } - ] - } - } - ] - }, - { - "key": "show_timestamp", - "env": "VK_APIDUMP_TIMESTAMP", - "label": "Show Timestamp", - "description": "Show the timestamp of function calls since start in microseconds", - "type": "BOOL", - "default": false - }, - { - "key": "show_shader", - "label": "Show Shader", - "description": "Dump the shader binary code in pCode", - "type": "BOOL", - "default": false - }, - { - "key": "detailed", - "env": "VK_APIDUMP_DETAILED", - "label": "Show Parameter Details", - "description": "Dump parameter details in addition to API calls", - "type": "BOOL", - "default": true - }, - { - "key": "no_addr", - "env": "VK_APIDUMP_NO_ADDR", - "label": "Hide Addresses", - "description": "Dump \"address\" in place of hex addresses", - "type": "BOOL", - "default": false - }, - { - "key": "use_spaces", - "label": "Use Spaces", - "description": "Setting this to true causes all tab characters to be replaced with spaces", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "indent_size", - "label": "Indent Size", - "description": "Specifies the number of spaces that a tab is equal to", - "type": "INT", - "default": 4, - "range": { - "min": 1, - "max": 16 - }, - "unit": "chars", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "use_spaces", - "value": true - } - ] - } - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/141/VK_LAYER_LUNARG_gfxreconstruct.json b/vkconfig_core/layers/141/VK_LAYER_LUNARG_gfxreconstruct.json deleted file mode 100644 index 660fc71589..0000000000 --- a/vkconfig_core/layers/141/VK_LAYER_LUNARG_gfxreconstruct.json +++ /dev/null @@ -1,409 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_gfxreconstruct", - "type": "GLOBAL", - "library_path": ".\\VkLayer_gfxreconstruct.dll", - "api_version": "1.2.141", - "status": "BETA", - "implementation_version": "36865", - "description": "GFXReconstruct Capture Layer Version 0.9.1", - "introduction": "The GFXReconstruct Capture Layer intercepts Vulkan API calls and logs them to a capture file. Other tools in the GFXReconstruct suite can inspect, modify, or replay capture files generated by this component.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/capture_tools.html", - "platforms": [ "WINDOWS", "LINUX", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Initialization", - "description": "Capture the first two frames.", - "settings": [ - { - "key": "capture_trigger", - "value": "" - }, - { - "key": "capture_frames", - "value": "1-2" - }, - { - "key": "memory_tracking_mode", - "value": "unassisted" - } - ] - }, - { - "label": "Range", - "description": "Capture a range of frames between presses of the F5 key.", - "settings": [ - { - "key": "capture_trigger", - "value": "F5" - }, - { - "key": "capture_frames", - "value": "" - }, - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - ], - "settings": [ - { - "key": "capture_trigger", - "env": "GFXRECON_CAPTURE_TRIGGER", - "label": "Hotkey Capture Trigger", - "description": "Specify a hotkey (any one of F1-F12, TAB, CONTROL) that will be used to start/stop capture. Example: F3 will set the capture trigger to F3 hotkey. One capture file will be generated for each pair of start/stop hotkey presses. Default is: Empty string (hotkey capture trigger is disabled).", - "type": "ENUM", - "flags": [ - { - "key": "", - "label": "None", - "description": "" - }, - { - "key": "F1", - "label": "F1", - "description": "" - }, - { - "key": "F2", - "label": "F2", - "description": "" - }, - { - "key": "F3", - "label": "F3", - "description": "" - }, - { - "key": "F4", - "label": "F4", - "description": "" - }, - { - "key": "F5", - "label": "F5", - "description": "" - }, - { - "key": "F6", - "label": "F6", - "description": "" - }, - { - "key": "F7", - "label": "F7", - "description": "" - }, - { - "key": "F8", - "label": "F8", - "description": "" - }, - { - "key": "F9", - "label": "F9", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F11", - "label": "F11", - "description": "" - }, - { - "key": "F12", - "label": "F12", - "description": "" - }, - { - "key": "TAB", - "label": "TAB", - "description": "" - }, - { - "key": "CONTROL", - "label": "CONTROL", - "description": "" - } - ], - "default": "" - }, - { - "key": "capture_frames", - "env": "GFXRECON_CAPTURE_FRAMES", - "label": "Capture Specific Frames", - "description": "Specify one or more comma-separated frame ranges to capture. Each range will be written to its own file. A frame range can be specified as a single value, to specify a single frame to capture, or as two hyphenated values, to specify the first and last frame to capture. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: 200,301-305 will create two capture files, one containing a single frame and one containing five frames. Default is: Empty string (all frames are captured).", - "type": "STRING", - "default": "" - }, - { - "key": "capture_file", - "env": "GFXRECON_CAPTURE_FILE", - "label": "Capture File Name", - "description": "Path to use when creating the capture file. Default is: gfxrecon_capture.gfxr", - "type": "SAVE_FILE", - "filter": "*.gfxr", - "default": "${VK_LOCAL}/gfxrecon_capture.gfxr", - "settings": [ - { - "key": "capture_file_timestamp", - "env": "GFXRECON_CAPTURE_FILE_TIMESTAMP", - "label": "Capture File Name with Timestamp", - "description": "Add a timestamp (yyyymmddThhmmss) postfix to the capture file name.", - "type": "BOOL", - "default": true - }, - { - "key": "capture_file_flush", - "env": "GFXRECON_CAPTURE_FILE_FLUSH", - "label": "Capture File Flush After Write", - "description": "Flush output stream after each packet is written to the capture file. Default is: false.", - "type": "BOOL", - "default": true - } - ] - }, - { - "key": "capture_compression_type", - "env": "GFXRECON_CAPTURE_COMPRESSION_TYPE", - "label": "Compression Format", - "description": "Compression format to use with the capture file. Valid values are: LZ4, ZLIB, ZSTD, and NONE. Default is: LZ4", - "type": "ENUM", - "flags": [ - { - "key": "LZ4", - "label": "LZ4", - "description": "Fastest compression algorithm that favors performance over compression ratio." - }, - { - "key": "ZLIB", - "label": "ZLIB", - "description": "Widely used compression algorithm with better compression ratio than LZ4 but worse performance." - }, - { - "key": "ZSTD", - "label": "ZSTD", - "description": "Newer compression algorithm with better compression ratio and performance than ZLIB, though not as fast as LZ4." - }, - { - "key": "NONE", - "label": "NONE", - "description": "No compression" - } - ], - "default": "LZ4" - }, - { - "key": "memory_tracking_mode", - "env": "GFXRECON_MEMORY_TRACKING_MODE", - "label": "Memory Tracking Mode", - "description": "Specifies the memory tracking mode to use for detecting modifications to mapped Vulkan memory objects. Available options are: page_guard, assisted, and unassisted.", - "type": "ENUM", - "flags": [ - { - "key": "page_guard", - "label": "page_guard", - "description": "Tracks modifications to individual memory pages, which are written to the capture file on calls to vkFlushMappedMemoryRanges, vkUnmapMemory, and vkQueueSubmit. Tracking modifications requires allocating shadow memory for all mapped memory." - }, - { - "key": "assisted", - "label": "assisted", - "description": "Expects the application to call vkFlushMappedMemoryRanges after memory is modified; the memory ranges specified to the vkFlushMappedMemoryRanges call will be written to the capture file during the call." - }, - { - "key": "unassisted", - "label": "unassisted", - "description": "Writes the full content of mapped memory to the capture file on calls to vkUnmapMemory and vkQueueSubmit. It is very inefficient and may be unusable with real-world applications that map large amounts of memory." - } - ], - "default": "page_guard", - "settings": [ - { - "key": "page_guard_copy_on_map", - "env": "GFXRECON_PAGE_GUARD_COPY_ON_MAP", - "label": "Page Guard Copy on Map", - "description": "When the page_guard memory tracking mode is enabled, copies the content of the mapped memory to the shadow memory immediately after the memory is mapped.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_separate_read", - "env": "GFXRECON_PAGE_GUARD_SEPARATE_READ", - "label": "Page Guard Separate Read Tracking", - "description": "When the page_guard memory tracking mode is enabled, copies the content of pages accessed for read from mapped memory to shadow memory on each read. Can overwrite unprocessed shadow memory content when an application is reading from and writing to the same page.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_external_memory", - "env": "GFXRECON_PAGE_GUARD_EXTERNAL_MEMORY", - "label": "Page Guard External Memory", - "description": "When the page_guard memory tracking mode is enabled, use the VK_EXT_external_memory_host extension to eliminate the need for shadow memory allocations. For each memory allocation from a host visible memory type, the capture layer will create an allocation from system memory, which it can monitor for write access, and provide that allocation to vkAllocateMemory as external memory. Only available on Windows.", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - } - ] - }, - { - "key": "log", - "label": "Log", - "description": "Control log messages.", - "type": "GROUP", - "settings": [ - { - "key": "log_level", - "env": "GFXRECON_LOG_LEVEL", - "label": "Level", - "description": "Specify the highest level message to log. Options are: debug, info, warning, error, and fatal. The specified level and all levels listed after it will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.", - "type": "ENUM", - "flags": [ - { - "key": "debug", - "label": "debug, info, warning, error, fatal", - "description": "" - }, - { - "key": "info", - "label": "info, warning, error, fatal", - "description": "" - }, - { - "key": "warning", - "label": "warning, error, fatal", - "description": "" - }, - { - "key": "error", - "label": "error, fatal", - "description": "" - }, - { - "key": "fatal", - "label": "fatal", - "description": "" - } - ], - "default": "info" - }, - { - "key": "log_detailed", - "env": "GFXRECON_LOG_DETAILED", - "label": "Log Name and Line Number", - "description": "Include name and line number from the file responsible.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_console", - "env": "GFXRECON_LOG_OUTPUT_TO_CONSOLE", - "label": "Log Output to Console / stdout", - "description": "Log messages will be written to stdout.", - "type": "BOOL", - "default": true - }, - { - "key": "log_break_on_error", - "env": "GFXRECON_LOG_BREAK_ON_ERROR", - "label": "Trigger Debug Break on Error", - "description": "Trigger a debug break when logging an error.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_os_debug_string", - "env": "GFXRECON_LOG_OUTPUT_TO_OS_DEBUG_STRING", - "label": "Log Output to Debug Console", - "description": "Windows only option. Log messages will be written to the Debug Console with OutputDebugStringA", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false - }, - { - "key": "log_file", - "env": "GFXRECON_LOG_FILE", - "label": "Log File", - "description": "When set, log messages will be written to a file at the specified path. Default is: Empty string (file logging disabled).", - "type": "SAVE_FILE", - "filter": "*.txt", - "default": "", - "settings": [ - { - "key": "log_file_flush_after_write", - "env": "GFXRECON_LOG_FILE_FLUSH_AFTER_WRITE", - "label": "Log File Flush After Write", - "description": "Flush the log file to disk after each write when true.", - "type": "BOOL", - "default": false - }, - { - "key": "log_file_keep_open", - "env": "GFXRECON_LOG_FILE_KEEP_OPEN", - "label": "Log File Keep Open", - "description": "Keep the log file open between log messages when true, or close and reopen the log file for each message when false.", - "type": "BOOL", - "default": true - }, - { - "key": "log_file_create_new", - "env": "GFXRECON_LOG_FILE_CREATE_NEW", - "label": "Log File Overwrite", - "description": "Specifies that log file initialization should overwrite an existing file when true, or append to an existing file when false.", - "type": "BOOL", - "default": true - } - ] - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/141/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/layers/141/VK_LAYER_LUNARG_monitor.json deleted file mode 100644 index b102ca9e07..0000000000 --- a/vkconfig_core/layers/141/VK_LAYER_LUNARG_monitor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "file_format_version": "1.0.0", - "layer": { - "name": "VK_LAYER_LUNARG_monitor", - "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.2.141", - "implementation_version": "1", - "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ] - } -} diff --git a/vkconfig_core/layers/141/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/layers/141/VK_LAYER_LUNARG_screenshot.json deleted file mode 100644 index 3448019103..0000000000 --- a/vkconfig_core/layers/141/VK_LAYER_LUNARG_screenshot.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_screenshot", - "type": "GLOBAL", - "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.2.148", - "implementation_version": "1", - "description": "LunarG image capture layer", - "introduction": "The screenshot layer records frames to image files.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "settings": [ - { - "key": "frames", - "env": "VK_SCREENSHOT_FRAMES", - "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "" - }, - { - "key": "dir", - "env": "VK_SCREENSHOT_DIR", - "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", - "type": "SAVE_FOLDER", - "default": "" - }, - { - "key": "format", - "env": "VK_SCREENSHOT_FORMAT", - "label": "Format", - "description": "This can be set to a color space for the output.", - "type": "ENUM", - "flags": [ - { - "key": "UNORM", - "label": "UNORM", - "description": "" - }, - { - "key": "SNORM", - "label": "SNORM", - "description": "" - }, - { - "key": "USCALED", - "label": "USCALED", - "description": "" - }, - { - "key": "SSCALED", - "label": "SSCALED", - "description": "" - }, - { - "key": "UINT", - "label": "UINT", - "description": "" - }, - { - "key": "SINT", - "label": "SINT", - "description": "" - }, - { - "key": "SRGB", - "label": "SRGB", - "description": "" - }, - { - "key": "USE_SWAPCHAIN_COLORSPACE", - "label": "USE_SWAPCHAIN_COLORSPACE", - "description": "" - } - ], - "default": "USE_SWAPCHAIN_COLORSPACE" - } - ] - } - } -} diff --git a/vkconfig_core/layers/148/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/148/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index f0681faaf0..0000000000 --- a/vkconfig_core/layers/148/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,404 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.2.148", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", - "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Shader Printf", - "description": "Debug shader code by \"printing\" any values of interest to the debug callback or stdout.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - }, - { - "key": "enable_message_limit", - "value": false - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "enable_message_limit", - "label": "Limit Duplicated Messages", - "description": "Enable limitation of duplicate messages.", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "duplicate_message_limit", - "env": "VK_LAYER_DUPLICATE_MESSAGE_LIMIT", - "label": "Max Duplicated Messages", - "description": "Maximum number of times any single validation message would be reported.", - "type": "INT", - "default": 10, - "range": { - "min": 1 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "enable_message_limit", - "value": true - } - ] - } - } - ] - }, - { - "key": "message_id_filter", - "env": "VK_LAYER_MESSAGE_ID_FILTER", - "label": "Mute Message VUIDs", - "description": "List of VUIDs and VUID identifers which are to be IGNORED by the validation layer", - "type": "LIST", - "default": [] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT", - "label": "Debug Printf", - "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback", - "url": "${LUNARG_SDK}/debug_printf.html", - "status": "STABLE", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Activating this feature instruments shader programs to generate additional diagnostic data.", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve a descriptorSet binding slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - }, - { - "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM", - "label": "ARM-specific best practices", - "description": "Activating this feature enables the output of warnings related to ARM-specific misuse of the API, but which are not explicitly prohibited by the specification." - } - ], - "default": [] - } - ] - } - } -} diff --git a/vkconfig_core/layers/148/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/layers/148/VK_LAYER_LUNARG_api_dump.json deleted file mode 100644 index d3c4f5f62e..0000000000 --- a/vkconfig_core/layers/148/VK_LAYER_LUNARG_api_dump.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_api_dump", - "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.2.148", - "implementation_version": "2", - "description": "LunarG API dump layer", - "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "presets": [ - { - "label": "Console Output", - "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "stdout" - }, - { - "key": "file", - "value": false - } - ] - }, - { - "label": "Text Output", - "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.txt" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "HTML Output", - "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "html" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.html" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "JSON Output", - "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "json" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.json" - }, - { - "key": "file", - "value": true - } - ] - } - ], - "settings": [ - { - "key": "output_range", - "env": "VK_APIDUMP_OUTPUT_RANGE", - "label": "Output Range", - "description": "Comma separated list of frames to output or a range of frames with a start, count, and optional interval separated by a dash. A count of 0 will output every frame after the start of the range. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "0-0" - }, - { - "key": "output_format", - "env": "VK_APIDUMP_OUTPUT_FORMAT", - "label": "Output Format", - "description": "Specifies the format used for output; can be HTML, JSON, or Text (default -- outputs plain text)", - "type": "ENUM", - "flags": [ - { - "key": "text", - "label": "Text", - "description": "Plain text" - }, - { - "key": "html", - "label": "HTML", - "description": "HTML" - }, - { - "key": "json", - "label": "JSON", - "description": "Json" - } - ], - "default": "text" - }, - { - "key": "file", - "label": "Output to File", - "description": "Setting this to true indicates that output should be written to file instead of stdout", - "type": "BOOL", - "default": false, - "settings": [ - { - "key": "log_filename", - "env": "VK_APIDUMP_LOG_FILENAME", - "label": "Log Filename", - "description": "Specifies the file to dump to when output files are enabled", - "type": "SAVE_FILE", - "filter": "*.txt,*.html,*.json", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "file", - "value": true - } - ] - } - } - ] - }, - { - "key": "flush", - "env": "VK_APIDUMP_FLUSH", - "label": "Log Flush After Write", - "description": "Setting this to true causes IO to be flushed after each API call that is written", - "type": "BOOL", - "default": true - }, - { - "key": "name_size", - "label": "Name Size", - "description": "The number of characters the name of a variable should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 1 - }, - "unit": "chars" - }, - { - "key": "show_types", - "label": "Show Types", - "description": "Dump types in addition to values", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "type_size", - "label": "Type Size", - "description": "The number of characters the name of a type should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 0 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "show_types", - "value": true - } - ] - } - } - ] - }, - { - "key": "show_timestamp", - "env": "VK_APIDUMP_TIMESTAMP", - "label": "Show Timestamp", - "description": "Show the timestamp of function calls since start in microseconds", - "type": "BOOL", - "default": false - }, - { - "key": "show_shader", - "label": "Show Shader", - "description": "Dump the shader binary code in pCode", - "type": "BOOL", - "default": false - }, - { - "key": "detailed", - "env": "VK_APIDUMP_DETAILED", - "label": "Show Parameter Details", - "description": "Dump parameter details in addition to API calls", - "type": "BOOL", - "default": true - }, - { - "key": "no_addr", - "env": "VK_APIDUMP_NO_ADDR", - "label": "Hide Addresses", - "description": "Dump \"address\" in place of hex addresses", - "type": "BOOL", - "default": false - }, - { - "key": "use_spaces", - "label": "Use Spaces", - "description": "Setting this to true causes all tab characters to be replaced with spaces", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "indent_size", - "label": "Indent Size", - "description": "Specifies the number of spaces that a tab is equal to", - "type": "INT", - "default": 4, - "range": { - "min": 1, - "max": 16 - }, - "unit": "chars", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "use_spaces", - "value": true - } - ] - } - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/148/VK_LAYER_LUNARG_gfxreconstruct.json b/vkconfig_core/layers/148/VK_LAYER_LUNARG_gfxreconstruct.json deleted file mode 100644 index ec324fcda4..0000000000 --- a/vkconfig_core/layers/148/VK_LAYER_LUNARG_gfxreconstruct.json +++ /dev/null @@ -1,409 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_gfxreconstruct", - "type": "GLOBAL", - "library_path": ".\\VkLayer_gfxreconstruct.dll", - "api_version": "1.2.148", - "status": "BETA", - "implementation_version": "36866", - "description": "GFXReconstruct Capture Layer Version 0.9.2", - "introduction": "The GFXReconstruct Capture Layer intercepts Vulkan API calls and logs them to a capture file. Other tools in the GFXReconstruct suite can inspect, modify, or replay capture files generated by this component.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/capture_tools.html", - "platforms": [ "WINDOWS", "LINUX", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Initialization", - "description": "Capture the first two frames.", - "settings": [ - { - "key": "capture_trigger", - "value": "" - }, - { - "key": "capture_frames", - "value": "1-2" - }, - { - "key": "memory_tracking_mode", - "value": "unassisted" - } - ] - }, - { - "label": "Range", - "description": "Capture a range of frames between presses of the F5 key.", - "settings": [ - { - "key": "capture_trigger", - "value": "F5" - }, - { - "key": "capture_frames", - "value": "" - }, - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - ], - "settings": [ - { - "key": "capture_trigger", - "env": "GFXRECON_CAPTURE_TRIGGER", - "label": "Hotkey Capture Trigger", - "description": "Specify a hotkey (any one of F1-F12, TAB, CONTROL) that will be used to start/stop capture. Example: F3 will set the capture trigger to F3 hotkey. One capture file will be generated for each pair of start/stop hotkey presses. Default is: Empty string (hotkey capture trigger is disabled).", - "type": "ENUM", - "flags": [ - { - "key": "", - "label": "None", - "description": "" - }, - { - "key": "F1", - "label": "F1", - "description": "" - }, - { - "key": "F2", - "label": "F2", - "description": "" - }, - { - "key": "F3", - "label": "F3", - "description": "" - }, - { - "key": "F4", - "label": "F4", - "description": "" - }, - { - "key": "F5", - "label": "F5", - "description": "" - }, - { - "key": "F6", - "label": "F6", - "description": "" - }, - { - "key": "F7", - "label": "F7", - "description": "" - }, - { - "key": "F8", - "label": "F8", - "description": "" - }, - { - "key": "F9", - "label": "F9", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F11", - "label": "F11", - "description": "" - }, - { - "key": "F12", - "label": "F12", - "description": "" - }, - { - "key": "TAB", - "label": "TAB", - "description": "" - }, - { - "key": "CONTROL", - "label": "CONTROL", - "description": "" - } - ], - "default": "" - }, - { - "key": "capture_frames", - "env": "GFXRECON_CAPTURE_FRAMES", - "label": "Capture Specific Frames", - "description": "Specify one or more comma-separated frame ranges to capture. Each range will be written to its own file. A frame range can be specified as a single value, to specify a single frame to capture, or as two hyphenated values, to specify the first and last frame to capture. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: 200,301-305 will create two capture files, one containing a single frame and one containing five frames. Default is: Empty string (all frames are captured).", - "type": "STRING", - "default": "" - }, - { - "key": "capture_file", - "env": "GFXRECON_CAPTURE_FILE", - "label": "Capture File Name", - "description": "Path to use when creating the capture file. Default is: gfxrecon_capture.gfxr", - "type": "SAVE_FILE", - "filter": "*.gfxr", - "default": "${VK_LOCAL}/gfxrecon_capture.gfxr", - "settings": [ - { - "key": "capture_file_timestamp", - "env": "GFXRECON_CAPTURE_FILE_TIMESTAMP", - "label": "Capture File Name with Timestamp", - "description": "Add a timestamp (yyyymmddThhmmss) postfix to the capture file name.", - "type": "BOOL", - "default": true - }, - { - "key": "capture_file_flush", - "env": "GFXRECON_CAPTURE_FILE_FLUSH", - "label": "Capture File Flush After Write", - "description": "Flush output stream after each packet is written to the capture file. Default is: false.", - "type": "BOOL", - "default": true - } - ] - }, - { - "key": "capture_compression_type", - "env": "GFXRECON_CAPTURE_COMPRESSION_TYPE", - "label": "Compression Format", - "description": "Compression format to use with the capture file. Valid values are: LZ4, ZLIB, ZSTD, and NONE. Default is: LZ4", - "type": "ENUM", - "flags": [ - { - "key": "LZ4", - "label": "LZ4", - "description": "Fastest compression algorithm that favors performance over compression ratio." - }, - { - "key": "ZLIB", - "label": "ZLIB", - "description": "Widely used compression algorithm with better compression ratio than LZ4 but worse performance." - }, - { - "key": "ZSTD", - "label": "ZSTD", - "description": "Newer compression algorithm with better compression ratio and performance than ZLIB, though not as fast as LZ4." - }, - { - "key": "NONE", - "label": "NONE", - "description": "No compression" - } - ], - "default": "LZ4" - }, - { - "key": "memory_tracking_mode", - "env": "GFXRECON_MEMORY_TRACKING_MODE", - "label": "Memory Tracking Mode", - "description": "Specifies the memory tracking mode to use for detecting modifications to mapped Vulkan memory objects. Available options are: page_guard, assisted, and unassisted.", - "type": "ENUM", - "flags": [ - { - "key": "page_guard", - "label": "page_guard", - "description": "Tracks modifications to individual memory pages, which are written to the capture file on calls to vkFlushMappedMemoryRanges, vkUnmapMemory, and vkQueueSubmit. Tracking modifications requires allocating shadow memory for all mapped memory." - }, - { - "key": "assisted", - "label": "assisted", - "description": "Expects the application to call vkFlushMappedMemoryRanges after memory is modified; the memory ranges specified to the vkFlushMappedMemoryRanges call will be written to the capture file during the call." - }, - { - "key": "unassisted", - "label": "unassisted", - "description": "Writes the full content of mapped memory to the capture file on calls to vkUnmapMemory and vkQueueSubmit. It is very inefficient and may be unusable with real-world applications that map large amounts of memory." - } - ], - "default": "page_guard", - "settings": [ - { - "key": "page_guard_copy_on_map", - "env": "GFXRECON_PAGE_GUARD_COPY_ON_MAP", - "label": "Page Guard Copy on Map", - "description": "When the page_guard memory tracking mode is enabled, copies the content of the mapped memory to the shadow memory immediately after the memory is mapped.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_separate_read", - "env": "GFXRECON_PAGE_GUARD_SEPARATE_READ", - "label": "Page Guard Separate Read Tracking", - "description": "When the page_guard memory tracking mode is enabled, copies the content of pages accessed for read from mapped memory to shadow memory on each read. Can overwrite unprocessed shadow memory content when an application is reading from and writing to the same page.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_external_memory", - "env": "GFXRECON_PAGE_GUARD_EXTERNAL_MEMORY", - "label": "Page Guard External Memory", - "description": "When the page_guard memory tracking mode is enabled, use the VK_EXT_external_memory_host extension to eliminate the need for shadow memory allocations. For each memory allocation from a host visible memory type, the capture layer will create an allocation from system memory, which it can monitor for write access, and provide that allocation to vkAllocateMemory as external memory. Only available on Windows.", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - } - ] - }, - { - "key": "log", - "label": "Log", - "description": "Control log messages.", - "type": "GROUP", - "settings": [ - { - "key": "log_level", - "env": "GFXRECON_LOG_LEVEL", - "label": "Level", - "description": "Specify the highest level message to log. Options are: debug, info, warning, error, and fatal. The specified level and all levels listed after it will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.", - "type": "ENUM", - "flags": [ - { - "key": "debug", - "label": "debug, info, warning, error, fatal", - "description": "" - }, - { - "key": "info", - "label": "info, warning, error, fatal", - "description": "" - }, - { - "key": "warning", - "label": "warning, error, fatal", - "description": "" - }, - { - "key": "error", - "label": "error, fatal", - "description": "" - }, - { - "key": "fatal", - "label": "fatal", - "description": "" - } - ], - "default": "info" - }, - { - "key": "log_detailed", - "env": "GFXRECON_LOG_DETAILED", - "label": "Log Name and Line Number", - "description": "Include name and line number from the file responsible.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_console", - "env": "GFXRECON_LOG_OUTPUT_TO_CONSOLE", - "label": "Log Output to Console / stdout", - "description": "Log messages will be written to stdout.", - "type": "BOOL", - "default": true - }, - { - "key": "log_break_on_error", - "env": "GFXRECON_LOG_BREAK_ON_ERROR", - "label": "Trigger Debug Break on Error", - "description": "Trigger a debug break when logging an error.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_os_debug_string", - "env": "GFXRECON_LOG_OUTPUT_TO_OS_DEBUG_STRING", - "label": "Log Output to Debug Console", - "description": "Windows only option. Log messages will be written to the Debug Console with OutputDebugStringA", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false - }, - { - "key": "log_file", - "env": "GFXRECON_LOG_FILE", - "label": "Log File", - "description": "When set, log messages will be written to a file at the specified path. Default is: Empty string (file logging disabled).", - "type": "SAVE_FILE", - "filter": "*.txt", - "default": "", - "settings": [ - { - "key": "log_file_flush_after_write", - "env": "GFXRECON_LOG_FILE_FLUSH_AFTER_WRITE", - "label": "Log File Flush After Write", - "description": "Flush the log file to disk after each write when true.", - "type": "BOOL", - "default": false - }, - { - "key": "log_file_keep_open", - "env": "GFXRECON_LOG_FILE_KEEP_OPEN", - "label": "Log File Keep Open", - "description": "Keep the log file open between log messages when true, or close and reopen the log file for each message when false.", - "type": "BOOL", - "default": true - }, - { - "key": "log_file_create_new", - "env": "GFXRECON_LOG_FILE_CREATE_NEW", - "label": "Log File Overwrite", - "description": "Specifies that log file initialization should overwrite an existing file when true, or append to an existing file when false.", - "type": "BOOL", - "default": true - } - ] - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/148/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/layers/148/VK_LAYER_LUNARG_monitor.json deleted file mode 100644 index 0f1e412a99..0000000000 --- a/vkconfig_core/layers/148/VK_LAYER_LUNARG_monitor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "file_format_version": "1.0.0", - "layer": { - "name": "VK_LAYER_LUNARG_monitor", - "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.2.148", - "implementation_version": "1", - "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ] - } -} diff --git a/vkconfig_core/layers/148/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/layers/148/VK_LAYER_LUNARG_screenshot.json deleted file mode 100644 index 3448019103..0000000000 --- a/vkconfig_core/layers/148/VK_LAYER_LUNARG_screenshot.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_screenshot", - "type": "GLOBAL", - "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.2.148", - "implementation_version": "1", - "description": "LunarG image capture layer", - "introduction": "The screenshot layer records frames to image files.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "settings": [ - { - "key": "frames", - "env": "VK_SCREENSHOT_FRAMES", - "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "" - }, - { - "key": "dir", - "env": "VK_SCREENSHOT_DIR", - "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", - "type": "SAVE_FOLDER", - "default": "" - }, - { - "key": "format", - "env": "VK_SCREENSHOT_FORMAT", - "label": "Format", - "description": "This can be set to a color space for the output.", - "type": "ENUM", - "flags": [ - { - "key": "UNORM", - "label": "UNORM", - "description": "" - }, - { - "key": "SNORM", - "label": "SNORM", - "description": "" - }, - { - "key": "USCALED", - "label": "USCALED", - "description": "" - }, - { - "key": "SSCALED", - "label": "SSCALED", - "description": "" - }, - { - "key": "UINT", - "label": "UINT", - "description": "" - }, - { - "key": "SINT", - "label": "SINT", - "description": "" - }, - { - "key": "SRGB", - "label": "SRGB", - "description": "" - }, - { - "key": "USE_SWAPCHAIN_COLORSPACE", - "label": "USE_SWAPCHAIN_COLORSPACE", - "description": "" - } - ], - "default": "USE_SWAPCHAIN_COLORSPACE" - } - ] - } - } -} diff --git a/vkconfig_core/layers/154/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/154/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index 8b60336c98..0000000000 --- a/vkconfig_core/layers/154/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,432 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.2.154", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", - "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Synchronization", - "description": "Identify resource access conflicts due to missing or incorrect synchronization operations between actions reading or writing the same regions of memory.", - "status": "ALPHA", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Shader Printf", - "description": "Debug shader code by \"printing\" any values of interest to the debug callback or stdout.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - }, - { - "key": "enable_message_limit", - "value": false - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "enable_message_limit", - "label": "Limit Duplicated Messages", - "description": "Enable limitation of duplicate messages.", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "duplicate_message_limit", - "env": "VK_LAYER_DUPLICATE_MESSAGE_LIMIT", - "label": "Max Duplicated Messages", - "description": "Maximum number of times any single validation message would be reported.", - "type": "INT", - "default": 10, - "range": { - "min": 1 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "enable_message_limit", - "value": true - } - ] - } - } - ] - }, - { - "key": "message_id_filter", - "env": "VK_LAYER_MESSAGE_ID_FILTER", - "label": "Mute Message VUIDs", - "description": "List of VUIDs and VUID identifers which are to be IGNORED by the validation layer", - "type": "LIST", - "default": [] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT", - "label": "Synchronization", - "description": "This feature reports resource access conflicts due to missing or incorrect synchronization operations between actions (Draw, Copy, Dispatch, Blit) reading or writing the same regions of memory.", - "url": "${LUNARG_SDK}/synchronization_usage.html", - "status": "ALPHA" - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT", - "label": "Debug Printf", - "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback", - "url": "${LUNARG_SDK}/debug_printf.html", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Activating this feature instruments shader programs to generate additional diagnostic data.", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve a descriptorSet binding slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - }, - { - "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM", - "label": "ARM-specific best practices", - "description": "Activating this feature enables the output of warnings related to ARM-specific misuse of the API, but which are not explicitly prohibited by the specification." - } - ], - "default": [] - } - ] - } - } -} diff --git a/vkconfig_core/layers/154/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/layers/154/VK_LAYER_LUNARG_api_dump.json deleted file mode 100644 index b0e109149b..0000000000 --- a/vkconfig_core/layers/154/VK_LAYER_LUNARG_api_dump.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_api_dump", - "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.2.154", - "implementation_version": "2", - "description": "LunarG API dump layer", - "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "presets": [ - { - "label": "Console Output", - "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "stdout" - }, - { - "key": "file", - "value": false - } - ] - }, - { - "label": "Text Output", - "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.txt" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "HTML Output", - "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "html" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.html" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "JSON Output", - "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "json" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.json" - }, - { - "key": "file", - "value": true - } - ] - } - ], - "settings": [ - { - "key": "output_range", - "env": "VK_APIDUMP_OUTPUT_RANGE", - "label": "Output Range", - "description": "Comma separated list of frames to output or a range of frames with a start, count, and optional interval separated by a dash. A count of 0 will output every frame after the start of the range. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "0-0" - }, - { - "key": "output_format", - "env": "VK_APIDUMP_OUTPUT_FORMAT", - "label": "Output Format", - "description": "Specifies the format used for output; can be HTML, JSON, or Text (default -- outputs plain text)", - "type": "ENUM", - "flags": [ - { - "key": "text", - "label": "Text", - "description": "Plain text" - }, - { - "key": "html", - "label": "HTML", - "description": "HTML" - }, - { - "key": "json", - "label": "JSON", - "description": "Json" - } - ], - "default": "text" - }, - { - "key": "file", - "label": "Output to File", - "description": "Setting this to true indicates that output should be written to file instead of stdout", - "type": "BOOL", - "default": false, - "settings": [ - { - "key": "log_filename", - "env": "VK_APIDUMP_LOG_FILENAME", - "label": "Log Filename", - "description": "Specifies the file to dump to when output files are enabled", - "type": "SAVE_FILE", - "filter": "*.txt,*.html,*.json", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "file", - "value": true - } - ] - } - } - ] - }, - { - "key": "flush", - "env": "VK_APIDUMP_FLUSH", - "label": "Log Flush After Write", - "description": "Setting this to true causes IO to be flushed after each API call that is written", - "type": "BOOL", - "default": true - }, - { - "key": "name_size", - "label": "Name Size", - "description": "The number of characters the name of a variable should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 1 - }, - "unit": "chars" - }, - { - "key": "show_types", - "label": "Show Types", - "description": "Dump types in addition to values", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "type_size", - "label": "Type Size", - "description": "The number of characters the name of a type should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 0 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "show_types", - "value": true - } - ] - } - } - ] - }, - { - "key": "show_timestamp", - "env": "VK_APIDUMP_TIMESTAMP", - "label": "Show Timestamp", - "description": "Show the timestamp of function calls since start in microseconds", - "type": "BOOL", - "default": false - }, - { - "key": "show_shader", - "label": "Show Shader", - "description": "Dump the shader binary code in pCode", - "type": "BOOL", - "default": false - }, - { - "key": "detailed", - "env": "VK_APIDUMP_DETAILED", - "label": "Show Parameter Details", - "description": "Dump parameter details in addition to API calls", - "type": "BOOL", - "default": true - }, - { - "key": "no_addr", - "env": "VK_APIDUMP_NO_ADDR", - "label": "Hide Addresses", - "description": "Dump \"address\" in place of hex addresses", - "type": "BOOL", - "default": false - }, - { - "key": "use_spaces", - "label": "Use Spaces", - "description": "Setting this to true causes all tab characters to be replaced with spaces", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "indent_size", - "label": "Indent Size", - "description": "Specifies the number of spaces that a tab is equal to", - "type": "INT", - "default": 4, - "range": { - "min": 1, - "max": 16 - }, - "unit": "chars", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "use_spaces", - "value": true - } - ] - } - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/154/VK_LAYER_LUNARG_gfxreconstruct.json b/vkconfig_core/layers/154/VK_LAYER_LUNARG_gfxreconstruct.json deleted file mode 100644 index 027be30c70..0000000000 --- a/vkconfig_core/layers/154/VK_LAYER_LUNARG_gfxreconstruct.json +++ /dev/null @@ -1,408 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_gfxreconstruct", - "type": "GLOBAL", - "library_path": ".\\VkLayer_gfxreconstruct.dll", - "api_version": "1.2.154", - "implementation_version": "36867", - "description": "GFXReconstruct Capture Layer Version 0.9.3", - "introduction": "The GFXReconstruct Capture Layer intercepts Vulkan API calls and logs them to a capture file. Other tools in the GFXReconstruct suite can inspect, modify, or replay capture files generated by this component.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/capture_tools.html", - "platforms": [ "WINDOWS", "LINUX", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Initialization", - "description": "Capture the first two frames.", - "settings": [ - { - "key": "capture_trigger", - "value": "" - }, - { - "key": "capture_frames", - "value": "1-2" - }, - { - "key": "memory_tracking_mode", - "value": "unassisted" - } - ] - }, - { - "label": "Range", - "description": "Capture a range of frames between presses of the F5 key.", - "settings": [ - { - "key": "capture_trigger", - "value": "F5" - }, - { - "key": "capture_frames", - "value": "" - }, - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - ], - "settings": [ - { - "key": "capture_trigger", - "env": "GFXRECON_CAPTURE_TRIGGER", - "label": "Hotkey Capture Trigger", - "description": "Specify a hotkey (any one of F1-F12, TAB, CONTROL) that will be used to start/stop capture. Example: F3 will set the capture trigger to F3 hotkey. One capture file will be generated for each pair of start/stop hotkey presses. Default is: Empty string (hotkey capture trigger is disabled).", - "type": "ENUM", - "flags": [ - { - "key": "", - "label": "None", - "description": "" - }, - { - "key": "F1", - "label": "F1", - "description": "" - }, - { - "key": "F2", - "label": "F2", - "description": "" - }, - { - "key": "F3", - "label": "F3", - "description": "" - }, - { - "key": "F4", - "label": "F4", - "description": "" - }, - { - "key": "F5", - "label": "F5", - "description": "" - }, - { - "key": "F6", - "label": "F6", - "description": "" - }, - { - "key": "F7", - "label": "F7", - "description": "" - }, - { - "key": "F8", - "label": "F8", - "description": "" - }, - { - "key": "F9", - "label": "F9", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F11", - "label": "F11", - "description": "" - }, - { - "key": "F12", - "label": "F12", - "description": "" - }, - { - "key": "TAB", - "label": "TAB", - "description": "" - }, - { - "key": "CONTROL", - "label": "CONTROL", - "description": "" - } - ], - "default": "" - }, - { - "key": "capture_frames", - "env": "GFXRECON_CAPTURE_FRAMES", - "label": "Capture Specific Frames", - "description": "Specify one or more comma-separated frame ranges to capture. Each range will be written to its own file. A frame range can be specified as a single value, to specify a single frame to capture, or as two hyphenated values, to specify the first and last frame to capture. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: 200,301-305 will create two capture files, one containing a single frame and one containing five frames. Default is: Empty string (all frames are captured).", - "type": "STRING", - "default": "" - }, - { - "key": "capture_file", - "env": "GFXRECON_CAPTURE_FILE", - "label": "Capture File Name", - "description": "Path to use when creating the capture file. Default is: gfxrecon_capture.gfxr", - "type": "SAVE_FILE", - "filter": "*.gfxr", - "default": "${VK_LOCAL}/gfxrecon_capture.gfxr", - "settings": [ - { - "key": "capture_file_timestamp", - "env": "GFXRECON_CAPTURE_FILE_TIMESTAMP", - "label": "Capture File Name with Timestamp", - "description": "Add a timestamp (yyyymmddThhmmss) postfix to the capture file name.", - "type": "BOOL", - "default": true - }, - { - "key": "capture_file_flush", - "env": "GFXRECON_CAPTURE_FILE_FLUSH", - "label": "Capture File Flush After Write", - "description": "Flush output stream after each packet is written to the capture file. Default is: false.", - "type": "BOOL", - "default": true - } - ] - }, - { - "key": "capture_compression_type", - "env": "GFXRECON_CAPTURE_COMPRESSION_TYPE", - "label": "Compression Format", - "description": "Compression format to use with the capture file. Valid values are: LZ4, ZLIB, ZSTD, and NONE. Default is: LZ4", - "type": "ENUM", - "flags": [ - { - "key": "LZ4", - "label": "LZ4", - "description": "Fastest compression algorithm that favors performance over compression ratio." - }, - { - "key": "ZLIB", - "label": "ZLIB", - "description": "Widely used compression algorithm with better compression ratio than LZ4 but worse performance." - }, - { - "key": "ZSTD", - "label": "ZSTD", - "description": "Newer compression algorithm with better compression ratio and performance than ZLIB, though not as fast as LZ4." - }, - { - "key": "NONE", - "label": "NONE", - "description": "No compression" - } - ], - "default": "LZ4" - }, - { - "key": "memory_tracking_mode", - "env": "GFXRECON_MEMORY_TRACKING_MODE", - "label": "Memory Tracking Mode", - "description": "Specifies the memory tracking mode to use for detecting modifications to mapped Vulkan memory objects. Available options are: page_guard, assisted, and unassisted.", - "type": "ENUM", - "flags": [ - { - "key": "page_guard", - "label": "page_guard", - "description": "Tracks modifications to individual memory pages, which are written to the capture file on calls to vkFlushMappedMemoryRanges, vkUnmapMemory, and vkQueueSubmit. Tracking modifications requires allocating shadow memory for all mapped memory." - }, - { - "key": "assisted", - "label": "assisted", - "description": "Expects the application to call vkFlushMappedMemoryRanges after memory is modified; the memory ranges specified to the vkFlushMappedMemoryRanges call will be written to the capture file during the call." - }, - { - "key": "unassisted", - "label": "unassisted", - "description": "Writes the full content of mapped memory to the capture file on calls to vkUnmapMemory and vkQueueSubmit. It is very inefficient and may be unusable with real-world applications that map large amounts of memory." - } - ], - "default": "page_guard", - "settings": [ - { - "key": "page_guard_copy_on_map", - "env": "GFXRECON_PAGE_GUARD_COPY_ON_MAP", - "label": "Page Guard Copy on Map", - "description": "When the page_guard memory tracking mode is enabled, copies the content of the mapped memory to the shadow memory immediately after the memory is mapped.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_separate_read", - "env": "GFXRECON_PAGE_GUARD_SEPARATE_READ", - "label": "Page Guard Separate Read Tracking", - "description": "When the page_guard memory tracking mode is enabled, copies the content of pages accessed for read from mapped memory to shadow memory on each read. Can overwrite unprocessed shadow memory content when an application is reading from and writing to the same page.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_external_memory", - "env": "GFXRECON_PAGE_GUARD_EXTERNAL_MEMORY", - "label": "Page Guard External Memory", - "description": "When the page_guard memory tracking mode is enabled, use the VK_EXT_external_memory_host extension to eliminate the need for shadow memory allocations. For each memory allocation from a host visible memory type, the capture layer will create an allocation from system memory, which it can monitor for write access, and provide that allocation to vkAllocateMemory as external memory. Only available on Windows.", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - } - ] - }, - { - "key": "log", - "label": "Log", - "description": "Control log messages.", - "type": "GROUP", - "settings": [ - { - "key": "log_level", - "env": "GFXRECON_LOG_LEVEL", - "label": "Level", - "description": "Specify the highest level message to log. Options are: debug, info, warning, error, and fatal. The specified level and all levels listed after it will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.", - "type": "ENUM", - "flags": [ - { - "key": "debug", - "label": "debug, info, warning, error, fatal", - "description": "" - }, - { - "key": "info", - "label": "info, warning, error, fatal", - "description": "" - }, - { - "key": "warning", - "label": "warning, error, fatal", - "description": "" - }, - { - "key": "error", - "label": "error, fatal", - "description": "" - }, - { - "key": "fatal", - "label": "fatal", - "description": "" - } - ], - "default": "info" - }, - { - "key": "log_detailed", - "env": "GFXRECON_LOG_DETAILED", - "label": "Log Name and Line Number", - "description": "Include name and line number from the file responsible.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_console", - "env": "GFXRECON_LOG_OUTPUT_TO_CONSOLE", - "label": "Log Output to Console / stdout", - "description": "Log messages will be written to stdout.", - "type": "BOOL", - "default": true - }, - { - "key": "log_break_on_error", - "env": "GFXRECON_LOG_BREAK_ON_ERROR", - "label": "Trigger Debug Break on Error", - "description": "Trigger a debug break when logging an error.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_os_debug_string", - "env": "GFXRECON_LOG_OUTPUT_TO_OS_DEBUG_STRING", - "label": "Log Output to Debug Console", - "description": "Windows only option. Log messages will be written to the Debug Console with OutputDebugStringA", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false - }, - { - "key": "log_file", - "env": "GFXRECON_LOG_FILE", - "label": "Log File", - "description": "When set, log messages will be written to a file at the specified path. Default is: Empty string (file logging disabled).", - "type": "SAVE_FILE", - "filter": "*.txt", - "default": "", - "settings": [ - { - "key": "log_file_flush_after_write", - "env": "GFXRECON_LOG_FILE_FLUSH_AFTER_WRITE", - "label": "Log File Flush After Write", - "description": "Flush the log file to disk after each write when true.", - "type": "BOOL", - "default": false - }, - { - "key": "log_file_keep_open", - "env": "GFXRECON_LOG_FILE_KEEP_OPEN", - "label": "Log File Keep Open", - "description": "Keep the log file open between log messages when true, or close and reopen the log file for each message when false.", - "type": "BOOL", - "default": true - }, - { - "key": "log_file_create_new", - "env": "GFXRECON_LOG_FILE_CREATE_NEW", - "label": "Log File Overwrite", - "description": "Specifies that log file initialization should overwrite an existing file when true, or append to an existing file when false.", - "type": "BOOL", - "default": true - } - ] - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/154/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/layers/154/VK_LAYER_LUNARG_monitor.json deleted file mode 100644 index d27037c416..0000000000 --- a/vkconfig_core/layers/154/VK_LAYER_LUNARG_monitor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "file_format_version": "1.0.0", - "layer": { - "name": "VK_LAYER_LUNARG_monitor", - "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.2.154", - "implementation_version": "1", - "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ] - } -} diff --git a/vkconfig_core/layers/154/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/layers/154/VK_LAYER_LUNARG_screenshot.json deleted file mode 100644 index 42c77c9654..0000000000 --- a/vkconfig_core/layers/154/VK_LAYER_LUNARG_screenshot.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_screenshot", - "type": "GLOBAL", - "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.2.154", - "implementation_version": "1", - "description": "LunarG image capture layer", - "introduction": "The screenshot layer records frames to image files.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "settings": [ - { - "key": "frames", - "env": "VK_SCREENSHOT_FRAMES", - "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "" - }, - { - "key": "dir", - "env": "VK_SCREENSHOT_DIR", - "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", - "type": "SAVE_FOLDER", - "default": "" - }, - { - "key": "format", - "env": "VK_SCREENSHOT_FORMAT", - "label": "Format", - "description": "This can be set to a color space for the output.", - "type": "ENUM", - "flags": [ - { - "key": "UNORM", - "label": "UNORM", - "description": "" - }, - { - "key": "SNORM", - "label": "SNORM", - "description": "" - }, - { - "key": "USCALED", - "label": "USCALED", - "description": "" - }, - { - "key": "SSCALED", - "label": "SSCALED", - "description": "" - }, - { - "key": "UINT", - "label": "UINT", - "description": "" - }, - { - "key": "SINT", - "label": "SINT", - "description": "" - }, - { - "key": "SRGB", - "label": "SRGB", - "description": "" - }, - { - "key": "USE_SWAPCHAIN_COLORSPACE", - "label": "USE_SWAPCHAIN_COLORSPACE", - "description": "" - } - ], - "default": "USE_SWAPCHAIN_COLORSPACE" - } - ] - } - } -} diff --git a/vkconfig_core/layers/162/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/162/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index d1296b55fa..0000000000 --- a/vkconfig_core/layers/162/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,510 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.2.162", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET", - "VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Synchronization", - "description": "Identify resource access conflicts due to missing or incorrect synchronization operations between actions reading or writing the same regions of memory.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Shader Printf", - "description": "Debug shader code by \"printing\" any values of interest to the debug callback or stdout.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - }, - { - "key": "enable_message_limit", - "value": false - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "enable_message_limit", - "label": "Limit Duplicated Messages", - "description": "Enable limitation of duplicate messages.", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "duplicate_message_limit", - "env": "VK_LAYER_DUPLICATE_MESSAGE_LIMIT", - "label": "Max Duplicated Messages", - "description": "Maximum number of times any single validation message would be reported.", - "type": "INT", - "default": 10, - "range": { - "min": 1 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "enable_message_limit", - "value": true - } - ] - } - } - ] - }, - { - "key": "message_id_filter", - "env": "VK_LAYER_MESSAGE_ID_FILTER", - "label": "Mute Message VUIDs", - "description": "List of VUIDs and VUID identifers which are to be IGNORED by the validation layer", - "type": "LIST", - "default": [] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT", - "label": "Synchronization", - "description": "This feature reports resource access conflicts due to missing or incorrect synchronization operations between actions (Draw, Copy, Dispatch, Blit) reading or writing the same regions of memory.", - "url": "${LUNARG_SDK}/synchronization_usage.html", - "status": "STABLE" - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT", - "label": "Debug Printf", - "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback", - "url": "${LUNARG_SDK}/debug_printf.html", - "status": "STABLE", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "printf_to_stdout", - "label": "Printf to stdout", - "description": "To redirect Debug Printf messages from the debug callback to stdout", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" ] - } - ] - } - }, - { - "key": "printf_verbose", - "label": "Verbose", - "description": "Verbosity of debug printf messages", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" ] - } - ] - } - }, - { - "key": "printf_buffer_size", - "label": "Printf buffer size", - "description": "The size in bytes of the buffer used by debug printf", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "INT", - "default": 1024, - "range": { - "min": 128, - "max": 1048576 - }, - "unit": "bytes", - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" ] - } - ] - } - } - ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "gpuav_buffer_oob", - "label": "Check Out of Bounds ", - "description": "Enable buffer out of bounds checking", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT" ] - } - ] - } - } - ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve Descriptor Set Binding Slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - }, - { - "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM", - "label": "ARM-specific best practices", - "description": "Activating this feature enables the output of warnings related to ARM-specific misuse of the API, but which are not explicitly prohibited by the specification." - } - ], - "default": [] - } - ] - } - - } -} diff --git a/vkconfig_core/layers/162/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/layers/162/VK_LAYER_LUNARG_api_dump.json deleted file mode 100644 index 1b6b7c0ce2..0000000000 --- a/vkconfig_core/layers/162/VK_LAYER_LUNARG_api_dump.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_api_dump", - "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.2.162", - "implementation_version": "2", - "description": "LunarG API dump layer", - "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "presets": [ - { - "label": "Console Output", - "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "stdout" - }, - { - "key": "file", - "value": false - } - ] - }, - { - "label": "Text Output", - "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "text" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.txt" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "HTML Output", - "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "html" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.html" - }, - { - "key": "file", - "value": true - } - ] - }, - { - "label": "JSON Output", - "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], - "status": "STABLE", - "settings": [ - { - "key": "output_format", - "value": "json" - }, - { - "key": "log_filename", - "value": "${VK_LOCAL}/vk_apidump.json" - }, - { - "key": "file", - "value": true - } - ] - } - ], - "settings": [ - { - "key": "output_range", - "env": "VK_APIDUMP_OUTPUT_RANGE", - "label": "Output Range", - "description": "Comma separated list of frames to output or a range of frames with a start, count, and optional interval separated by a dash. A count of 0 will output every frame after the start of the range. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "0-0" - }, - { - "key": "output_format", - "env": "VK_APIDUMP_OUTPUT_FORMAT", - "label": "Output Format", - "description": "Specifies the format used for output; can be HTML, JSON, or Text (default -- outputs plain text)", - "type": "ENUM", - "flags": [ - { - "key": "text", - "label": "Text", - "description": "Plain text" - }, - { - "key": "html", - "label": "HTML", - "description": "HTML" - }, - { - "key": "json", - "label": "JSON", - "description": "Json" - } - ], - "default": "text" - }, - { - "key": "file", - "label": "Output to File", - "description": "Setting this to true indicates that output should be written to file instead of stdout", - "type": "BOOL", - "default": false, - "settings": [ - { - "key": "log_filename", - "env": "VK_APIDUMP_LOG_FILENAME", - "label": "Log Filename", - "description": "Specifies the file to dump to when output files are enabled", - "type": "SAVE_FILE", - "filter": "*.txt,*.html,*.json", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "file", - "value": true - } - ] - } - } - ] - }, - { - "key": "flush", - "env": "VK_APIDUMP_FLUSH", - "label": "Log Flush After Write", - "description": "Setting this to true causes IO to be flushed after each API call that is written", - "type": "BOOL", - "default": true - }, - { - "key": "name_size", - "label": "Name Size", - "description": "The number of characters the name of a variable should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 1 - }, - "unit": "chars" - }, - { - "key": "show_types", - "label": "Show Types", - "description": "Dump types in addition to values", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "type_size", - "label": "Type Size", - "description": "The number of characters the name of a type should consume, assuming more are not required", - "type": "INT", - "default": 32, - "range": { - "min": 0 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "show_types", - "value": true - } - ] - } - } - ] - }, - { - "key": "show_timestamp", - "env": "VK_APIDUMP_TIMESTAMP", - "label": "Show Timestamp", - "description": "Show the timestamp of function calls since start in microseconds", - "type": "BOOL", - "default": false - }, - { - "key": "show_shader", - "label": "Show Shader", - "description": "Dump the shader binary code in pCode", - "type": "BOOL", - "default": false - }, - { - "key": "detailed", - "env": "VK_APIDUMP_DETAILED", - "label": "Show Parameter Details", - "description": "Dump parameter details in addition to API calls", - "type": "BOOL", - "default": true - }, - { - "key": "no_addr", - "env": "VK_APIDUMP_NO_ADDR", - "label": "Hide Addresses", - "description": "Dump \"address\" in place of hex addresses", - "type": "BOOL", - "default": false - }, - { - "key": "use_spaces", - "label": "Use Spaces", - "description": "Setting this to true causes all tab characters to be replaced with spaces", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "indent_size", - "label": "Indent Size", - "description": "Specifies the number of spaces that a tab is equal to", - "type": "INT", - "default": 4, - "range": { - "min": 1, - "max": 16 - }, - "unit": "chars", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "use_spaces", - "value": true - } - ] - } - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/162/VK_LAYER_LUNARG_gfxreconstruct.json b/vkconfig_core/layers/162/VK_LAYER_LUNARG_gfxreconstruct.json deleted file mode 100644 index f24c92b568..0000000000 --- a/vkconfig_core/layers/162/VK_LAYER_LUNARG_gfxreconstruct.json +++ /dev/null @@ -1,429 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_gfxreconstruct", - "type": "GLOBAL", - "library_path": ".\\VkLayer_gfxreconstruct.dll", - "api_version": "1.2.162", - "implementation_version": "36868", - "description": "GFXReconstruct Capture Layer Version 0.9.4", - "introduction": "The GFXReconstruct Capture Layer intercepts Vulkan API calls and logs them to a capture file. Other tools in the GFXReconstruct suite can inspect, modify, or replay capture files generated by this component.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/capture_tools.html", - "platforms": [ "WINDOWS", "LINUX", "ANDROID" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Initialization", - "description": "Capture the first two frames.", - "settings": [ - { - "key": "capture_trigger", - "value": "" - }, - { - "key": "capture_frames", - "value": "1-2" - }, - { - "key": "memory_tracking_mode", - "value": "unassisted" - } - ] - }, - { - "label": "Range", - "description": "Capture a range of frames between presses of the F5 key.", - "settings": [ - { - "key": "capture_trigger", - "value": "F5" - }, - { - "key": "capture_frames", - "value": "" - }, - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - ], - "settings": [ - { - "key": "capture_trigger", - "env": "GFXRECON_CAPTURE_TRIGGER", - "label": "Hotkey Capture Trigger", - "description": "Specify a hotkey (any one of F1-F12, TAB, CONTROL) that will be used to start/stop capture. Example: F3 will set the capture trigger to F3 hotkey. One capture file will be generated for each pair of start/stop hotkey presses. Default is: Empty string (hotkey capture trigger is disabled).", - "type": "ENUM", - "flags": [ - { - "key": "", - "label": "None", - "description": "" - }, - { - "key": "F1", - "label": "F1", - "description": "" - }, - { - "key": "F2", - "label": "F2", - "description": "" - }, - { - "key": "F3", - "label": "F3", - "description": "" - }, - { - "key": "F4", - "label": "F4", - "description": "" - }, - { - "key": "F5", - "label": "F5", - "description": "" - }, - { - "key": "F6", - "label": "F6", - "description": "" - }, - { - "key": "F7", - "label": "F7", - "description": "" - }, - { - "key": "F8", - "label": "F8", - "description": "" - }, - { - "key": "F9", - "label": "F9", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" - }, - { - "key": "F11", - "label": "F11", - "description": "" - }, - { - "key": "F12", - "label": "F12", - "description": "" - }, - { - "key": "TAB", - "label": "TAB", - "description": "" - }, - { - "key": "CONTROL", - "label": "CONTROL", - "description": "" - } - ], - "default": "" - }, - { - "key": "capture_frames", - "env": "GFXRECON_CAPTURE_FRAMES", - "label": "Capture Specific Frames", - "description": "Specify one or more comma-separated frame ranges to capture. Each range will be written to its own file. A frame range can be specified as a single value, to specify a single frame to capture, or as two hyphenated values, to specify the first and last frame to capture. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: 200,301-305 will create two capture files, one containing a single frame and one containing five frames. Default is: Empty string (all frames are captured).", - "type": "STRING", - "default": "" - }, - { - "key": "capture_file", - "env": "GFXRECON_CAPTURE_FILE", - "label": "Capture File Name", - "description": "Path to use when creating the capture file. Default is: gfxrecon_capture.gfxr", - "type": "SAVE_FILE", - "filter": "*.gfxr", - "default": "${VK_LOCAL}/gfxrecon_capture.gfxr", - "settings": [ - { - "key": "capture_file_timestamp", - "env": "GFXRECON_CAPTURE_FILE_TIMESTAMP", - "label": "Capture File Name with Timestamp", - "description": "Add a timestamp (yyyymmddThhmmss) postfix to the capture file name.", - "type": "BOOL", - "default": true - }, - { - "key": "capture_file_flush", - "env": "GFXRECON_CAPTURE_FILE_FLUSH", - "label": "Capture File Flush After Write", - "description": "Flush output stream after each packet is written to the capture file. Default is: false.", - "type": "BOOL", - "default": true - } - ] - }, - { - "key": "capture_compression_type", - "env": "GFXRECON_CAPTURE_COMPRESSION_TYPE", - "label": "Compression Format", - "description": "Compression format to use with the capture file. Valid values are: LZ4, ZLIB, ZSTD, and NONE. Default is: LZ4", - "type": "ENUM", - "flags": [ - { - "key": "LZ4", - "label": "LZ4", - "description": "Fastest compression algorithm that favors performance over compression ratio." - }, - { - "key": "ZLIB", - "label": "ZLIB", - "description": "Widely used compression algorithm with better compression ratio than LZ4 but worse performance." - }, - { - "key": "ZSTD", - "label": "ZSTD", - "description": "Newer compression algorithm with better compression ratio and performance than ZLIB, though not as fast as LZ4." - }, - { - "key": "NONE", - "label": "NONE", - "description": "No compression" - } - ], - "default": "LZ4" - }, - { - "key": "memory_tracking_mode", - "env": "GFXRECON_MEMORY_TRACKING_MODE", - "label": "Memory Tracking Mode", - "description": "Specifies the memory tracking mode to use for detecting modifications to mapped Vulkan memory objects. Available options are: page_guard, assisted, and unassisted.", - "type": "ENUM", - "flags": [ - { - "key": "page_guard", - "label": "page_guard", - "description": "tracks modifications to individual memory pages, which are written to the capture file on calls to vkFlushMappedMemoryRanges, vkUnmapMemory, and vkQueueSubmit. Tracking modifications requires allocating shadow memory for all mapped memory." - }, - { - "key": "assisted", - "label": "assisted", - "description": "Expects the application to call vkFlushMappedMemoryRanges after memory is modified; the memory ranges specified to the vkFlushMappedMemoryRanges call will be written to the capture file during the call." - }, - { - "key": "unassisted", - "label": "unassisted", - "description": "writes the full content of mapped memory to the capture file on calls to vkUnmapMemory and vkQueueSubmit. It is very inefficient and may be unusable with real-world applications that map large amounts of memory." - } - ], - "default": "page_guard", - "settings": [ - { - "key": "page_guard_copy_on_map", - "env": "GFXRECON_PAGE_GUARD_COPY_ON_MAP", - "label": "Page Guard Copy on Map", - "description": "When the page_guard memory tracking mode is enabled, copies the content of the mapped memory to the shadow memory immediately after the memory is mapped.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_separate_read", - "env": "GFXRECON_PAGE_GUARD_SEPARATE_READ", - "label": "Page Guard Separate Read Tracking", - "description": "When the page_guard memory tracking mode is enabled, copies the content of pages accessed for read from mapped memory to shadow memory on each read. Can overwrite unprocessed shadow memory content when an application is reading from and writing to the same page.", - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_external_memory", - "env": "GFXRECON_PAGE_GUARD_EXTERNAL_MEMORY", - "label": "Page Guard External Memory", - "description": "When the page_guard memory tracking mode is enabled, use the VK_EXT_external_memory_host extension to eliminate the need for shadow memory allocations. For each memory allocation from a host visible memory type, the capture layer will create an allocation from system memory, which it can monitor for write access, and provide that allocation to vkAllocateMemory as external memory. Only available on Windows.", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - } - ] - } - }, - { - "key": "page_guard_persistent_memory", - "env": "GFXRECON_PAGE_GUARD_PERSISTENT_MEMORY", - "label": "Page Guard Persisent Memory", - "description": "When the page_guard memory tracking mode is enabled, this option changes the way that the shadow memory used to detect modifications to mapped memory is allocated. The default behavior is to allocate and copy the mapped memory range on map and free the allocation on unmap. When this option is enabled, an allocation with a size equal to that of the object being mapped is made once on the first map and is not freed until the object is destroyed. This option is intended to be used with applications that frequently map and unmap large memory ranges, to avoid frequent allocation and copy operations that can have a negative impact on performance. This option is ignored when GFXRECON_PAGE_GUARD_EXTERNAL_MEMORY is enabled.", - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "memory_tracking_mode", - "value": "page_guard" - }, - { - "key": "page_guard_external_memory", - "value": false - } - ] - } - } - ] - }, - { - "key": "log", - "label": "Log", - "description": "Control log messages.", - "type": "GROUP", - "settings": [ - { - "key": "log_level", - "env": "GFXRECON_LOG_LEVEL", - "label": "Level", - "description": "Specify the highest level message to log. Options are: debug, info, warning, error, and fatal. The specified level and all levels listed after it will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.", - "type": "ENUM", - "flags": [ - { - "key": "debug", - "label": "debug, info, warning, error, fatal", - "description": "" - }, - { - "key": "info", - "label": "info, warning, error, fatal", - "description": "" - }, - { - "key": "warning", - "label": "warning, error, fatal", - "description": "" - }, - { - "key": "error", - "label": "error, fatal", - "description": "" - }, - { - "key": "fatal", - "label": "fatal", - "description": "" - } - ], - "default": "info" - }, - { - "key": "log_detailed", - "env": "GFXRECON_LOG_DETAILED", - "label": "Log Name and Line Number", - "description": "Include name and line number from the file responsible.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_console", - "env": "GFXRECON_LOG_OUTPUT_TO_CONSOLE", - "label": "Log Output to Console / stdout", - "description": "Log messages will be written to stdout.", - "type": "BOOL", - "default": true - }, - { - "key": "log_break_on_error", - "env": "GFXRECON_LOG_BREAK_ON_ERROR", - "label": "Trigger Debug Break on Error", - "description": "Trigger a debug break when logging an error.", - "type": "BOOL", - "default": false - }, - { - "key": "log_output_to_os_debug_string", - "env": "GFXRECON_LOG_OUTPUT_TO_OS_DEBUG_STRING", - "label": "Log Output to Debug Console", - "description": "Windows only option. Log messages will be written to the Debug Console with OutputDebugStringA", - "platforms": [ "WINDOWS" ], - "type": "BOOL", - "default": false - }, - { - "key": "log_file", - "env": "GFXRECON_LOG_FILE", - "label": "Log File", - "description": "When set, log messages will be written to a file at the specified path. Default is: Empty string (file logging disabled).", - "type": "SAVE_FILE", - "filter": "*.txt", - "default": "", - "settings": [ - { - "key": "log_file_flush_after_write", - "env": "GFXRECON_LOG_FILE_FLUSH_AFTER_WRITE", - "label": "Log File Flush After Write", - "description": "Flush the log file to disk after each write when true.", - "type": "BOOL", - "default": false - }, - { - "key": "log_file_keep_open", - "env": "GFXRECON_LOG_FILE_KEEP_OPEN", - "label": "Log File Keep Open", - "description": "Keep the log file open between log messages when true, or close and reopen the log file for each message when false.", - "type": "BOOL", - "default": true - }, - { - "key": "log_file_create_new", - "env": "GFXRECON_LOG_FILE_CREATE_NEW", - "label": "Log File Overwrite", - "description": "Specifies that log file initialization should overwrite an existing file when true, or append to an existing file when false.", - "type": "BOOL", - "default": true - } - ] - } - ] - } - ] - } - } -} diff --git a/vkconfig_core/layers/162/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/layers/162/VK_LAYER_LUNARG_monitor.json deleted file mode 100644 index 1ae5891915..0000000000 --- a/vkconfig_core/layers/162/VK_LAYER_LUNARG_monitor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "file_format_version": "1.0.0", - "layer": { - "name": "VK_LAYER_LUNARG_monitor", - "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.2.162", - "implementation_version": "1", - "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ] - } -} diff --git a/vkconfig_core/layers/162/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/layers/162/VK_LAYER_LUNARG_screenshot.json deleted file mode 100644 index 0a0c8693b3..0000000000 --- a/vkconfig_core/layers/162/VK_LAYER_LUNARG_screenshot.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_screenshot", - "type": "GLOBAL", - "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.2.162", - "implementation_version": "1", - "description": "LunarG image capture layer", - "introduction": "The screenshot layer records frames to image files.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "settings": [ - { - "key": "frames", - "env": "VK_SCREENSHOT_FRAMES", - "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "" - }, - { - "key": "dir", - "env": "VK_SCREENSHOT_DIR", - "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", - "type": "SAVE_FOLDER", - "default": "" - }, - { - "key": "format", - "env": "VK_SCREENSHOT_FORMAT", - "label": "Format", - "description": "This can be set to a color space for the output.", - "type": "ENUM", - "flags": [ - { - "key": "UNORM", - "label": "UNORM", - "description": "" - }, - { - "key": "SNORM", - "label": "SNORM", - "description": "" - }, - { - "key": "USCALED", - "label": "USCALED", - "description": "" - }, - { - "key": "SSCALED", - "label": "SSCALED", - "description": "" - }, - { - "key": "UINT", - "label": "UINT", - "description": "" - }, - { - "key": "SINT", - "label": "SINT", - "description": "" - }, - { - "key": "SRGB", - "label": "SRGB", - "description": "" - }, - { - "key": "USE_SWAPCHAIN_COLORSPACE", - "label": "USE_SWAPCHAIN_COLORSPACE", - "description": "" - } - ], - "default": "USE_SWAPCHAIN_COLORSPACE" - } - ] - } - } -} diff --git a/vkconfig_core/layers/170/VK_LAYER_KHRONOS_validation.json b/vkconfig_core/layers/170/VK_LAYER_KHRONOS_validation.json deleted file mode 100644 index e789dbd454..0000000000 --- a/vkconfig_core/layers/170/VK_LAYER_KHRONOS_validation.json +++ /dev/null @@ -1,507 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_KHRONOS_validation", - "type": "GLOBAL", - "library_path": ".\\VkLayer_khronos_validation.dll", - "api_version": "1.2.170", - "implementation_version": "1", - "description": "Khronos Validation Layer", - "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "instance_extensions": [ - { - "name": "VK_EXT_debug_report", - "spec_version": "9" - }, - { - "name": "VK_EXT_debug_utils", - "spec_version": "1" - }, - { - "name": "VK_EXT_validation_features", - "spec_version": "2" - } - ], - "device_extensions": [ - { - "name": "VK_EXT_debug_marker", - "spec_version": "4", - "entrypoints": [ - "vkDebugMarkerSetObjectTagEXT", - "vkDebugMarkerSetObjectNameEXT", - "vkCmdDebugMarkerBeginEXT", - "vkCmdDebugMarkerEndEXT", - "vkCmdDebugMarkerInsertEXT" - ] - }, - { - "name": "VK_EXT_validation_cache", - "spec_version": "1", - "entrypoints": [ - "vkCreateValidationCacheEXT", - "vkDestroyValidationCacheEXT", - "vkGetValidationCacheDataEXT", - "vkMergeValidationCachesEXT" - ] - }, - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ "vkGetPhysicalDeviceToolPropertiesEXT" ] - } - ], - "features": { - "presets": [ - { - "label": "Standard", - "description": "Good default validation setup that balance validation coverage and performance.", - "settings": [ - { - "key": "enables", - "value": [] - }, - { - "key": "disables", - "value": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - } - ] - }, - { - "label": "Reduced-Overhead", - "description": "Disables some checks in the interest of better performance.", - "settings": [ - { - "key": "enables", - "value": [ - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION" - ] - } - ] - }, - { - "label": "Best Practices", - "description": "Provides warnings about potential API misuse but valid usages of the API.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Synchronization", - "description": "Identify resource access conflicts due to missing or incorrect synchronization operations between actions reading or writing the same regions of memory.", - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - } - ] - }, - { - "label": "Shader Printf", - "description": "Debug shader code by \"printing\" any values of interest to the debug callback or stdout.", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "enables", - "value": [ - "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" - ] - }, - { - "key": "disables", - "value": [ - "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT" - ] - }, - { - "key": "enable_message_limit", - "value": false - } - ] - } - ], - "settings": [ - { - "key": "debug_action", - "label": "Debug Action", - "description": "This indicates what action is to be taken when a layer wants to report information", - "type": "FLAGS", - "flags": [ - { - "key": "VK_DBG_LAYER_ACTION_LOG_MSG", - "label": "Log Message", - "description": "Log a txt message to stdout or to a log filename.", - "settings": [ - { - "key": "log_filename", - "label": "Log Filename", - "description": "Specifies the output filename", - "type": "SAVE_FILE", - "default": "stdout", - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "debug_action", - "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - } - ] - } - } - ] - }, - { - "key": "VK_DBG_LAYER_ACTION_CALLBACK", - "label": "Callback", - "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", - "view": "HIDDEN" - }, - { - "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", - "label": "Debug Output", - "description": "Log a txt message using the Windows OutputDebugString function.", - "platforms": [ "WINDOWS" ] - }, - { - "key": "VK_DBG_LAYER_ACTION_BREAK", - "label": "Break", - "description": "Trigger a breakpoint if a debugger is in use." - } - ], - "default": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] - }, - { - "key": "report_flags", - "label": "Message Severity", - "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", - "type": "FLAGS", - "flags": [ - { - "key": "info", - "label": "Info", - "description": "Report informational messages." - }, - { - "key": "warn", - "label": "Warning", - "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." - }, - { - "key": "perf", - "label": "performance", - "description": "Report using the API in a way that may cause suboptimal performance." - }, - { - "key": "error", - "label": "Error", - "description": "Report errors in API usage." - }, - { - "key": "debug", - "label": "Debug", - "description": "For layer development. Report messages for debugging layer behavior.", - "view": "ADVANCED" - } - ], - "default": [ - "error", - "warn", - "perf" - ] - }, - { - "key": "enable_message_limit", - "label": "Limit Duplicated Messages", - "description": "Enable limitation of duplicate messages.", - "type": "BOOL", - "default": true, - "settings": [ - { - "key": "duplicate_message_limit", - "env": "VK_LAYER_DUPLICATE_MESSAGE_LIMIT", - "label": "Max Duplicated Messages", - "description": "Maximum number of times any single validation message would be reported.", - "type": "INT", - "default": 10, - "range": { - "min": 1 - }, - "dependence": { - "mode": "ALL", - "settings": [ - { - "key": "enable_message_limit", - "value": true - } - ] - } - } - ] - }, - { - "key": "message_id_filter", - "env": "VK_LAYER_MESSAGE_ID_FILTER", - "label": "Mute Message VUIDs", - "description": "List of VUIDs and VUID identifers which are to be IGNORED by the validation layer", - "type": "LIST", - "default": [] - }, - { - "key": "disables", - "env": "VK_LAYER_DISABLES", - "label": "Disables", - "description": "Setting an option here will disable areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", - "label": "Thread Safety", - "description": "Thread checks. It may help with performance to run with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check, or when debugging difficult application behaviors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", - "label": "Stateless Parameter", - "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", - "label": "Object Lifetime", - "description": "Object tracking checks. This may not always be necessary late in a development cycle." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", - "label": "Core", - "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", - "label": "Handle Wrapping", - "description": "Handle wrapping checks. Disable this feature if you are running into crashes when authoring new extensions or developing new Vulkan objects/structures" - }, - { - "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", - "label": "Shaders", - "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", - "label": "Command Buffer State", - "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", - "label": "Image Layout", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", - "label": "Query", - "description": "Checks for commands that use VkQueryPool objects.", - "view": "ADVANCED" - }, - { - "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", - "label": "Object in Use", - "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", - "view": "ADVANCED" - } - ], - "default": [ "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" ] - }, - { - "key": "enables", - "env": "VK_LAYER_ENABLES", - "label": "Enables", - "description": "Setting an option here will enable specialized areas of validation", - "type": "FLAGS", - "flags": [ - { - "key": "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT", - "label": "Synchronization", - "description": "This feature reports resource access conflicts due to missing or incorrect synchronization operations between actions (Draw, Copy, Dispatch, Blit) reading or writing the same regions of memory.", - "url": "${LUNARG_SDK}/synchronization_usage.html" - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT", - "label": "Debug Printf", - "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback", - "url": "${LUNARG_SDK}/debug_printf.html", - "status": "STABLE", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "printf_to_stdout", - "label": "Printf to stdout", - "description": "To redirect Debug Printf messages from the debug callback to stdout", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" ] - } - ] - } - }, - { - "key": "printf_verbose", - "label": "Verbose", - "description": "Verbosity of debug printf messages", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "BOOL", - "default": false, - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" ] - } - ] - } - }, - { - "key": "printf_buffer_size", - "label": "Printf buffer size", - "description": "The size in bytes of the buffer used by debug printf", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "INT", - "default": 1024, - "range": { - "min": 128, - "max": 1048576 - }, - "unit": "bytes", - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT" ] - } - ] - } - } - ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", - "label": "GPU-Assisted", - "description": "Check for API usage errors at shader execution time", - "url": "${LUNARG_SDK}/gpu_validation.html", - "platforms": [ "WINDOWS", "LINUX" ], - "settings": [ - { - "key": "gpuav_buffer_oob", - "label": "Check Out of Bounds ", - "description": "Enable buffer out of bounds checking", - "platforms": [ "WINDOWS", "LINUX" ], - "type": "BOOL", - "default": true, - "dependence": { - "mode": "ANY", - "settings": [ - { - "key": "enables", - "value": [ "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT" ] - } - ] - } - } - ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", - "label": "Reserve Descriptor Set Binding Slot", - "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", - "platforms": [ "WINDOWS", "LINUX" ] - }, - { - "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", - "label": "Best Practices", - "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", - "url": "${LUNARG_SDK}/best_practices.html" - }, - { - "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM", - "label": "ARM-specific best practices", - "description": "Activating this feature enables the output of warnings related to ARM-specific misuse of the API, but which are not explicitly prohibited by the specification." - } - ], - "default": [] - } - ] - } - } -} diff --git a/vkconfig_core/layers/170/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/layers/170/VK_LAYER_LUNARG_screenshot.json deleted file mode 100644 index 7188012c08..0000000000 --- a/vkconfig_core/layers/170/VK_LAYER_LUNARG_screenshot.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "file_format_version": "1.2.0", - "layer": { - "name": "VK_LAYER_LUNARG_screenshot", - "type": "GLOBAL", - "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.2.170", - "implementation_version": "1", - "description": "LunarG image capture layer", - "introduction": "The screenshot layer records frames to image files.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], - "device_extensions": [ - { - "name": "VK_EXT_tooling_info", - "spec_version": "1", - "entrypoints": [ - "vkGetPhysicalDeviceToolPropertiesEXT" - ] - } - ], - "features": { - "settings": [ - { - "key": "frames", - "env": "VK_SCREENSHOT_FRAMES", - "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", - "type": "STRING", - "default": "" - }, - { - "key": "dir", - "env": "VK_SCREENSHOT_DIR", - "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", - "type": "SAVE_FOLDER", - "default": "" - }, - { - "key": "format", - "env": "VK_SCREENSHOT_FORMAT", - "label": "Format", - "description": "This can be set to a color space for the output.", - "type": "ENUM", - "flags": [ - { - "key": "UNORM", - "label": "UNORM", - "description": "" - }, - { - "key": "SNORM", - "label": "SNORM", - "description": "" - }, - { - "key": "USCALED", - "label": "USCALED", - "description": "" - }, - { - "key": "SSCALED", - "label": "SSCALED", - "description": "" - }, - { - "key": "UINT", - "label": "UINT", - "description": "" - }, - { - "key": "SINT", - "label": "SINT", - "description": "" - }, - { - "key": "SRGB", - "label": "SRGB", - "description": "" - }, - { - "key": "USE_SWAPCHAIN_COLORSPACE", - "label": "USE_SWAPCHAIN_COLORSPACE", - "description": "" - } - ], - "default": "USE_SWAPCHAIN_COLORSPACE" - } - ] - } - } -} diff --git a/vkconfig_core/override.cpp b/vkconfig_core/override.cpp deleted file mode 100644 index c1c2ebe23b..0000000000 --- a/vkconfig_core/override.cpp +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "override.h" -#include "util.h" -#include "platform.h" -#include "registry.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -// Create and write VkLayer_override.json file -bool WriteLayersOverride(const Environment& environment, const std::vector& available_layers, - const Configuration& configuration, const std::string& layers_path) { - assert(!layers_path.empty()); - assert(QFileInfo(layers_path.c_str()).absoluteDir().exists()); - - const QStringList& path_gui = ConvertString(environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_GUI)); - const QStringList& path_env_set = ConvertString(environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_SET)); - const QStringList& path_env_add = ConvertString(environment.GetUserDefinedLayersPaths(USER_DEFINED_LAYERS_PATHS_ENV_ADD)); - - QStringList layer_system_paths; - QStringList layer_override_paths = path_gui; - - for (std::size_t i = 0, n = configuration.parameters.size(); i < n; ++i) { - const Parameter& parameter = configuration.parameters[i]; - if (!(parameter.platform_flags & (1 << VKC_PLATFORM))) { - continue; - } - - if (parameter.state != LAYER_STATE_OVERRIDDEN) { - continue; - } - - const Layer* layer = FindByKey(available_layers, parameter.key.c_str()); - if (layer == nullptr) { - continue; - } - - // Extract just the path - assert(!layer->manifest_path.empty()); - const QFileInfo file(layer->manifest_path.c_str()); - const std::string absolute_path(file.absolutePath().toStdString().c_str()); - - if (!path_gui.contains(ConvertNativeSeparators(absolute_path.c_str()).c_str()) && - !path_env_set.contains(ConvertNativeSeparators(absolute_path.c_str()).c_str()) && - !path_env_add.contains(ConvertNativeSeparators(absolute_path.c_str()).c_str())) { - // Make sure the path is not already in the system path list - if (layer_system_paths.contains(absolute_path.c_str())) { - continue; - } - - layer_system_paths << absolute_path.c_str(); - } else { - // Make sure the path is not already in the override path list - if (layer_override_paths.contains(ConvertNativeSeparators(absolute_path.c_str()).c_str())) { - continue; - } - - // Okay, add to the list - layer_override_paths << absolute_path.c_str(); - } - } - - const Version version = ComputeMinApiVersion(environment.api_version, configuration.parameters, available_layers); - - QJsonArray json_paths; - - // First add override paths so that they take precedent over system paths - for (int i = 0, n = layer_override_paths.count(); i < n; ++i) { - const std::string& path = ConvertNativeSeparators(layer_override_paths[i].toStdString()); - json_paths.append(path.c_str()); - } - - // Second add system paths, so that a layers configuration can run with both system and user-defined layers - for (int i = 0, n = layer_system_paths.count(); i < n; ++i) { - const std::string& path = ConvertNativeSeparators(layer_system_paths[i].toStdString()); - json_paths.append(path.c_str()); - } - - QJsonArray json_overridden_layers; - QJsonArray json_excluded_layers; - if (environment.GetMode() == LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED) { - for (std::size_t i = 0, n = available_layers.size(); i < n; ++i) { - json_excluded_layers.append(available_layers[i].key.c_str()); - } - } else { - for (std::size_t i = 0, n = configuration.parameters.size(); i < n; ++i) { - const Parameter& parameter = configuration.parameters[i]; - if (!(parameter.platform_flags & (1 << VKC_PLATFORM))) { - continue; - } - - if (parameter.state == LAYER_STATE_OVERRIDDEN) - json_overridden_layers.append(parameter.key.c_str()); - else if (parameter.state == LAYER_STATE_EXCLUDED) - json_excluded_layers.append(parameter.key.c_str()); - } - } - - QJsonObject disable; - disable.insert("DISABLE_VK_LAYER_LUNARG_override", "1"); - - QJsonObject layer; - layer.insert("name", "VK_LAYER_LUNARG_override"); - layer.insert("type", "GLOBAL"); - layer.insert("api_version", version.str().c_str()); - layer.insert("implementation_version", "1"); - layer.insert("description", "LunarG Override Layer"); - layer.insert("override_paths", json_paths); - layer.insert("component_layers", json_overridden_layers); - layer.insert("blacklisted_layers", json_excluded_layers); - layer.insert("disable_environment", disable); - - // This has to contain something, or it will apply globally! - if (environment.GetUseApplicationList() && environment.HasOverriddenApplications()) { - const std::vector& applications = environment.GetApplications(); - - QJsonArray json_applist; - for (std::size_t i = 0, n = applications.size(); i < n; ++i) { - if (applications[i].layers_mode == LAYERS_MODE_BY_APPLICATIONS) continue; - - const std::string& executable_path = - ConvertNativeSeparators(ReplaceBuiltInVariable(applications[i].executable_path.c_str())); - - const std::string& absolute_path( - ConvertNativeSeparators(QFileInfo(executable_path.c_str()).absoluteFilePath().toStdString())); - assert(QFileInfo(absolute_path.c_str()).exists()); - json_applist.append(absolute_path.c_str()); - } - - layer.insert("app_keys", json_applist); - } - - QJsonObject root; - root.insert("file_format_version", "1.1.2"); - root.insert("layer", layer); - QJsonDocument doc(root); - - QFile json_file(layers_path.c_str()); - const bool result_layers_file = json_file.open(QIODevice::WriteOnly | QIODevice::Text); - assert(result_layers_file); - json_file.write(doc.toJson()); - json_file.close(); - - return result_layers_file; -} - -const char* GetString(LayerControl control) { - static const char* table[] = {"on", "off", "auto", "application_enabled_layers", "unordered_layer_location"}; - - return table[control]; -} - -struct LayerSettings { - std::string name; - std::string path; - LayerControl control; - bool implicit; -}; - -enum LogType { - LOG_ERROR = 0, - LOG_WARN, - LOG_INFO, - LOG_DEBUG, - - LOG_FIRST = LOG_ERROR, - LOG_LAST = LOG_DEBUG, -}; - -enum { LOG_COUNT = LOG_LAST - LOG_FIRST + 1 }; - -enum LogFlag { - LOG_ERROR_BIT = 1 << LOG_ERROR, - LOG_WARN_BIT = 1 << LOG_WARN, - LOG_INFO_BIT = 1 << LOG_INFO, - LOG_DEBUG_BIT = 1 << LOG_DEBUG, - - LOG_DEBUG_ALL = LOG_ERROR_BIT | LOG_WARN_BIT | LOG_INFO_BIT | LOG_DEBUG_BIT -}; - -struct LoaderSettings { - std::string executable_path; - std::vector layers; - int stderr_log_flags; -}; - -static std::vector GetStderrLogStrings(int stderr_log_flags) { - static const char* table[] = {"error", "warn", "info", "debug"}; - static_assert(countof(table) == LOG_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - std::vector result; - - for (int i = LOG_FIRST, n = LOG_COUNT; i < n; ++i) { - if (stderr_log_flags & (1 << i)) { - result.push_back(table[i]); - } - } - - return result; -} - -static QJsonObject CreateJsonSettingObject(const LoaderSettings& loader_settings) { - QJsonArray json_app_keys; - json_app_keys.append(loader_settings.executable_path.c_str()); - - QJsonArray json_layers; - for (std::size_t j = 0, o = loader_settings.layers.size(); j < o; ++j) { - const LayerSettings& layer = loader_settings.layers[j]; - - QJsonObject json_layer; - json_layer.insert("name", layer.name.c_str()); - json_layer.insert("path", layer.path.c_str()); - json_layer.insert("control", GetString(layer.control)); - json_layer.insert("treat_as_implicit_manifest", layer.implicit); - json_layers.append(json_layer); - } - - QJsonArray json_stderr_log; - const std::vector& stderr_log = GetStderrLogStrings(loader_settings.stderr_log_flags); - for (std::size_t i = 0, n = stderr_log.size(); i < n; ++i) { - json_stderr_log.append(stderr_log[i].c_str()); - } - - QJsonObject json_settings; - json_settings.insert("app_keys", json_app_keys); - json_settings.insert("layers", json_layers); - json_settings.insert("stderr_log", json_stderr_log); - return json_settings; -} - -// Create and write vk_loader_settings.json file -bool WriteLoaderSettings(const Environment& environment, const std::vector& available_layers, - const Configuration& configuration, const std::string& layers_path) { - assert(!layers_path.empty()); - assert(QFileInfo(layers_path.c_str()).absoluteDir().exists()); - - std::vector loader_settings_array; - - if (environment.GetPerApplicationConfig()) { - for (std::size_t i = 0, n = environment.GetApplications().size(); i < n; ++i) { - LoaderSettings loader_settings; - - const Application& application = environment.GetApplication(i); - - switch (application.layers_mode) { - case LAYERS_MODE_BY_APPLICATIONS: { - } break; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: { - } break; - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: { - } break; - } - - loader_settings_array.push_back(loader_settings); - } - } else { - const std::string& selected_configuration = environment.GetSelectedConfiguration(); - - LoaderSettings loader_settings; - loader_settings.stderr_log_flags = 0; - - if (environment.GetMode() != LAYERS_MODE_BY_APPLICATIONS) { - for (std::size_t i = 0, n = configuration.parameters.size(); i < n; ++i) { - LayerSettings layer_settings; - - const Parameter& parameter = configuration.parameters[i]; - if (!(parameter.platform_flags & (1 << VKC_PLATFORM))) { - continue; - } - - if (parameter.state != LAYER_STATE_OVERRIDDEN) { - continue; - } - - const Layer* layer = FindByKey(available_layers, parameter.key.c_str()); - if (layer == nullptr) { - continue; - } - - // Extract just the path - assert(!layer->manifest_path.empty()); - layer_settings.name = layer->key; - layer_settings.path = QFileInfo(layer->manifest_path.c_str()).absolutePath().toStdString(); - layer_settings.control = LAYER_CONTROL_AUTO; // TODO - layer_settings.implicit = layer->type == LAYER_TYPE_IMPLICIT; - - loader_settings.layers.push_back(layer_settings); - } - } - - loader_settings_array.push_back(loader_settings); - } - - QJsonObject root; - root.insert("file_format_version", "1.0.0"); - if (loader_settings_array.size() > 1) { - QJsonArray json_settings_array; - for (std::size_t i = 0, n = loader_settings_array.size(); i < n; ++i) { - json_settings_array.append(CreateJsonSettingObject(loader_settings_array[i])); - } - root.insert("settings_array", json_settings_array); - } else { - root.insert("settings", CreateJsonSettingObject(loader_settings_array[0])); - } - QJsonDocument doc(root); - - QFile json_file(layers_path.c_str()); - const bool result_layers_file = json_file.open(QIODevice::WriteOnly | QIODevice::Text); - assert(result_layers_file); - json_file.write(doc.toJson()); - json_file.close(); - - return result_layers_file; -} - -// Create and write vk_layer_settings.txt file -bool WriteLayersSettings(const std::vector& available_layers, const Configuration& configuration, - const std::string& settings_path) { - if (settings_path.empty() || !QFileInfo(settings_path.c_str()).absoluteDir().exists()) { - fprintf(stderr, "Cannot open file %s\n", settings_path.c_str()); - exit(1); - }; - QFile file(settings_path.c_str()); - const bool result_settings_file = file.open(QIODevice::WriteOnly | QIODevice::Text); - if (!result_settings_file) { - fprintf(stderr, "Cannot open file %s\n", settings_path.c_str()); - exit(1); - } - QTextStream stream(&file); - - bool has_missing_layers = false; - - // Loop through all the layers - for (std::size_t j = 0, n = configuration.parameters.size(); j < n; ++j) { - const Parameter& parameter = configuration.parameters[j]; - if (!(parameter.platform_flags & (1 << VKC_PLATFORM))) { - continue; - } - - const Layer* layer = FindByKey(available_layers, parameter.key.c_str()); - if (layer == nullptr) { - has_missing_layers = true; - continue; - } - - if (parameter.state != LAYER_STATE_OVERRIDDEN) continue; - - const bool use_builtin_validation = UseBuiltinValidationSettings(parameter); - - stream << "\n"; - stream << "# " << layer->key.c_str() << "\n\n"; - - std::string lc_layer_name = GetLayerSettingPrefix(layer->key); - - for (std::size_t i = 0, m = parameter.settings.size(); i < m; ++i) { - const SettingData* setting_data = parameter.settings[i]; - - // Skip groups - they aren't settings, so not relevant in this output - if (setting_data->type == SETTING_GROUP) { - continue; - } - - if (!use_builtin_validation) { - if (setting_data->key == "enables") { - continue; - } - - if (setting_data->key == "disables") { - continue; - } - } - - // Skip missing settings - const SettingMeta* meta = FindSetting(layer->settings, setting_data->key.c_str()); - if (meta == nullptr) { - continue; - } - - // Skip overriden settings - if (::CheckSettingOverridden(*meta)) { - continue; - } - - stream << "# "; - stream << meta->label.c_str(); - stream << "\n# =====================\n# ."; - stream << meta->key.c_str() << "\n"; - - // Break up description into smaller words - std::string description = meta->description; - std::vector words; - std::size_t pos; - while ((pos = description.find(" ")) != std::string::npos) { - words.push_back(description.substr(0, pos)); - description.erase(0, pos + 1); - } - if (description.size() > 0) words.push_back(description); - if (words.size() > 0) { - stream << "#"; - std::size_t nchars = 2; - for (auto word : words) { - if (word.size() + nchars > 80) { - stream << "\n#"; - nchars = 2; - } - stream << " " << word.c_str(); - nchars += (word.size() + 1); - } - } - stream << "\n"; - - // If feature has unmet dependency, output it but comment it out - if (::CheckDependence(*meta, parameter.settings) != SETTING_DEPENDENCE_ENABLE) { - stream << "#"; - } - - stream << lc_layer_name.c_str() << setting_data->key.c_str() << " = "; - stream << setting_data->Export(EXPORT_MODE_OVERRIDE).c_str(); - stream << "\n\n"; - } - } - file.close(); - - return result_settings_file && !has_missing_layers; -} - -bool OverrideConfiguration(const Environment& environment, const std::vector& available_layers, - const Configuration& configuration) { - const std::string layers_path = GetPath(BUILTIN_PATH_OVERRIDE_LAYERS); - const std::string settings_path = GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - - // Clean up - SurrenderConfiguration(environment); - - // VkLayer_override.json - const bool result_layers = WriteLayersOverride(environment, available_layers, configuration, layers_path); - - // vk_layer_settings.txt - const bool result_settings = WriteLayersSettings(available_layers, configuration, settings_path); - - // On Windows only, we need to write these values to the registry -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS - AppendRegistryEntriesForLayers(layers_path.c_str(), settings_path.c_str()); -#endif - - return result_settings && result_layers; -} - -bool EraseLayersOverride(const std::string& layers_path) { return std::remove(layers_path.c_str()) == 0; } - -bool EraseSettingsOverride(const std::string& settings_path) { return std::remove(settings_path.c_str()) == 0; } - -bool SurrenderConfiguration(const Environment& environment) { - (void)environment; - - const std::string layers_path = GetPath(BUILTIN_PATH_OVERRIDE_LAYERS); - const std::string settings_path = GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - - const bool result_layers = EraseLayersOverride(layers_path); - const bool result_settings = EraseSettingsOverride(settings_path); - -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS - RemoveRegistryEntriesForLayers(layers_path.c_str(), settings_path.c_str()); -#endif - - return result_layers && result_settings; -} - -bool HasOverride() { - const std::string layers_path = GetPath(BUILTIN_PATH_OVERRIDE_LAYERS); - const std::string settings_path = GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - - const QFileInfo override_settings_file_info(layers_path.c_str()); - const QFileInfo override_layers_file_info(settings_path.c_str()); - - return override_settings_file_info.exists() || override_layers_file_info.exists(); -} diff --git a/vkconfig_core/override.h b/vkconfig_core/override.h deleted file mode 100644 index 739a11d6c2..0000000000 --- a/vkconfig_core/override.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "configuration.h" -#include "environment.h" -#include "application.h" - -// Create the VkLayer_override.json and vk_layer_settings.txt files to take over Vulkan layers from Vulkan applications -bool OverrideConfiguration(const Environment& environment, const std::vector& available_layers, - const Configuration& configuration); - -// Remove the VkLayer_override.json and vk_layer_settings.txt files to return full control of the layers to the Vulkan applications -bool SurrenderConfiguration(const Environment& environment); - -// Check whether a layers configuration is activated -bool HasOverride(); - -// Write the settings file -bool WriteLayersSettings(const std::vector& available_layers, const Configuration& configuration, - const std::string& settings_path); diff --git a/vkconfig_core/parameter.cpp b/vkconfig_core/parameter.cpp index 23a9304338..98387b5268 100644 --- a/vkconfig_core/parameter.cpp +++ b/vkconfig_core/parameter.cpp @@ -20,7 +20,7 @@ #include "setting_filesystem.h" #include "parameter.h" -#include "platform.h" +#include "type_platform.h" #include "version.h" #include "util.h" #include "path.h" @@ -56,15 +56,15 @@ ParameterRank GetParameterOrdering(const std::vector& available_layers, c const Layer* layer = FindByKey(available_layers, parameter.key.c_str()); if (layer == nullptr) { return PARAMETER_RANK_MISSING; - } else if (parameter.state == LAYER_STATE_EXCLUDED) { + } else if (parameter.control == LAYER_CONTROL_OFF) { return PARAMETER_RANK_EXCLUDED; - } else if (parameter.state == LAYER_STATE_APPLICATION_CONTROLLED && layer->type == LAYER_TYPE_IMPLICIT) { + } else if (parameter.control == LAYER_CONTROL_AUTO && layer->type == LAYER_TYPE_IMPLICIT) { return PARAMETER_RANK_IMPLICIT_AVAILABLE; - } else if (parameter.state == LAYER_STATE_OVERRIDDEN && layer->type == LAYER_TYPE_IMPLICIT) { + } else if (parameter.control == LAYER_CONTROL_ON && layer->type == LAYER_TYPE_IMPLICIT) { return PARAMETER_RANK_IMPLICIT_OVERRIDDEN; - } else if (parameter.state == LAYER_STATE_OVERRIDDEN && layer->type != LAYER_TYPE_IMPLICIT) { + } else if (parameter.control == LAYER_CONTROL_ON && layer->type != LAYER_TYPE_IMPLICIT) { return PARAMETER_RANK_EXPLICIT_OVERRIDDEN; - } else if (parameter.state == LAYER_STATE_APPLICATION_CONTROLLED && layer->type != LAYER_TYPE_IMPLICIT) { + } else if (parameter.control == LAYER_CONTROL_AUTO && layer->type != LAYER_TYPE_IMPLICIT) { return PARAMETER_RANK_EXPLICIT_AVAILABLE; } else { assert(0); // Unknown ordering @@ -100,7 +100,7 @@ void OrderParameter(std::vector& parameters, const std::vector bool operator()(const Parameter& a, const Parameter& b) const { const ParameterRank rankA = GetParameterOrdering(layers, a); const ParameterRank rankB = GetParameterOrdering(layers, b); - if (rankA == rankB && a.state == LAYER_STATE_OVERRIDDEN) { + if (rankA == rankB && a.control == LAYER_CONTROL_ON) { if (a.overridden_rank != Parameter::NO_RANK && b.overridden_rank != Parameter::NO_RANK) return a.overridden_rank < b.overridden_rank; else if (a.key == VK_LAYER_KHRONOS_PROFILES_NAME) @@ -113,7 +113,7 @@ void OrderParameter(std::vector& parameters, const std::vector return false; else return a.key < b.key; - } else if (rankA == rankB && a.state != LAYER_STATE_OVERRIDDEN) + } else if (rankA == rankB && a.control != LAYER_CONTROL_ON) return a.key < b.key; else return rankA < rankB; @@ -125,18 +125,20 @@ void OrderParameter(std::vector& parameters, const std::vector std::sort(parameters.begin(), parameters.end(), ParameterCompare(layers)); for (std::size_t i = 0, n = parameters.size(); i < n; ++i) { - if (parameters[i].state == LAYER_STATE_OVERRIDDEN) + if (parameters[i].control == LAYER_CONTROL_ON) parameters[i].overridden_rank = static_cast(i); else parameters[i].overridden_rank = Parameter::NO_RANK; } } -void FilterParameters(std::vector& parameters, const LayerState state) { +void FilterParameters(std::vector& parameters, const LayerControl control) { std::vector filtered_parameters; for (std::size_t i = 0, n = parameters.size(); i < n; ++i) { - if (parameters[i].state == state) continue; + if (parameters[i].control == control) { + continue; + } filtered_parameters.push_back(parameters[i]); } @@ -146,7 +148,7 @@ void FilterParameters(std::vector& parameters, const LayerState state bool HasMissingLayer(const std::vector& parameters, const std::vector& layers, std::string& missing_layer) { for (auto it = parameters.begin(), end = parameters.end(); it != end; ++it) { - if (it->state == LAYER_STATE_EXCLUDED) { + if (it->control == LAYER_CONTROL_OFF) { continue; // If excluded are missing, it doesn't matter } @@ -167,9 +169,13 @@ std::size_t CountOverriddenLayers(const std::vector& parameters) { for (std::size_t i = 0, n = parameters.size(); i < n; ++i) { const Parameter& parameter = parameters[i]; - if (!IsPlatformSupported(parameter.platform_flags)) continue; + if (!IsPlatformSupported(parameter.platform_flags)) { + continue; + } - if (parameter.state != LAYER_STATE_OVERRIDDEN) continue; + if (parameter.control != LAYER_CONTROL_ON) { + continue; + } ++count; } @@ -182,12 +188,18 @@ std::size_t CountExcludedLayers(const std::vector& parameters, const for (std::size_t i = 0, n = parameters.size(); i < n; ++i) { const Parameter& parameter = parameters[i]; - if (!IsPlatformSupported(parameter.platform_flags)) continue; + if (!IsPlatformSupported(parameter.platform_flags)) { + continue; + } - if (parameter.state != LAYER_STATE_EXCLUDED) continue; + if (parameter.control != LAYER_CONTROL_OFF) { + continue; + } const Layer* layer = FindByKey(layers, parameter.key.c_str()); - if (layer == nullptr) continue; // Do not display missing excluded layers + if (layer == nullptr) { + continue; // Do not display missing excluded layers + } ++count; } @@ -197,13 +209,13 @@ std::size_t CountExcludedLayers(const std::vector& parameters, const std::vector GatherParameters(const std::vector& parameters, const std::vector& available_layers) { std::vector gathered_parameters; - /* - Parameter application_enabled_layers; - application_enabled_layers.key = "Application Enabled Layers"; - application_enabled_layers.control = LAYER_CONTROL_APPLICATIONS; - application_enabled_layers.overridden_rank = Parameter::NO_RANK; - gathered_parameters.push_back(application_enabled_layers); - */ + + Parameter application_enabled_layers; + application_enabled_layers.key = "Application Enabled Layers"; + application_enabled_layers.control = LAYER_CONTROL_APPLICATIONS; + application_enabled_layers.overridden_rank = Parameter::NO_RANK; + gathered_parameters.push_back(application_enabled_layers); + // Loop through the layers. They are expected to be in order for (std::size_t i = 0, n = parameters.size(); i < n; ++i) { const Parameter& parameter = parameters[i]; @@ -220,7 +232,7 @@ std::vector GatherParameters(const std::vector& parameters Parameter parameter; parameter.key = layer.key; - parameter.state = LAYER_STATE_APPLICATION_CONTROLLED; + parameter.control = LAYER_CONTROL_AUTO; parameter.api_version = layer.api_version; CollectDefaultSettingData(layer.settings, parameter.settings); @@ -228,27 +240,12 @@ std::vector GatherParameters(const std::vector& parameters } OrderParameter(gathered_parameters, available_layers); - /* - Parameter unordered_layer_location; - unordered_layer_location.key = "Unordered Layers"; - unordered_layer_location.control = LAYER_CONTROL_UNORDERED; - unordered_layer_location.overridden_rank = 999; - gathered_parameters.push_back(unordered_layer_location); - */ - return gathered_parameters; -} - -bool UseBuiltinValidationSettings(const Parameter& parameter) { - if (parameter.key != "VK_LAYER_KHRONOS_validation") { - return false; - } - for (std::size_t j = 0, m = parameter.settings.size(); j < m; ++j) { - const SettingData* setting_data = parameter.settings[j]; - if (setting_data->key == "validation_control") { - return false; - } - } + Parameter unordered_layer_location; + unordered_layer_location.key = "Unordered Layers"; + unordered_layer_location.control = LAYER_CONTROL_UNORDERED; + unordered_layer_location.overridden_rank = 999; + gathered_parameters.push_back(unordered_layer_location); - return true; + return gathered_parameters; } diff --git a/vkconfig_core/parameter.h b/vkconfig_core/parameter.h index beed5f3c6a..b8e3f5fbfa 100644 --- a/vkconfig_core/parameter.h +++ b/vkconfig_core/parameter.h @@ -21,8 +21,8 @@ #pragma once #include "layer.h" -#include "layer_state.h" #include "setting.h" +#include "type_layer_control.h" #include @@ -35,35 +35,19 @@ enum ParameterRank { PARAMETER_RANK_EXPLICIT_AVAILABLE }; -enum LayerControl { - LAYER_CONTROL_OFF = 0, - LAYER_CONTROL_ON, - LAYER_CONTROL_AUTO, - LAYER_CONTROL_APPLICATIONS, - LAYER_CONTROL_UNORDERED, - - LAYER_CONTROL_FIRST = LAYER_CONTROL_OFF, - LAYER_CONTROL_LAST = LAYER_CONTROL_UNORDERED -}; - -enum { LAYER_CONTROL_COUNT = LAYER_CONTROL_LAST - LAYER_CONTROL_FIRST + 1 }; - struct Parameter { static const int NO_RANK = -1; - Parameter() : state(LAYER_STATE_APPLICATION_CONTROLLED), platform_flags(PLATFORM_DESKTOP_BIT), overridden_rank(NO_RANK) { - assert(true); - } + Parameter() : control(LAYER_CONTROL_AUTO), platform_flags(PLATFORM_DESKTOP_BIT), overridden_rank(NO_RANK) { assert(true); } - Parameter(const std::string& key, const LayerState state) - : key(key), state(state), control(LAYER_CONTROL_AUTO), platform_flags(PLATFORM_DESKTOP_BIT), overridden_rank(NO_RANK) { + Parameter(const std::string& key, const LayerControl control) + : key(key), control(LAYER_CONTROL_AUTO), platform_flags(PLATFORM_DESKTOP_BIT), overridden_rank(NO_RANK) { assert(true); } bool ApplyPresetSettings(const LayerPreset& preset); std::string key; - LayerState state; LayerControl control; int platform_flags; SettingDataSet settings; @@ -74,12 +58,10 @@ struct Parameter { ParameterRank GetParameterOrdering(const std::vector& available_layers, const Parameter& parameter); Version ComputeMinApiVersion(const Version api_version, const std::vector& parameters, const std::vector& layers); void OrderParameter(std::vector& parameters, const std::vector& layers); -void FilterParameters(std::vector& parameters, const LayerState state); +void FilterParameters(std::vector& parameters, const LayerControl control); std::vector GatherParameters(const std::vector& parameters, const std::vector& available_layers); bool HasMissingLayer(const std::vector& parameters, const std::vector& layers, std::string& missing_layer); std::size_t CountOverriddenLayers(const std::vector& parameters); std::size_t CountExcludedLayers(const std::vector& parameters, const std::vector& layers); - -bool UseBuiltinValidationSettings(const Parameter& parameter); diff --git a/vkconfig_core/path.cpp b/vkconfig_core/path.cpp index a7649def4f..140dd7ff76 100644 --- a/vkconfig_core/path.cpp +++ b/vkconfig_core/path.cpp @@ -22,281 +22,386 @@ #include "json.h" #include "alert.h" #include "path.h" -#include "path_manager.h" -#include "platform.h" +#include "type_platform.h" #include +#include #include #include #include -std::string vkconfig_version = "vkconfig"; +static const std::string VKCONFIG_VERSION("vkconfig"); -Path::Path() {} +struct BuiltinDesc { + const char* key; + const Path::Builtin path; +}; -Path::Path(const char* path) : data(ConvertNativeSeparators(path)) {} +static const BuiltinDesc VARIABLES[] = {{"${VK_HOME}", Path::HOME}, + {"${VK_APPDATA}", Path::APPDATA}, + {"${VULKAN_SDK}", Path::SDK}, + {"${VULKAN_CONTENT}", Path::CONTENT}}; -Path::Path(const std::string& path) : data(ConvertNativeSeparators(path)) {} +static std::string ConvertSeparators(const std::string& path, const char* native_separator, const char* alien_separator) { + const std::size_t native_separator_size = std::strlen(native_separator); + const std::size_t alien_separator_size = std::strlen(alien_separator); -Path& Path::operator=(const std::string& path) { - data = ConvertNativeSeparators(path); - return *this; -} + std::string current_path = path; + while (current_path.find_first_of(alien_separator) < current_path.size()) { + const std::size_t found = current_path.find_first_of(alien_separator); + const std::size_t size = current_path.size(); -const char* Path::c_str() const { - assert(ConvertNativeSeparators(data) == data); + if (found < size - alien_separator_size) + current_path = current_path.substr(0, found) + native_separator + + current_path.substr(found + alien_separator_size, size - found - alien_separator_size); + else + current_path = current_path.substr(0, found); + } + + // Remove trailing native separator + const std::size_t found = current_path.find_last_of(native_separator); + const std::size_t size = current_path.size(); + if (found == size - native_separator_size) { + current_path = current_path.substr(0, found); + } - return data.c_str(); + return current_path; } -void CheckPathsExist(const std::string& path, bool is_full_path) { - QString tmp_path(ConvertNativeSeparators(path).c_str()); +static const char* GetNativeSeparator() { + static const char* native_separator = VKC_ENV == VKC_ENV_WIN32 ? "\\" : "/"; + return native_separator; +} - if (is_full_path) { - QFileInfo file_info(tmp_path); - tmp_path = file_info.absoluteDir().absolutePath(); - } +static std::string ConvertNativeSeparators(const std::string& path) { + const char* native_separator = GetNativeSeparator(); + const char* alien_separator = VKC_ENV != VKC_ENV_WIN32 ? "\\" : "/"; - QDir dir; - if (!dir.exists(tmp_path)) { - dir.mkpath(tmp_path); - assert(dir.exists(tmp_path)); - } + return ConvertSeparators(path, native_separator, alien_separator); } -std::string GetPath(BuiltinPath path) { - std::string result; +Path::Path() {} - switch (path) { - case BUILTIN_PATH_HOME: { - result = QDir().homePath().toStdString(); - break; - } - case BUILTIN_PATH_LOCAL_LEGACY: - case BUILTIN_PATH_LOCAL: { - result = qgetenv("VK_LOCAL").toStdString(); - if (result.empty()) { - result = GetPath(BUILTIN_PATH_HOME) + "/VulkanSDK"; - } - break; - } - case BUILTIN_PATH_CONFIG_REF: { - static const std::string TABLE[] = { - "/" + vkconfig_version + "/configurations", // ENVIRONMENT_WIN32 - "/lunarg-" + vkconfig_version + "/configurations" // ENVIRONMENT_UNIX - }; - static_assert(countof(TABLE) == ENVIRONMENT_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - result = GetPath(BUILTIN_PATH_APPDATA) + TABLE[VKC_ENV]; - break; - } - case BUILTIN_PATH_CONFIG_LAST: { - const std::string config = format("_%d_%d_%d", Version::LAYER_CONFIG.GetMajor(), Version::LAYER_CONFIG.GetMinor(), - Version::LAYER_CONFIG.GetPatch()); +Path::Path(const Path& path) : data(path.data) {} - result = GetPath(BUILTIN_PATH_CONFIG_REF) + config; - break; - } - case BUILTIN_PATH_APPLIST: { - result = GetPath(BUILTIN_PATH_CONFIG_LAST) + "/../applist.json"; - break; - } - case BUILTIN_PATH_VKCONFIG_SETTINGS: { - result = GetPath(BUILTIN_PATH_CONFIG_LAST) + "/../vkconfig.json"; - break; - } - case BUILTIN_PATH_OVERRIDE_SETTINGS: { - static const std::string TABLE[] = { - "/" + vkconfig_version + "/override", // ENVIRONMENT_WIN32 - "/settings.d" // ENVIRONMENT_UNIX - }; - static_assert(countof(TABLE) == ENVIRONMENT_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - result = qgetenv("VK_LAYER_SETTINGS_PATH").toStdString(); - if (result.empty()) { - result = GetPath(BUILTIN_PATH_APPDATA) + TABLE[VKC_ENV]; - } - if (result.find("vk_layer_settings.txt") == std::string::npos) { - result += "/vk_layer_settings.txt"; +Path::Path(const char* path) : Path(std::string(path)) {} + +Path::Path(const std::string& path, bool recover_vars) { + std::string result = path; + + if (recover_vars) { + for (std::size_t i = 0, n = std::size(VARIABLES); i < n; ++i) { + std::string substring = ::Get(VARIABLES[i].path).AbsolutePath(); + + const std::size_t found = result.find(substring); + if (found < substring.size()) { + assert(found == 0); // The builtin variable must be first part of the path + const std::size_t offset = found + substring.size(); + const std::string replaced_path = VARIABLES[i].key + result.substr(found + offset, result.size() - offset); + result = ConvertNativeSeparators(replaced_path); + break; } - break; - } - case BUILTIN_PATH_OVERRIDE_LAYERS: { - static const std::string TABLE[] = { - "/" + vkconfig_version + "/override", // ENVIRONMENT_WIN32 - "/implicit_layer.d" // ENVIRONMENT_UNIX - }; - static_assert(countof(TABLE) == ENVIRONMENT_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - result = GetPath(BUILTIN_PATH_APPDATA) + TABLE[VKC_ENV]; - result += "/VkLayer_override.json"; - break; } - case BUILTIN_PATH_APPDATA: { - static const char* TABLE[] = { - "/AppData/Local/LunarG", // ENVIRONMENT_WIN32 - "/.local/share/vulkan" // ENVIRONMENT_UNIX - }; - static_assert(countof(TABLE) == ENVIRONMENT_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - result = GetPath(BUILTIN_PATH_HOME) + TABLE[VKC_ENV]; - break; - } - case BUILTIN_PATH_EXPLICIT_LAYERS: { - static const char* TABLE[] = { - "/Bin", // ENVIRONMENT_WIN32 - "/etc/vulkan/explicit_layer.d" // ENVIRONMENT_UNIX - }; - static_assert(countof(TABLE) == ENVIRONMENT_COUNT, - "The tranlation table size doesn't match the enum number of elements"); - - result = GetPath(BUILTIN_PATH_VULKAN_SDK) + TABLE[VKC_ENV]; - break; - } - case BUILTIN_PATH_VULKAN_SDK: { - static const char* TABLE[] = { - "N/A", // PLATFORM_WINDOWS - "/usr", // PLATFORM_LINUX - "/usr/local/share/vulkan", // PLATFORM_MACOS - "N/A" // PLATFORM_ANDROID - }; - static_assert(countof(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - result = qgetenv("VULKAN_SDK").toStdString(); - if (result.empty()) { - if (VKC_PLATFORM != VKC_PLATFORM_WINDOWS) { - result = TABLE[VKC_PLATFORM]; - } else { - result = GetPath(BUILTIN_PATH_LOCAL); - } - } else { // VULKAN_SDK may be set on macOS - if (VKC_PLATFORM == VKC_PLATFORM_MACOS) result += "/share/vulkan"; - } + } - break; - } - case BUILTIN_PATH_VULKAN_CONTENT: { - static const char* TABLE[] = { - "/Config", // PLATFORM_WINDOWS - "/share/vulkan/config", // PLATFORM_LINUX - "/config", // PLATFORM_MACOS - "N/A" // PLATFORM_ANDROID - }; - static_assert(countof(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - result = GetPath(BUILTIN_PATH_VULKAN_SDK) + TABLE[VKC_PLATFORM]; - break; + this->data = result; +} + +bool Path::IsFile() const { return QFileInfo(this->data.c_str()).isFile(); } + +bool Path::IsDir() const { return QFileInfo(this->data.c_str()).isDir(); } + +Path& Path::operator=(const Path& path) { + this->data = path.data; + return *this; +} + +Path& Path::operator=(const char* path) { + this->data = path; + return *this; +} + +Path& Path::operator=(const std::string& path) { + this->data = path; + return *this; +} + +Path& Path::operator+=(const std::string& extend) { + this->data += extend; + return *this; +} + +void Path::Clear() { this->data.clear(); } + +bool Path::Exists() const { return QFileInfo(this->AbsolutePath().c_str()).exists(); } + +bool Path::Create(bool as_file) const { + if (this->data.empty()) { + return false; + } + + if (as_file) { + QFile file(this->AbsolutePath().c_str()); + if (!file.exists()) { + return file.open(QFile::WriteOnly); } - default: { - assert(0); - return ""; + } else { + QDir dir; + std::string actual_path = this->AbsolutePath(); + if (!dir.exists(actual_path.c_str())) { + return dir.mkpath(actual_path.c_str()); } } - return ConvertNativeSeparators(result); + return true; } -struct BuiltinDesc { - BuiltinPath type; - const char* name; -}; +bool Path::Remove() const { + if (!this->Exists()) { + return false; + } + + if (this->IsFile()) { + return QFile::remove(this->AbsolutePath().c_str()); + } else { + return QDir(this->AbsolutePath().c_str()).removeRecursively(); + } +} -std::string ReplaceBuiltInVariable(const std::string& path) { - static const BuiltinDesc VARIABLES[] = {{BUILTIN_PATH_HOME, "${HOME}"}, - {BUILTIN_PATH_LOCAL_LEGACY, "${LOCAL}"}, - {BUILTIN_PATH_LOCAL, "${VK_LOCAL}"}, - {BUILTIN_PATH_APPDATA, "${VK_APPDATA}"}, - {BUILTIN_PATH_VULKAN_SDK, "${VULKAN_SDK}"}, - {BUILTIN_PATH_VULKAN_CONTENT, "${VULKAN_CONTENT}"}}; - - for (std::size_t i = 0, n = countof(VARIABLES); i < n; ++i) { - const std::size_t found = path.find(VARIABLES[i].name); - if (found < path.size()) { +std::string Path::Filename() const { + QFileInfo info(this->AbsolutePath().c_str()); + return info.fileName().toStdString(); +} + +std::string Path::Basename() const { + QFileInfo info(this->AbsolutePath().c_str()); + return info.baseName().toStdString(); +} + +std::string Path::AbsoluteDir() const { + QFileInfo info(this->AbsolutePath().c_str()); + return ConvertNativeSeparators(info.absoluteDir().path().toStdString()); +} + +std::string Path::AbsolutePath() const { + for (std::size_t i = 0, n = std::size(VARIABLES); i < n; ++i) { + const std::size_t found = this->data.find(VARIABLES[i].key); + if (found < this->data.size()) { assert(found == 0); // The builtin variable must be first part of the path - const std::size_t offset = found + std::strlen(VARIABLES[i].name); - const std::string replaced_path = GetPath(VARIABLES[i].type) + path.substr(found + offset, path.size() - offset); + const std::size_t offset = found + std::strlen(VARIABLES[i].key); + const std::string replaced_path = + Get(VARIABLES[i].path).RelativePath() + this->data.substr(found + offset, this->data.size() - offset); return ConvertNativeSeparators(replaced_path); } } // No built-in variable found, return unchanged - return path; + return ConvertNativeSeparators(this->data); } -std::string ConvertSeparators(const std::string& path, const char* native_separator, const char* alien_separator) { - const std::size_t native_separator_size = std::strlen(native_separator); - const std::size_t alien_separator_size = std::strlen(alien_separator); +std::string Path::RelativePath() const { + // Store trailing separator to enable operator + and += + return ConvertNativeSeparators(this->data); +} - std::string current_path = path; - while (current_path.find_first_of(alien_separator) < current_path.size()) { - const std::size_t found = current_path.find_first_of(alien_separator); - const std::size_t size = current_path.size(); +std::string Path::LastModified() const { + QFileInfo file_info(this->data.c_str()); - if (found < size - alien_separator_size) - current_path = current_path.substr(0, found) + native_separator + - current_path.substr(found + alien_separator_size, size - found - alien_separator_size); - else - current_path = current_path.substr(0, found); + return file_info.lastModified().toString(Qt::ISODate).toStdString(); +} + +bool operator==(const Path& a, const Path& b) { return a.AbsolutePath() == b.AbsolutePath(); } + +Path operator+(const Path& path, const std::string& extend) { return Path(path.data + extend); } + +static const Path GetHomePath() { + std::string result = qgetenv("VK_HOME").toStdString(); + + if (result.empty()) { // Defaukt path + result = QDir().homePath().toStdString() + "/VulkanSDK"; } - // Remove trailing native separator - const std::size_t found = current_path.find_last_of(native_separator); - const std::size_t size = current_path.size(); - if (found == size - native_separator_size) current_path = current_path.substr(0, found); + Path path(result); - return current_path; + if (!path.Exists()) { + path.Create(); + } + + return path; } -const char* GetNativeSeparator() { - static const char* native_separator = VKC_ENV == VKC_ENV_WIN32 ? "\\" : "/"; - return native_separator; +static const Path GetAppDataPath() { + static const char* TABLE[] = { + "/AppData/Local/LunarG", // ENVIRONMENT_WIN32 + "/.local/share/vulkan" // ENVIRONMENT_UNIX + }; + static_assert(std::size(TABLE) == ENVIRONMENT_COUNT); + + return QDir().homePath().toStdString() + TABLE[VKC_ENV]; } -std::string ConvertNativeSeparators(const std::string& path) { - const char* native_separator = GetNativeSeparator(); - const char* alien_separator = VKC_ENV != VKC_ENV_WIN32 ? "\\" : "/"; +static const Path GetInitPath() { + static const std::string TABLE[] = { + "/" + VKCONFIG_VERSION + "/vkconfig.json", // ENVIRONMENT_WIN32 + "/lunarg-" + VKCONFIG_VERSION + "/vkconfig.json" // ENVIRONMENT_UNIX + }; + static_assert(std::size(TABLE) == ENVIRONMENT_COUNT); - return ConvertSeparators(path, native_separator, alien_separator); + return GetAppDataPath().RelativePath() + TABLE[VKC_ENV]; } -static bool IsPortableChar(char c) { - if (c == '\\' || c == '/') return false; - if (c == '|' || c == '<' || c == '>') return false; - if (c == ':' || c == '*' || c == '?') return false; +static const Path GetConfigsPath() { + static const std::string TABLE[] = { + "/" + VKCONFIG_VERSION + "/configurations", // ENVIRONMENT_WIN32 + "/lunarg-" + VKCONFIG_VERSION + "/configurations" // ENVIRONMENT_UNIX + }; + static_assert(std::size(TABLE) == ENVIRONMENT_COUNT); - return true; + Path path(GetAppDataPath().RelativePath() + TABLE[VKC_ENV]); + + if (!path.Exists()) { + path.Create(); + } + + return path; } -bool IsPortableFilename(const std::string& path) { - if (path.empty()) return false; +static const Path GetLayersSettingsPath() { +#if VKC_ENV == VKC_ENV_WIN32 + const std::string layers_settings_path = "/" + VKCONFIG_VERSION + "/override"; +#elif VKC_ENV == VKC_ENV_UNIX + const std::string layers_settings_path = "/settings.d"; +#else +#error Unknown platform +#endif + + std::string result = qgetenv("VK_LAYER_SETTINGS_PATH").toStdString(); + if (result.empty()) { + result = GetAppDataPath().RelativePath() + layers_settings_path; + } + if (result.find("vk_layer_settings.txt") == std::string::npos) { + result += "/vk_layer_settings.txt"; + } + + Path path(result); - if (path == ".") return false; + Path folder(path.AbsoluteDir()); + if (!folder.Exists()) { + folder.Create(); + } - if (path.find("..") != std::string::npos) return false; + return path; +} - for (std::size_t i = 0, n = path.size(); i < n; ++i) { - if (!IsPortableChar(path[i])) return false; +static const Path GetLoaderSettingsPath() { +#if VKC_ENV == VKC_ENV_WIN32 + const std::string loader_settings_path = "/vulkan"; +#elif VKC_ENV == VKC_ENV_UNIX + const std::string loader_settings_path = "/loader_settings.d"; +#else +#error Unknown platform +#endif + + std::string result = GetAppDataPath().RelativePath() + loader_settings_path; + if (result.find("vk_loader_settings.json") == std::string::npos) { + result += "/vk_loader_settings.json"; } - return true; + Path path(result); + + Path folder(path.AbsoluteDir()); + if (!folder.Exists()) { + folder.Create(); + } + + return path; } -QFileInfoList GetJSONFiles(const char* directory) { - QDir dir(directory); - dir.setFilter(QDir::Files | QDir::NoSymLinks); - dir.setNameFilters(QStringList() << "*.json"); - return dir.entryInfoList(); +static const Path GetSDKPath() { + static const char* TABLE[] = { + "", // PLATFORM_WINDOWS + "/usr", // PLATFORM_LINUX + "/usr/local/share/vulkan", // PLATFORM_MACOS + "" // PLATFORM_ANDROID + }; + static_assert(std::size(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); + + std::string result = qgetenv("VULKAN_SDK").toStdString(); + if (result.empty()) { + result = TABLE[VKC_PLATFORM]; + } else { // VULKAN_SDK may be set on macOS + if (VKC_PLATFORM == VKC_PLATFORM_MACOS) { + result += "/share/vulkan"; + } + } + + return result; +} + +static const Path GetExplicitLayersPath() { + static const std::string TABLE[] = { + "/Bin", // ENVIRONMENT_WIN32 + "/etc/vulkan/explicit_layer.d" // ENVIRONMENT_UNIX + }; + static_assert(std::size(TABLE) == ENVIRONMENT_COUNT); + + return GetSDKPath().RelativePath() + TABLE[VKC_ENV]; } -std::string ExtractAbsoluteDir(const std::string& path) { - assert(!path.empty()); +static const Path GetVulkanContentPath() { + static const std::string TABLE[] = { + "/Config", // PLATFORM_WINDOWS + "/share/vulkan/config", // PLATFORM_LINUX + "/config", // PLATFORM_MACOS + "N/A" // PLATFORM_ANDROID + }; + static_assert(std::size(TABLE) == PLATFORM_COUNT); - return ConvertNativeSeparators(QFileInfo(path.c_str()).absoluteDir().path().toStdString()); + return GetSDKPath().RelativePath() + TABLE[VKC_PLATFORM]; +} + +Path Get(Path::Builtin path) { + switch (path) { + default: + assert(0); + return ""; + case Path::HOME: + return ::GetHomePath(); + case Path::APPDATA: + return ::GetAppDataPath(); + case Path::INIT: + return ::GetInitPath(); + case Path::CONFIGS: + return ::GetConfigsPath(); + case Path::LAYERS_SETTINGS: + return ::GetLayersSettingsPath(); + case Path::LOADER_SETTINGS: + return ::GetLoaderSettingsPath(); + case Path::SDK: + return ::GetSDKPath(); + case Path::EXPLICIT_LAYERS: + return ::GetExplicitLayersPath(); + case Path::CONTENT: + return ::GetVulkanContentPath(); + } +} + +std::string AbsolutePath(Path::Builtin path) { return Get(path).AbsolutePath(); } + +std::string RelativePath(Path::Builtin path) { return Get(path).RelativePath(); } + +std::vector CollectFilePaths(const Path& directory, const char* filter) { + const std::string& absolute_path = directory.AbsolutePath(); + + const QDir dir(absolute_path.c_str()); + const QFileInfoList& list = dir.entryInfoList(QStringList() << filter, QDir::Files | QDir::NoSymLinks); + + std::vector result; + for (int i = 0, n = list.size(); i < n; ++i) { + result.push_back(list[i].absoluteFilePath().toStdString()); + } + return result; } static std::vector LoadProfiles(const QJsonDocument& doc) { @@ -310,13 +415,12 @@ static std::vector LoadProfiles(const QJsonDocument& doc) { return ConvertString(ReadObject(json_root_object, "profiles").keys()); } -std::vector GetProfileNamesFromFile(const std::string& profile_path) { - const std::string& value = ReplaceBuiltInVariable(profile_path); - if (value.empty()) { +std::vector CollectProfileNamesFromFile(const Path& profile_path) { + if (profile_path.Empty()) { return std::vector(); } - const QJsonDocument& doc = ParseJsonFile(value.c_str()); + const QJsonDocument& doc = ParseJsonFile(profile_path.AbsolutePath().c_str()); if (doc.isNull() || doc.isEmpty()) { return std::vector(); @@ -331,33 +435,57 @@ std::vector GetProfileNamesFromFile(const std::string& profile_path return LoadProfiles(doc); } -std::vector GetProfileNamesFromDir(const std::string& profile_path) { - std::vector profile_names; - - std::string value = ReplaceBuiltInVariable(profile_path); - if (value.empty()) { +std::vector CollectProfileNamesFromDir(const Path& profile_path) { + if (profile_path.Empty()) { return std::vector(); } + Path path = profile_path; + // Windows workaround so that the user could select C: D: etc QDir doesn't recognize it as valid path other wise if (VKC_ENV == VKC_ENV_WIN32) { - if (!EndsWith(value, "\\")) { - value += "\\"; + if (!EndsWith(path.AbsolutePath().c_str(), "\\")) { + path += "\\"; } } - QDir dir(value.c_str()); - QFileInfoList file_info_list = dir.entryInfoList(QStringList() << "*.json", QDir::Files); - - QStringList files; - for (int file_index = 0, file_count = file_info_list.size(); file_index < file_count; ++file_index) { - files << file_info_list[file_index].filePath(); - } + const std::vector& files = CollectFilePaths(path.AbsolutePath().c_str()); + std::vector profile_names; for (std::size_t i = 0, n = files.size(); i < n; ++i) { - const std::vector& profile_names_of_files = GetProfileNamesFromFile(files[i].toStdString()); + const std::vector& profile_names_of_files = CollectProfileNamesFromFile(files[i]); profile_names.insert(profile_names.end(), profile_names_of_files.begin(), profile_names_of_files.end()); } return profile_names; } + +static bool IsPortableChar(char c) { + if (c == '\\' || c == '/') return false; + if (c == '|' || c == '<' || c == '>') return false; + if (c == ':' || c == '*' || c == '?') return false; + + return true; +} + +bool IsPortableFilename(const std::string& s) { + if (s.empty()) { + return false; + } + + if (s == ".") { + return false; + } + + if (s.find("..") != std::string::npos) { + return false; + } + + for (std::size_t i = 0, n = s.size(); i < n; ++i) { + if (!IsPortableChar(s[i])) { + return false; + } + } + + return true; +} diff --git a/vkconfig_core/path.h b/vkconfig_core/path.h index 2003ce803b..79d390acce 100644 --- a/vkconfig_core/path.h +++ b/vkconfig_core/path.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,64 +24,65 @@ #include -enum BuiltinPath { - BUILTIN_PATH_HOME = 0, - BUILTIN_PATH_LOCAL_LEGACY, - BUILTIN_PATH_LOCAL, - BUILTIN_PATH_APPDATA, - BUILTIN_PATH_CONFIG_REF, - BUILTIN_PATH_CONFIG_LAST, - BUILTIN_PATH_APPLIST, - BUILTIN_PATH_OVERRIDE_LAYERS, - BUILTIN_PATH_OVERRIDE_SETTINGS, - BUILTIN_PATH_EXPLICIT_LAYERS, - BUILTIN_PATH_VULKAN_SDK, - BUILTIN_PATH_VULKAN_CONTENT, - BUILTIN_PATH_VKCONFIG_SETTINGS, - - BUILTIN_PATH_FIRST = BUILTIN_PATH_HOME, - BUILTIN_PATH_LAST = BUILTIN_PATH_VKCONFIG_SETTINGS, -}; - -enum { BUILTIN_PATH_COUNT = BUILTIN_PATH_LAST - BUILTIN_PATH_FIRST + 1 }; - -extern std::string vkconfig_version; - class Path { public: + enum Builtin { + HOME, // Vulkan SDK user directory + APPDATA, + INIT, + CONFIGS, + LAYERS_SETTINGS, + LOADER_SETTINGS, + SDK, + EXPLICIT_LAYERS, + CONTENT, + }; + Path(); - explicit Path(const char* path); - explicit Path(const std::string& path); + Path(const Path& path); + Path(const char* path); + Path(const std::string& path, bool recover_vars = false); + Path& operator=(const Path& path); + Path& operator=(const char* path); Path& operator=(const std::string& path); + Path& operator+=(const std::string& extend); - const char* c_str() const; - bool empty() const { return data.empty(); } - - private: - std::string data; -}; + bool IsFile() const; + bool IsDir() const; -std::string ConvertSeparators(const std::string& path, const char* native_separator, const char* alien_separator); + void Clear(); + bool Exists() const; + bool Create(bool as_file = false) const; + bool Remove() const; + std::string Filename() const; + std::string Basename() const; + std::string AbsoluteDir() const; + std::string AbsolutePath() const; // Translate built-in variables into actual path + std::string RelativePath() const; // May contain built-in variables + std::string LastModified() const; -std::string ConvertNativeSeparators(const std::string& path); + bool Empty() const { return this->data.empty(); } -const char* GetNativeSeparator(); + private: + std::string data; -// Create a directory if it doesn't exist -void CheckPathsExist(const std::string& path, bool is_full_path = false); + friend bool operator==(const Path& a, const Path& b); + friend Path operator+(const Path& path, const std::string& extend); +}; -std::string GetPath(BuiltinPath path); +Path Get(Path::Builtin path); +std::string AbsolutePath(Path::Builtin path); +std::string RelativePath(Path::Builtin path); -// Replace built-in variable by the actual path -std::string ReplaceBuiltInVariable(const std::string& path); +bool operator==(const Path& a, const Path& b); -bool IsPortableFilename(const std::string& path); +Path operator+(const Path& path, const std::string& extend); -QFileInfoList GetJSONFiles(const char* directory); +std::vector CollectFilePaths(const Path& directory, const char* filter = "*json"); -std::string ExtractAbsoluteDir(const std::string& path); +std::vector CollectProfileNamesFromFile(const Path& profile_path); -std::vector GetProfileNamesFromFile(const std::string& profile_path); +std::vector CollectProfileNamesFromDir(const Path& profile_path); -std::vector GetProfileNamesFromDir(const std::string& profile_path); +bool IsPortableFilename(const std::string& s); diff --git a/vkconfig_core/path_manager.cpp b/vkconfig_core/path_manager.cpp deleted file mode 100644 index fbf11d78ad..0000000000 --- a/vkconfig_core/path_manager.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#include "path_manager.h" -#include "path.h" -#include "util.h" -#include "platform.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - -struct DirectoryDesc { - const char* default_extension; // file extension used to path - const char* setting_data; // system token to store the path, if empty the directory is not saved - const char* default_filename; // a default filename, if empty there is no default filename - PathType alternative; -}; - -static const DirectoryDesc& GetDesc(PathType directory) { - assert(directory >= PATH_FIRST && directory <= PATH_LAST); - - static const DirectoryDesc table[] = { - {".json", "lastImportPath", nullptr, PATH_EXPORT_CONFIGURATION}, // PATH_IMPORT - {".json", "lastExportPath", nullptr, PATH_IMPORT_CONFIGURATION}, // PATH_EXPORT -#if VKC_PLATFORM == VKC_PLATFORM_WINDOWS - {".exe", "lastExecutablePath", nullptr, PATH_WORKING_DIR}, // PATH_EXECUTABLE -#else - {"", "lastExecutablePath", nullptr, PATH_WORKING_DIR}, // PATH_EXECUTABLE -#endif - {nullptr, "lastWorkingDirPath", nullptr, PATH_EXECUTABLE}, // PATH_EXECUTABLE - {".txt", "lastLauncherLogFile", "log", PATH_LAUNCHER_LOG_FILE}, // PATH_LAUNCHER_LOG_FILE - {".json", "lastLayersPaths", nullptr, PATH_USER_DEFINED_LAYERS_GUI}, // PATH_USER_DEFINED_LAYERS_GUI - {nullptr, "vulkan_sdk", nullptr, PATH_VULKAN_SDK} // PATH_VULKAN_SDK - }; - static_assert(countof(table) == PATH_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - return table[directory]; -} - -PathManager::PathManager(const std::string& VULKAN_SDK, const std::vector& SUPPORTED_CONFIG_FILES) - : SUPPORTED_CONFIG_FILES(SUPPORTED_CONFIG_FILES) { - const bool result = Load(); - - const std::string path = VULKAN_SDK.empty() ? qgetenv("VULKAN_SDK").toStdString() : VULKAN_SDK; - if (!path.empty()) { - this->SetPath(PATH_VULKAN_SDK, path); - } - - assert(result); -} - -PathManager::~PathManager() { - const bool result = Save(); - assert(result); -} - -bool PathManager::Load() { - QSettings settings; - for (std::size_t i = 0; i < PATH_COUNT; ++i) { - const PathType type = static_cast(i); - if (GetDesc(type).setting_data == nullptr) continue; - paths[type] = settings.value(GetDesc(type).setting_data).toString().toStdString(); - } - - CheckPathsExist(::GetPath(BUILTIN_PATH_LOCAL)); - CheckPathsExist(::GetPath(BUILTIN_PATH_CONFIG_LAST)); - - CheckPathsExist(::GetPath(BUILTIN_PATH_OVERRIDE_LAYERS), true); - CheckPathsExist(::GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS), true); - - return true; -} - -bool PathManager::Save() { - QSettings settings; - for (std::size_t i = 0; i < PATH_COUNT; ++i) { - const PathType type = static_cast(i); - if (GetDesc(type).setting_data == nullptr) continue; - settings.setValue(GetDesc(type).setting_data, paths[type].c_str()); - } - - return true; -} - -void PathManager::Clear() { - for (std::size_t i = 0; i < PATH_COUNT; ++i) { - const PathType type = static_cast(i); - paths[type].clear(); - } -} - -void PathManager::Reset() { - for (std::size_t i = 0; i < PATH_COUNT; ++i) { - paths[static_cast(i)].clear(); - } -} - -const std::string PathManager::GetPath(PathType path) const { - assert(path >= PATH_FIRST && path <= PATH_LAST); - - if (!paths[path].empty()) { - return paths[path].c_str(); - } - - const PathType alternative_path = GetDesc(path).alternative; - if (!paths[alternative_path].empty()) { - return paths[alternative_path].c_str(); - } - - return ::GetPath(BUILTIN_PATH_HOME); -} - -void PathManager::SetPath(PathType path, const char* path_value) { - assert(path >= PATH_FIRST && path <= PATH_LAST); - assert(path_value); - - const QDir directory(path_value); - const std::string native_path(ConvertNativeSeparators(directory.absolutePath().toStdString())); - paths[path] = native_path; -} - -void PathManager::SetPath(PathType directory, const std::string& path_value) { - assert(!path_value.empty()); - - SetPath(directory, path_value.c_str()); -} - -std::string PathManager::GetFullPath(PathType path, const char* filename) const { - const QFileInfo file_info(filename); - - const std::string path_base(GetPath(path).c_str()); - - const std::string path_filename = - filename != nullptr ? QFileInfo(filename).baseName().toStdString() : GetDesc(path).default_filename; - assert(!path_filename.empty()); // Did you really mean to use GetFullPath? GetPath seem to be the right function here - - const std::string path_suffix = !file_info.completeSuffix().isEmpty() - ? std::string(".") + file_info.completeSuffix().toStdString() - : GetDesc(path).default_extension; - assert(!path_suffix.empty() || VKC_PLATFORM != VKC_PLATFORM_WINDOWS); // Only Windows has a suffix for executable - - const std::string full_path(ConvertNativeSeparators(path_base + GetNativeSeparator() + path_filename + path_suffix)); - return full_path; -} - -std::string PathManager::GetFullPath(PathType path, const std::string& filename) const { - return GetFullPath(path, filename.c_str()); -} - -std::string PathManager::SelectPath(QWidget* parent, PathType path) { - assert(parent); - assert(path >= PATH_FIRST && path <= PATH_LAST); - - return SelectPathImpl(parent, path, GetPath(path).c_str()); -} - -std::string PathManager::SelectPath(QWidget* parent, PathType path, const std::string& suggested_path) { - assert(parent); - assert(path >= PATH_FIRST && path <= PATH_LAST); - - if (suggested_path.empty()) - return SelectPathImpl(parent, path, GetPath(path).c_str()); - else - return SelectPathImpl(parent, path, suggested_path); -} - -std::string PathManager::SelectPathImpl(QWidget* parent, PathType path, const std::string& suggested_path) { - assert(parent); - assert(path >= PATH_FIRST && path <= PATH_LAST); - assert(!suggested_path.empty()); - - switch (path) { - case PATH_LAUNCHER_LOG_FILE: { - const std::string selected_path = - QFileDialog::getSaveFileName(parent, "Set Log File To...", suggested_path.c_str(), "Log text(*.txt)").toStdString(); - if (selected_path.empty()) // The user cancelled - return ""; - - SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); - return GetFullPath(path, QFileInfo(selected_path.c_str()).baseName().toStdString()); - } break; - case PATH_EXECUTABLE: { - static const char* TABLE[] = { - "Applications (*.exe)", // PLATFORM_WINDOWS - "Applications (*)", // PLATFORM_LINUX - "Applications (*.app, *)", // PLATFORM_MACOS - "N/A" // PLATFORM_ANDROID - }; - static_assert(countof(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - const std::string filter = TABLE[VKC_PLATFORM]; - const std::string selected_path = - QFileDialog::getOpenFileName(parent, "Select a Vulkan Executable...", suggested_path.c_str(), filter.c_str()) - .toStdString(); - if (selected_path.empty()) // The user cancelled - return ""; - - SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); - return GetFullPath(path, QFileInfo(selected_path.c_str()).fileName().toStdString()); - } - case PATH_WORKING_DIR: { - const std::string selected_path = - QFileDialog::getExistingDirectory(parent, "Set Working Folder To...", suggested_path.c_str()).toStdString(); - if (selected_path.empty()) // The user cancelled - return ""; - - SetPath(path, selected_path); - return GetPath(path).c_str(); - } - case PATH_USER_DEFINED_LAYERS_GUI: { - const std::string selected_path = - QFileDialog::getExistingDirectory(parent, "Add User-Defined Layers Folder...", suggested_path.c_str(), - QFileDialog::DontUseNativeDialog) - .toStdString(); - if (selected_path.empty()) // The user cancelled - return ""; - - SetPath(path, selected_path); - return GetPath(path).c_str(); - } - case PATH_IMPORT_CONFIGURATION: { - const std::string selected_path = QFileDialog::getOpenFileName(parent, "Import Layers Configuration File", - suggested_path.c_str(), "JSON configuration(*.json)") - .toStdString(); - if (selected_path.empty()) // The user cancelled - return ""; - - SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); - return selected_path; - } - case PATH_EXPORT_CONFIGURATION: { - const std::string selected_path = QFileDialog::getSaveFileName(parent, "Export Layers Configuration File", - suggested_path.c_str(), "JSON configuration(*.json)") - .toStdString(); - if (selected_path.empty()) // The user cancelled - return ""; - - SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); - return selected_path; - } - default: - assert(0); - return ""; - } -} diff --git a/vkconfig_core/path_manager.h b/vkconfig_core/path_manager.h deleted file mode 100644 index e158db993e..0000000000 --- a/vkconfig_core/path_manager.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Authors: - * - Christophe Riccio - */ - -#pragma once - -#include "path.h" -#include "version.h" - -#include -#include - -enum PathType { - PATH_IMPORT_CONFIGURATION = 0, // The last path used by the user to import a configuration - PATH_EXPORT_CONFIGURATION, // The last path used by the user to export a configuration - PATH_EXECUTABLE, // The last path used by the user when adding an executable to the application list - PATH_WORKING_DIR, // The last path used as a working directory - PATH_LAUNCHER_LOG_FILE, // The last path used by the user to set the launcher log file - PATH_USER_DEFINED_LAYERS_GUI, // The last user-defined layers path - PATH_VULKAN_SDK, // Path of the Vulkan SDK - - PATH_FIRST = PATH_IMPORT_CONFIGURATION, - PATH_LAST = PATH_VULKAN_SDK -}; - -enum { PATH_COUNT = PATH_LAST - PATH_FIRST + 1 }; - -class PathManager { - public: - PathManager(const std::string& VULKAN_SDK, const std::vector& SUPPORTED_CONFIG_FILES); - ~PathManager(); - - bool Load(); - bool Save(); - - const std::string GetPath(PathType path) const; - - // The path value should not have the filename - void SetPath(PathType path, const char* path_value); - - // The path value should not have the filename - void SetPath(PathType path, const std::string& path_value); - - // When filename is set to nullptr, the function will try to use the default filename if there is one for the DirectoryType - std::string GetFullPath(PathType path, const char* filename = nullptr) const; - std::string GetFullPath(PathType path, const std::string& filename) const; - - std::string SelectPath(QWidget* parent, PathType path); - std::string SelectPath(QWidget* parent, PathType path, const std::string& suggested_path); - - void Clear(); - void Reset(); - - const std::vector SUPPORTED_CONFIG_FILES; - - private: - PathManager(const PathManager&) = delete; - PathManager& operator=(const PathManager&) = delete; - - std::string SelectPathImpl(QWidget* parent, PathType path, const std::string& suggested_path); - - std::array paths; -}; diff --git a/vkconfig_core/registry.cpp b/vkconfig_core/registry.cpp index 919216be03..b2accffa16 100644 --- a/vkconfig_core/registry.cpp +++ b/vkconfig_core/registry.cpp @@ -31,13 +31,13 @@ /// On Windows the overide json file and settings file are not used unless the path to those /// files are stored in the registry. -void AppendRegistryEntriesForLayers(QString override_file, QString settings_file) { +void AppendRegistryEntriesForLayers(QString loader_settings_file, QString layers_settings_file) { // Layer override json file HKEY key; const HKEY userKey = IsUserAnAdmin() ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; REGSAM access = KEY_WRITE; - LSTATUS err = RegCreateKeyEx(userKey, TEXT("SOFTWARE\\Khronos\\Vulkan\\ImplicitLayers"), 0, NULL, REG_OPTION_NON_VOLATILE, + LSTATUS err = RegCreateKeyEx(userKey, TEXT("SOFTWARE\\Khronos\\Vulkan\\LoaderSettings"), 0, NULL, REG_OPTION_NON_VOLATILE, access, NULL, &key, NULL); if (err != ERROR_SUCCESS) return; @@ -45,7 +45,7 @@ void AppendRegistryEntriesForLayers(QString override_file, QString settings_file DWORD value_count; DWORD value = 0; RegQueryInfoKey(key, NULL, NULL, NULL, NULL, NULL, NULL, &value_count, NULL, NULL, NULL, NULL); - RegSetValueExW(key, (LPCWSTR)override_file.utf16(), 0, REG_DWORD, (BYTE *)&value, sizeof(value)); + RegSetValueExW(key, (LPCWSTR)loader_settings_file.utf16(), 0, REG_DWORD, (BYTE *)&value, sizeof(value)); RegCloseKey(key); // Layer settings file @@ -54,23 +54,23 @@ void AppendRegistryEntriesForLayers(QString override_file, QString settings_file if (err != ERROR_SUCCESS) return; RegQueryInfoKeyW(key, NULL, NULL, NULL, NULL, NULL, NULL, &value_count, NULL, NULL, NULL, NULL); - RegSetValueExW(key, (LPCWSTR)settings_file.utf16(), 0, REG_DWORD, (BYTE *)&value, sizeof(value)); + RegSetValueExW(key, (LPCWSTR)layers_settings_file.utf16(), 0, REG_DWORD, (BYTE *)&value, sizeof(value)); RegCloseKey(key); } /// On Windows the overide json file and settings file are not used unless the path to those /// files are stored in the registry. -void RemoveRegistryEntriesForLayers(QString override_file, QString settings_file) { +void RemoveRegistryEntriesForLayers(QString loader_settings_file, QString layers_settings_file) { // Layer override json file HKEY key; HKEY userKey = IsUserAnAdmin() ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; REGSAM access = KEY_WRITE; - LSTATUS err = RegCreateKeyEx(userKey, TEXT("SOFTWARE\\Khronos\\Vulkan\\ImplicitLayers"), 0, NULL, REG_OPTION_NON_VOLATILE, + LSTATUS err = RegCreateKeyEx(userKey, TEXT("SOFTWARE\\Khronos\\Vulkan\\LoaderSettings"), 0, NULL, REG_OPTION_NON_VOLATILE, access, NULL, &key, NULL); if (err != ERROR_SUCCESS) return; - RegDeleteValueW(key, (LPCWSTR)override_file.utf16()); + RegDeleteValueW(key, (LPCWSTR)loader_settings_file.utf16()); RegCloseKey(key); // Layer settings file @@ -78,12 +78,12 @@ void RemoveRegistryEntriesForLayers(QString override_file, QString settings_file NULL); if (err != ERROR_SUCCESS) return; - RegDeleteValueW(key, (LPCWSTR)settings_file.utf16()); + RegDeleteValueW(key, (LPCWSTR)layers_settings_file.utf16()); RegCloseKey(key); } /// Look for device specific layers -static void LoadDeviceRegistry(DEVINST id, const QString &entry, std::vector &layers, LayerType type) { +static void LoadDeviceRegistry(DEVINST id, const QString &entry, std::vector &layers_paths) { HKEY key; if (CM_Open_DevNode_Key(id, KEY_QUERY_VALUE, 0, RegDisposition_OpenExisting, &key, CM_REGISTRY_SOFTWARE) != CR_SUCCESS) return; @@ -103,10 +103,8 @@ static void LoadDeviceRegistry(DEVINST id, const QString &entry, std::vector &layers, LayerType type) { +std::vector LoadRegistryLayers(const QString &path) { + std::vector layers_paths; + QString root_string = path.section('\\', 0, 0); static QHash root_keys = { {"HKEY_CLASSES_ROOT", HKEY_CLASSES_ROOT}, @@ -156,10 +156,10 @@ void LoadRegistryLayers(const QString &path, std::vector &layers, LayerTy // This has already been set by now if (path.endsWith("VulkanExplicitLayers")) { entry = "VulkanExplicitLayers"; - type = LAYER_TYPE_EXPLICIT; + // type = LAYER_TYPE_EXPLICIT; } else if (path.endsWith("VulkanImplicitLayers")) { entry = "VulkanImplicitLayers"; - type = LAYER_TYPE_IMPLICIT; + // type = LAYER_TYPE_IMPLICIT; } for (wchar_t *device_name = device_names; device_name[0] != '\0'; device_name += wcslen(device_name) + 1) { @@ -167,7 +167,7 @@ void LoadRegistryLayers(const QString &path, std::vector &layers, LayerTy if (CM_Locate_DevNodeW(&device_id, device_name, CM_LOCATE_DEVNODE_NORMAL) != CR_SUCCESS) { continue; } - LoadDeviceRegistry(device_id, entry, layers, type); + LoadDeviceRegistry(device_id, entry, layers_paths); DEVINST child_id; if (CM_Get_Child(&child_id, device_id, 0) != CR_SUCCESS) { @@ -184,7 +184,7 @@ void LoadRegistryLayers(const QString &path, std::vector &layers, LayerTy continue; } if (wcscmp(child_guid, (LPCWSTR)SOFTWARE_COMPONENT_GUID.utf16()) == 0) { - LoadDeviceRegistry(child_id, entry, layers, type); + LoadDeviceRegistry(child_id, entry, layers_paths); break; } } while (CM_Get_Sibling(&child_id, child_id, 0) == CR_SUCCESS); @@ -194,6 +194,8 @@ void LoadRegistryLayers(const QString &path, std::vector &layers, LayerTy if (device_names != nullptr) { delete[] device_names; } + + return layers_paths; } #endif // VKC_PLATFORM == VKC_PLATFORM_WINDOWS diff --git a/vkconfig_core/registry.h b/vkconfig_core/registry.h index 75ec04598e..2b587180f8 100644 --- a/vkconfig_core/registry.h +++ b/vkconfig_core/registry.h @@ -20,7 +20,7 @@ #pragma once -#include "platform.h" +#include "type_platform.h" #include "layer.h" #if VKC_PLATFORM == VKC_PLATFORM_WINDOWS @@ -33,6 +33,6 @@ void AppendRegistryEntriesForLayers(QString override_file, QString settings_file void RemoveRegistryEntriesForLayers(QString override_file, QString settings_file); -void LoadRegistryLayers(const QString &path, std::vector &layers, LayerType type); +std::vector LoadRegistryLayers(const QString &path); #endif // VKC_PLATFORM == VKC_PLATFORM_WINDOWS diff --git a/vkconfig_core/setting.cpp b/vkconfig_core/setting.cpp index 2bc45b8f7f..354ebbc54e 100644 --- a/vkconfig_core/setting.cpp +++ b/vkconfig_core/setting.cpp @@ -45,10 +45,6 @@ SettingType GetSettingType(const char* token) { assert(token != nullptr); assert(std::strcmp(token, "") != 0); - if (SUPPORT_LAYER_CONFIG_2_2_0 && ToUpperCase(token) == "MULTI_ENUM") return SETTING_FLAGS; - if (SUPPORT_LAYER_CONFIG_2_2_0 && ToUpperCase(token) == "VUID_EXCLUDE") return SETTING_LIST; - if (SUPPORT_LAYER_CONFIG_2_2_0 && ToUpperCase(token) == "INT_RANGES") return SETTING_FRAMES; - for (int i = SETTING_FIRST; i <= SETTING_LAST; ++i) { const SettingType type = static_cast(i); if (ToUpperCase(token) == GetToken(type)) return type; @@ -77,7 +73,7 @@ const char* GetToken(SettingType type) { "FRAMES", // SETTING_FRAMES "LIST" // SETTING_LIST }; - static_assert(countof(table) == SETTING_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(table) == SETTING_COUNT, "The tranlation table size doesn't match the enum number of elements"); return table[type]; } @@ -348,7 +344,7 @@ const char* GetToken(DependenceMode type) { "ALL", // DEPENDENCE_ALL "ANY" // DEPENDENCE_ANY }; - static_assert(countof(table) == DEPENDENCE_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(table) == DEPENDENCE_COUNT, "The tranlation table size doesn't match the enum number of elements"); return table[type]; } diff --git a/vkconfig_core/setting_filesystem.cpp b/vkconfig_core/setting_filesystem.cpp index e2d8e258dd..bda0a9f6a7 100644 --- a/vkconfig_core/setting_filesystem.cpp +++ b/vkconfig_core/setting_filesystem.cpp @@ -43,14 +43,16 @@ std::string SettingMetaFilesystem::Export(ExportMode export_mode) const { assert(0); return ""; case EXPORT_MODE_OVERRIDE: - return ReplaceBuiltInVariable(this->default_value).c_str(); + return this->default_value.AbsolutePath(); case EXPORT_MODE_DOC: - return this->default_value; + return this->default_value.RelativePath(); } } bool SettingMetaFilesystem::Equal(const SettingMeta& other) const { - if (!SettingMeta::Equal(other)) return false; + if (!SettingMeta::Equal(other)) { + return false; + } const SettingMetaFilesystem& meta = static_cast(other); @@ -59,7 +61,34 @@ bool SettingMetaFilesystem::Equal(const SettingMeta& other) const { // SettingDataFilesystem -SettingDataFilesystem::SettingDataFilesystem(const std::string& key, const SettingType& type) : SettingDataString(key, type) {} +SettingDataFilesystem::SettingDataFilesystem(const SettingMetaFilesystem* meta) : SettingData(meta->key, meta->type), meta(meta) { + assert(meta != nullptr); + this->Reset(); +} + +SettingDataFilesystem::SettingDataFilesystem(const std::string& key, const SettingType& type) : SettingData(key, type) {} + +void SettingDataFilesystem::Reset() { + assert(meta != nullptr); + this->value = this->meta->default_value; +} + +void SettingDataFilesystem::Copy(const SettingData* data) { + if (data->type != this->type) return; + + const SettingDataFilesystem* setting_data = static_cast(data); + this->value = setting_data->value; +} + +bool SettingDataFilesystem::Load(const QJsonObject& json_setting) { + this->value = ReadStringValue(json_setting, "value"); + return true; +} + +bool SettingDataFilesystem::Save(QJsonObject& json_setting) const { + json_setting.insert("value", this->value.RelativePath().c_str()); + return true; +} std::string SettingDataFilesystem::Export(ExportMode export_mode) const { switch (export_mode) { @@ -67,17 +96,24 @@ std::string SettingDataFilesystem::Export(ExportMode export_mode) const { assert(0); return ""; case EXPORT_MODE_OVERRIDE: { - std::string file = this->value; - if (VKC_ENV == VKC_ENV_WIN32) { - file = ConvertSeparators(file, "/", GetNativeSeparator()); - } - return ReplaceBuiltInVariable(file).c_str(); + Path file(this->value); + return file.AbsolutePath(); } case EXPORT_MODE_DOC: - return this->value; + return Path(this->value).RelativePath(); } } +const Path& SettingDataFilesystem::GetValue() const { return this->value; } + +void SettingDataFilesystem::SetValue(const Path& value) { this->value = value; } + +bool SettingDataFilesystem::Equal(const SettingData& other) const { + if (!SettingData::Equal(other)) return false; + + return this->value == static_cast(other).value; +} + // SettingMetaFileLoad const SettingType SettingMetaFileLoad::TYPE(SETTING_LOAD_FILE); @@ -97,7 +133,9 @@ SettingDataFileLoad::SettingDataFileLoad(const SettingMetaFileLoad* meta) : SettingDataFilesystem(meta->key, meta->type), meta(meta) {} void SettingDataFileLoad::Copy(const SettingData* data) { - if (data->type != this->type) return; + if (data->type != this->type) { + return; + } const SettingDataFileLoad* setting_data = static_cast(data); this->value = setting_data->value; @@ -105,10 +143,10 @@ void SettingDataFileLoad::Copy(const SettingData* data) { } bool SettingDataFileLoad::Load(const QJsonObject& json_setting) { - SettingDataString::Load(json_setting); + this->value = Path(ReadStringValue(json_setting, "value")); if (this->meta->format == "PROFILE") { - this->profile_names = GetProfileNamesFromFile(this->value); + this->profile_names = CollectProfileNamesFromFile(this->value); } return true; } @@ -134,7 +172,9 @@ SettingDataFileSave::SettingDataFileSave(const SettingMetaFileSave* meta) : SettingDataFilesystem(meta->key, meta->type), meta(meta) {} void SettingDataFileSave::Copy(const SettingData* data) { - if (data->type != this->type) return; + if (data->type != this->type) { + return; + } const SettingDataFileSave* setting_data = static_cast(data); this->value = setting_data->value; @@ -168,10 +208,10 @@ void SettingDataFolderLoad::Copy(const SettingData* data) { } bool SettingDataFolderLoad::Load(const QJsonObject& json_setting) { - SettingDataString::Load(json_setting); + SettingDataFilesystem::Load(json_setting); if (this->meta->format == "PROFILE") { - this->profile_names = GetProfileNamesFromDir(this->value); + this->profile_names = CollectProfileNamesFromDir(this->value); } return true; } @@ -197,7 +237,9 @@ SettingDataFolderSave::SettingDataFolderSave(const SettingMetaFolderSave* meta) : SettingDataFilesystem(meta->key, meta->type), meta(meta) {} void SettingDataFolderSave::Copy(const SettingData* data) { - if (data->type != this->type) return; + if (data->type != this->type) { + return; + } const SettingDataFolderSave* setting_data = static_cast(data); this->value = setting_data->value; diff --git a/vkconfig_core/setting_filesystem.h b/vkconfig_core/setting_filesystem.h index ff976444da..3ef2257850 100644 --- a/vkconfig_core/setting_filesystem.h +++ b/vkconfig_core/setting_filesystem.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,12 +21,13 @@ #pragma once #include "setting_string.h" +#include "path.h" struct SettingMetaFilesystem : public SettingMeta { bool Load(const QJsonObject& json_setting) override; std::string Export(ExportMode export_mode) const override; - std::string default_value; + Path default_value; std::string filter; std::string format; @@ -36,11 +37,26 @@ struct SettingMetaFilesystem : public SettingMeta { bool Equal(const SettingMeta& other) const override; }; -struct SettingDataFilesystem : public SettingDataString { +struct SettingDataFilesystem : public SettingData { + SettingDataFilesystem(const SettingMetaFilesystem* meta); + + void Reset() override; + void Copy(const SettingData* data) override; + bool Load(const QJsonObject& json_setting) override; + bool Save(QJsonObject& json_setting) const override; std::string Export(ExportMode export_mode) const override; + const Path& GetValue() const; + void SetValue(const Path& value); + + Path value; + protected: SettingDataFilesystem(const std::string& key, const SettingType& type); + + bool Equal(const SettingData& other) const override; + + const SettingMetaFilesystem* meta; }; struct SettingMetaFileLoad : public SettingMetaFilesystem { diff --git a/vkconfig_core/setting_list.cpp b/vkconfig_core/setting_list.cpp index d1c54a3161..6e616a589a 100644 --- a/vkconfig_core/setting_list.cpp +++ b/vkconfig_core/setting_list.cpp @@ -49,7 +49,7 @@ void LoadVUIDs(std::vector& value) { } if (json_text.isEmpty()) { - json_text = ReadAll(":/layers/validusage.json"); + json_text = ReadAll(":/vkconfig/validusage.json"); } if (json_text.isEmpty()) { diff --git a/vkconfig_core/setting_string.cpp b/vkconfig_core/setting_string.cpp index 615b88d643..6d944a4785 100644 --- a/vkconfig_core/setting_string.cpp +++ b/vkconfig_core/setting_string.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,9 @@ std::string SettingMetaString::Export(ExportMode export_mode) const { } bool SettingMetaString::Equal(const SettingMeta& other) const { - if (!SettingMeta::Equal(other)) return false; + if (!SettingMeta::Equal(other)) { + return false; + } return this->default_value == static_cast(other).default_value; } diff --git a/vkconfig_core/test/CMakeLists.txt b/vkconfig_core/test/CMakeLists.txt index 62e0827767..f817f49bbc 100644 --- a/vkconfig_core/test/CMakeLists.txt +++ b/vkconfig_core/test/CMakeLists.txt @@ -8,13 +8,14 @@ function(vkConfigTest NAME) set(TEST_FILE ./${NAME}.cpp) set(TEST_NAME vkconfig_${NAME}) + file(GLOB FILES_LAYER_JSON ./layers/*.json) file(GLOB FILES_JSON ./*.json) file(GLOB FILES_TEXT ./*.txt) - source_group("Test Files" FILES ${FILES_JSON} ${FILES_TEXT}) + source_group("Test Files" FILES ${FILES_JSON} ${FILES_TEXT} ${FILES_LAYER_JSON}) add_executable(${TEST_NAME} ${TEST_FILE} ${FILES_JSON} ${FILES_TEXT} resources.qrc) - set_target_properties(${TEST_NAME} PROPERTIES FOLDER "vkconfig_core/tests") - target_link_libraries(${TEST_NAME} vkconfig_core + set_target_properties(${TEST_NAME} PROPERTIES FOLDER "vkconfig/tests") + target_link_libraries(${TEST_NAME} vkconfig-core Vulkan::LayerSettings GTest::gtest GTest::gtest_main @@ -26,6 +27,10 @@ function(vkConfigTest NAME) if(WIN32) target_link_libraries(${TEST_NAME} Cfgmgr32) endif() + if (RUN_ON_GITHUB) + target_compile_definitions(${TEST_NAME} PRIVATE RUN_ON_GITHUB) + endif() + add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME}) endfunction() @@ -36,11 +41,8 @@ vkConfigTest(test_environment) vkConfigTest(test_command_line) vkConfigTest(test_json) vkConfigTest(test_layer) -vkConfigTest(test_layer_built_in) vkConfigTest(test_layer_manager) vkConfigTest(test_layer_preset) -vkConfigTest(test_layer_type) -vkConfigTest(test_layer_state) vkConfigTest(test_setting) vkConfigTest(test_setting_type_bool) vkConfigTest(test_setting_type_bool_numeric) @@ -56,15 +58,22 @@ vkConfigTest(test_setting_type_int) vkConfigTest(test_setting_type_list) vkConfigTest(test_setting_type_string) vkConfigTest(test_header) +vkConfigTest(test_bitfield) vkConfigTest(test_parameter) vkConfigTest(test_path) -vkConfigTest(test_path_manager) -vkConfigTest(test_platform) vkConfigTest(test_configuration) vkConfigTest(test_configuration_built_in) vkConfigTest(test_configuration_manager) vkConfigTest(test_override) vkConfigTest(test_application_singleton) +vkConfigTest(test_type_hide_message) +vkConfigTest(test_type_layer_control) +vkConfigTest(test_type_layer_type) +vkConfigTest(test_type_layers_mode) +vkConfigTest(test_type_log) +vkConfigTest(test_type_platform) +vkConfigTest(test_type_status) +vkConfigTest(test_type_tab) vkConfigTest(test_vulkan) diff --git a/vkconfig_core/test/Configuration 2.2.2.json b/vkconfig_core/test/Configuration 3.0.0.json similarity index 98% rename from vkconfig_core/test/Configuration 2.2.2.json rename to vkconfig_core/test/Configuration 3.0.0.json index 7702622897..54590008bb 100644 --- a/vkconfig_core/test/Configuration 2.2.2.json +++ b/vkconfig_core/test/Configuration 3.0.0.json @@ -1,5 +1,5 @@ { - "file_format_version": "2.2.2", + "file_format_version": "3.0.0", "configuration": { "name": "All layers", "platforms": [ @@ -113,7 +113,7 @@ ] } ], - "state": "OVERRIDDEN" + "control": "on" } ] } diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_reference_1_1_0.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_reference_1_1_0.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_reference_1_1_0.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_reference_1_1_0.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_reference_1_2_0.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_reference_1_2_0.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_reference_1_2_0.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_reference_1_2_0.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_reference_1_2_1.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_reference_1_2_1.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_reference_1_2_1.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_reference_1_2_1.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_00.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_00.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_00.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_00.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_01.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_01.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_01.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_01.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_02.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_02.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_02.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_02.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_03.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_03.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_03.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_03.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_04.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_04.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_04.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_04.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_05.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_05.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_05.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_05.json diff --git a/vkconfig_core/test/VK_LAYER_LUNARG_test_06.json b/vkconfig_core/test/layers/VK_LAYER_LUNARG_test_06.json similarity index 100% rename from vkconfig_core/test/VK_LAYER_LUNARG_test_06.json rename to vkconfig_core/test/layers/VK_LAYER_LUNARG_test_06.json diff --git a/vkconfig_core/test/override_settings_2_2_2_schema_1_2_1.txt b/vkconfig_core/test/layers_settings.txt similarity index 100% rename from vkconfig_core/test/override_settings_2_2_2_schema_1_2_1.txt rename to vkconfig_core/test/layers_settings.txt diff --git a/vkconfig_core/test/override_layers_2_2_2_schema_1_2_1.json b/vkconfig_core/test/loader_settings.json similarity index 100% rename from vkconfig_core/test/override_layers_2_2_2_schema_1_2_1.json rename to vkconfig_core/test/loader_settings.json diff --git a/vkconfig_core/test/profiles/VP_KHR_roadmap.json b/vkconfig_core/test/profiles/VP_KHR_roadmap.json new file mode 100644 index 0000000000..e7a8500556 --- /dev/null +++ b/vkconfig_core/test/profiles/VP_KHR_roadmap.json @@ -0,0 +1,390 @@ +{ + "$schema": "https://schema.khronos.org/vulkan/profiles-0.8.2-276.json#", + "capabilities": { + "vulkan10requirements": { + "features": { + "VkPhysicalDeviceFeatures": { + "robustBufferAccess": true + } + } + }, + "vulkan11requirements": { + "features": { + "VkPhysicalDeviceVulkan11Features": { + "multiview": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan11Properties": { + "maxMultiviewViewCount": 6, + "maxMultiviewInstanceIndex": 134217727 + } + } + }, + "vulkan12requirements": { + "features": { + "VkPhysicalDeviceVulkan12Features": { + "uniformBufferStandardLayout": true, + "subgroupBroadcastDynamicId": true, + "imagelessFramebuffer": true, + "separateDepthStencilLayouts": true, + "hostQueryReset": true, + "timelineSemaphore": true, + "shaderSubgroupExtendedTypes": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan12Properties": { + "maxTimelineSemaphoreValueDifference": 2147483647 + } + } + }, + "vulkan13requirements": { + "features": { + "VkPhysicalDeviceVulkan12Features": { + "vulkanMemoryModel": true, + "vulkanMemoryModelDeviceScope": true, + "bufferDeviceAddress": true + }, + "VkPhysicalDeviceVulkan13Features": { + "robustImageAccess": true, + "shaderTerminateInvocation": true, + "shaderZeroInitializeWorkgroupMemory": true, + "synchronization2": true, + "shaderIntegerDotProduct": true, + "maintenance4": true, + "pipelineCreationCacheControl": true, + "subgroupSizeControl": true, + "computeFullSubgroups": true, + "shaderDemoteToHelperInvocation": true, + "inlineUniformBlock": true, + "dynamicRendering": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan13Properties": { + "maxBufferSize": 1073741824, + "maxInlineUniformBlockSize": 256, + "maxPerStageDescriptorInlineUniformBlocks": 4, + "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4, + "maxDescriptorSetInlineUniformBlocks": 4, + "maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4, + "maxInlineUniformTotalSize": 256 + } + } + }, + "vulkan10requirements_roadmap2022": { + "features": { + "VkPhysicalDeviceFeatures": { + "fullDrawIndexUint32": true, + "imageCubeArray": true, + "independentBlend": true, + "sampleRateShading": true, + "drawIndirectFirstInstance": true, + "depthClamp": true, + "depthBiasClamp": true, + "samplerAnisotropy": true, + "occlusionQueryPrecise": true, + "fragmentStoresAndAtomics": true, + "shaderStorageImageExtendedFormats": true, + "shaderUniformBufferArrayDynamicIndexing": true, + "shaderSampledImageArrayDynamicIndexing": true, + "shaderStorageBufferArrayDynamicIndexing": true, + "shaderStorageImageArrayDynamicIndexing": true + } + }, + "properties": { + "VkPhysicalDeviceProperties": { + "limits": { + "maxImageDimension1D": 8192, + "maxImageDimension2D": 8192, + "maxImageDimensionCube": 8192, + "maxImageArrayLayers": 2048, + "maxUniformBufferRange": 65536, + "bufferImageGranularity": 4096, + "maxPerStageDescriptorSamplers": 64, + "maxPerStageDescriptorUniformBuffers": 15, + "maxPerStageDescriptorStorageBuffers": 30, + "maxPerStageDescriptorSampledImages": 200, + "maxPerStageDescriptorStorageImages": 16, + "maxPerStageResources": 200, + "maxDescriptorSetSamplers": 576, + "maxDescriptorSetUniformBuffers": 90, + "maxDescriptorSetStorageBuffers": 96, + "maxDescriptorSetSampledImages": 1800, + "maxDescriptorSetStorageImages": 144, + "maxFragmentCombinedOutputResources": 16, + "maxComputeWorkGroupInvocations": 256, + "maxComputeWorkGroupSize": [ 256, 256, 64 ], + "subTexelPrecisionBits": 8, + "mipmapPrecisionBits": 6, + "maxSamplerLodBias": 14, + "standardSampleLocations": true, + "maxColorAttachments": 7 + } + } + } + }, + "vulkan10optionals_roadmap2022": { + "features": { + "VkPhysicalDeviceFeatures": { + "largePoints": true, + "wideLines": true + } + }, + "properties": { + "VkPhysicalDeviceProperties": { + "limits": { + "pointSizeGranularity": 0.125, + "lineWidthGranularity": 0.5 + } + } + } + }, + "vulkan11requirements_roadmap2022": { + "features": { + "VkPhysicalDeviceVulkan11Features": { + "samplerYcbcrConversion": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan11Properties": { + "subgroupSize": 4, + "subgroupSupportedStages": [ "VK_SHADER_STAGE_COMPUTE_BIT", "VK_SHADER_STAGE_FRAGMENT_BIT" ], + "subgroupSupportedOperations": [ "VK_SUBGROUP_FEATURE_BASIC_BIT", "VK_SUBGROUP_FEATURE_VOTE_BIT", "VK_SUBGROUP_FEATURE_ARITHMETIC_BIT", "VK_SUBGROUP_FEATURE_BALLOT_BIT", "VK_SUBGROUP_FEATURE_SHUFFLE_BIT", "VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT", "VK_SUBGROUP_FEATURE_QUAD_BIT" ] + } + } + }, + "vulkan12requirements_roadmap2022": { + "features": { + "VkPhysicalDeviceVulkan12Features": { + "samplerMirrorClampToEdge": true, + "descriptorIndexing": true, + "shaderUniformTexelBufferArrayDynamicIndexing": true, + "shaderStorageTexelBufferArrayDynamicIndexing": true, + "shaderUniformBufferArrayNonUniformIndexing": true, + "shaderSampledImageArrayNonUniformIndexing": true, + "shaderStorageBufferArrayNonUniformIndexing": true, + "shaderStorageImageArrayNonUniformIndexing": true, + "shaderUniformTexelBufferArrayNonUniformIndexing": true, + "shaderStorageTexelBufferArrayNonUniformIndexing": true, + "descriptorBindingSampledImageUpdateAfterBind": true, + "descriptorBindingStorageImageUpdateAfterBind": true, + "descriptorBindingStorageBufferUpdateAfterBind": true, + "descriptorBindingUniformTexelBufferUpdateAfterBind": true, + "descriptorBindingStorageTexelBufferUpdateAfterBind": true, + "descriptorBindingUpdateUnusedWhilePending": true, + "descriptorBindingPartiallyBound": true, + "descriptorBindingVariableDescriptorCount": true, + "runtimeDescriptorArray": true, + "scalarBlockLayout": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan12Properties": { + "shaderSignedZeroInfNanPreserveFloat16": true, + "shaderSignedZeroInfNanPreserveFloat32": true, + "maxPerStageDescriptorUpdateAfterBindSamplers": 500000, + "maxPerStageDescriptorUpdateAfterBindUniformBuffers": 12, + "maxPerStageDescriptorUpdateAfterBindStorageBuffers": 500000, + "maxPerStageDescriptorUpdateAfterBindSampledImages": 500000, + "maxPerStageDescriptorUpdateAfterBindStorageImages": 500000, + "maxPerStageDescriptorUpdateAfterBindInputAttachments": 7, + "maxPerStageUpdateAfterBindResources": 500000, + "maxDescriptorSetUpdateAfterBindSamplers": 500000, + "maxDescriptorSetUpdateAfterBindUniformBuffers": 72, + "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 8, + "maxDescriptorSetUpdateAfterBindStorageBuffers": 500000, + "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 4, + "maxDescriptorSetUpdateAfterBindSampledImages": 500000, + "maxDescriptorSetUpdateAfterBindStorageImages": 500000, + "maxDescriptorSetUpdateAfterBindInputAttachments": 7 + } + } + }, + "vulkan13requirements_roadmap2022": { + "extensions": { + "VK_KHR_global_priority": 1 + }, + "features": { + "VkPhysicalDeviceVulkan13Features": { + "descriptorBindingInlineUniformBlockUpdateAfterBind": true + } + } + }, + "vulkan10requirements_roadmap2024": { + "features": { + "VkPhysicalDeviceFeatures": { + "multiDrawIndirect": true, + "shaderInt16": true, + "shaderImageGatherExtended": true + } + }, + "properties": { + "VkPhysicalDeviceProperties": { + "limits": { + "timestampComputeAndGraphics": true, + "maxColorAttachments": 8, + "maxBoundDescriptorSets": 7 + } + } + } + }, + "vulkan11requirements_roadmap2024": { + "features": { + "VkPhysicalDeviceVulkan11Features": { + "shaderDrawParameters": true, + "storageBuffer16BitAccess": true + } + } + }, + "vulkan12requirements_roadmap2024": { + "features": { + "VkPhysicalDeviceVulkan12Features": { + "shaderInt8": true, + "shaderFloat16": true, + "storageBuffer8BitAccess": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan12Properties": { + "shaderRoundingModeRTEFloat16": true, + "shaderRoundingModeRTEFloat32": true + } + } + }, + "vulkan13requirements_roadmap2024": { + "features": { + "VkPhysicalDeviceVulkan13Features": { + } + }, + "properties": { + "VkPhysicalDeviceVulkan13Properties": { + } + } + }, + "vulkanextensionrequirements_roadmap2024": { + "extensions": { + "VK_KHR_dynamic_rendering_local_read": 1, + "VK_KHR_load_store_op_none": 1, + "VK_KHR_shader_quad_control": 1, + "VK_KHR_shader_maximal_reconvergence": 1, + "VK_KHR_shader_subgroup_uniform_control_flow": 1, + "VK_KHR_shader_subgroup_rotate": 1, + "VK_KHR_shader_float_controls2": 1, + "VK_KHR_shader_expect_assume": 1, + "VK_KHR_line_rasterization": 1, + "VK_KHR_vertex_attribute_divisor": 1, + "VK_KHR_index_type_uint8": 1, + "VK_KHR_map_memory2": 1, + "VK_KHR_maintenance5": 1, + "VK_KHR_push_descriptor": 1 + } + } + }, + "profiles": { + "VP_KHR_roadmap_2024": { + "version": 1, + "api-version": "1.3.276", + "label": "Khronos Vulkan Roadmap 2024 profile", + "description": "This roadmap profile is intended to be supported by newer devices shipping in 2024 across mainstream smartphone, tablet, laptops, console and desktop devices.", + "profiles": [ + "VP_KHR_roadmap_2022" + ], + "capabilities": [ + "vulkan10requirements_roadmap2024", + "vulkan11requirements_roadmap2024", + "vulkan12requirements_roadmap2024", + "vulkan13requirements_roadmap2024", + "vulkanextensionrequirements_roadmap2024" + ] + }, + "VP_KHR_roadmap_2022": { + "version": 1, + "api-version": "1.3.204", + "label": "Khronos Vulkan Roadmap 2022 profile", + "description": "This roadmap profile is intended to be supported by newer devices shipping in 2022 across mainstream smartphone, tablet, laptops, console and desktop devices.", + "contributors": { + "Tobias Hector": { + "company": "AMD", + "email": "tobias.hector@amd.com", + "contact": true + }, + "Christophe Riccio": { + "company": "LunarG", + "email": "christophe@lunarg.com", + "contact": true + } + }, + "history": [ + { + "revision": 9, + "date": "2024-01-16", + "author": "Tobias Hector", + "comment": "Add Roadmap 2024 profile" + }, + { + "revision": 8, + "date": "2023-11-02", + "author": "Christophe Riccio", + "comment": "Remove unreferenced capabilities blocks that were written against Vulkan 1.2 for testing before Vulkan 1.3 was released" + }, + { + "revision": 7, + "date": "2022-11-16", + "author": "Christophe Riccio", + "comment": "Fix wideLines and largePoints that are optionals" + }, + { + "revision": 6, + "date": "2022-11-02", + "author": "Christophe Riccio", + "comment": "Fix roadmap 2022 maxInlineUniformTotalSize limit, 256 instead of 4" + }, + { + "revision": 5, + "date": "2022-05-02", + "author": "Christophe Riccio", + "comment": "Add missing dynamicRendering that is a Vulkan 1.3 requirement" + }, + { + "revision": 4, + "date": "2022-03-08", + "author": "Christophe Riccio", + "comment": "Refactor requirements per Vulkan API version" + }, + { + "revision": 3, + "date": "2022-03-08", + "author": "Christophe Riccio", + "comment": "Fix Vulkan 1.3.204 API version requirement" + }, + { + "revision": 2, + "date": "2022-01-03", + "author": "Christophe Riccio", + "comment": "Rebase against Vulkan 1.3.203 revision" + }, + { + "revision": 1, + "date": "2021-12-08", + "author": "Christophe Riccio", + "comment": "Initial revision" + } + ], + "capabilities": [ + "vulkan10requirements", + "vulkan10requirements_roadmap2022", + "vulkan11requirements", + "vulkan11requirements_roadmap2022", + "vulkan12requirements", + "vulkan12requirements_roadmap2022", + "vulkan13requirements", + "vulkan13requirements_roadmap2022" + ], + "optionals": [ + "vulkan10optionals_roadmap2022" + ] + } + } +} diff --git a/vkconfig_core/test/profiles/VP_LUNARG_desktop_baseline.json b/vkconfig_core/test/profiles/VP_LUNARG_desktop_baseline.json new file mode 100644 index 0000000000..dcfb010de3 --- /dev/null +++ b/vkconfig_core/test/profiles/VP_LUNARG_desktop_baseline.json @@ -0,0 +1,6080 @@ +{ + "$schema": "https://schema.khronos.org/vulkan/profiles-config-latest.json#", + "capabilities": { + "VP_LUNARG_desktop_baseline_2022_block": { + "extensions": { + "VK_EXT_descriptor_indexing": 2, + "VK_EXT_host_query_reset": 1, + "VK_EXT_inline_uniform_block": 1, + "VK_EXT_memory_budget": 1, + "VK_EXT_robustness2": 1, + "VK_EXT_scalar_block_layout": 1, + "VK_EXT_subgroup_size_control": 2, + "VK_EXT_texel_buffer_alignment": 1, + "VK_EXT_vertex_attribute_divisor": 3, + "VK_KHR_16bit_storage": 1, + "VK_KHR_8bit_storage": 1, + "VK_KHR_bind_memory2": 1, + "VK_KHR_create_renderpass2": 1, + "VK_KHR_dedicated_allocation": 3, + "VK_KHR_depth_stencil_resolve": 1, + "VK_KHR_descriptor_update_template": 1, + "VK_KHR_device_group": 4, + "VK_KHR_driver_properties": 1, + "VK_KHR_external_fence": 1, + "VK_KHR_external_memory": 1, + "VK_KHR_external_semaphore": 1, + "VK_KHR_get_memory_requirements2": 1, + "VK_KHR_image_format_list": 1, + "VK_KHR_maintenance1": 2, + "VK_KHR_maintenance2": 1, + "VK_KHR_maintenance3": 1, + "VK_KHR_multiview": 1, + "VK_KHR_relaxed_block_layout": 1, + "VK_KHR_sampler_mirror_clamp_to_edge": 3, + "VK_KHR_shader_draw_parameters": 1, + "VK_KHR_shader_float16_int8": 1, + "VK_KHR_storage_buffer_storage_class": 1, + "VK_KHR_swapchain": 70, + "VK_KHR_swapchain_mutable_format": 1, + "VK_KHR_timeline_semaphore": 2, + "VK_KHR_uniform_buffer_standard_layout": 1, + "VK_KHR_variable_pointers": 1 + }, + "features": { + "VkPhysicalDevice16BitStorageFeaturesKHR": { + "storageBuffer16BitAccess": true, + "uniformAndStorageBuffer16BitAccess": true + }, + "VkPhysicalDevice8BitStorageFeaturesKHR": { + "storageBuffer8BitAccess": true, + "uniformAndStorageBuffer8BitAccess": true + }, + "VkPhysicalDeviceDescriptorIndexingFeaturesEXT": { + "shaderUniformTexelBufferArrayDynamicIndexing": true, + "shaderStorageTexelBufferArrayDynamicIndexing": true, + "shaderSampledImageArrayNonUniformIndexing": true, + "shaderUniformTexelBufferArrayNonUniformIndexing": true, + "descriptorBindingSampledImageUpdateAfterBind": true, + "descriptorBindingStorageImageUpdateAfterBind": true, + "descriptorBindingStorageBufferUpdateAfterBind": true, + "descriptorBindingUniformTexelBufferUpdateAfterBind": true, + "descriptorBindingStorageTexelBufferUpdateAfterBind": true, + "descriptorBindingUpdateUnusedWhilePending": true, + "descriptorBindingPartiallyBound": true, + "descriptorBindingVariableDescriptorCount": true, + "runtimeDescriptorArray": true + }, + "VkPhysicalDeviceFeatures": { + "depthBiasClamp": true, + "depthClamp": true, + "drawIndirectFirstInstance": true, + "dualSrcBlend": true, + "fillModeNonSolid": true, + "fragmentStoresAndAtomics": true, + "fullDrawIndexUint32": true, + "imageCubeArray": true, + "independentBlend": true, + "inheritedQueries": true, + "largePoints": true, + "multiDrawIndirect": true, + "multiViewport": true, + "occlusionQueryPrecise": true, + "robustBufferAccess": true, + "sampleRateShading": true, + "samplerAnisotropy": true, + "shaderClipDistance": true, + "shaderImageGatherExtended": true, + "shaderSampledImageArrayDynamicIndexing": true, + "shaderStorageBufferArrayDynamicIndexing": true, + "shaderStorageImageArrayDynamicIndexing": true, + "shaderStorageImageExtendedFormats": true, + "shaderStorageImageWriteWithoutFormat": true, + "shaderTessellationAndGeometryPointSize": true, + "shaderUniformBufferArrayDynamicIndexing": true, + "tessellationShader": true, + "textureCompressionBC": true, + "vertexPipelineStoresAndAtomics": true + }, + "VkPhysicalDeviceFloat16Int8FeaturesKHR": { + "shaderInt8": true + }, + "VkPhysicalDeviceHostQueryResetFeaturesEXT": { + "hostQueryReset": true + }, + "VkPhysicalDeviceInlineUniformBlockFeaturesEXT": { + "inlineUniformBlock": true, + "descriptorBindingInlineUniformBlockUpdateAfterBind": true + }, + "VkPhysicalDeviceMultiviewFeaturesKHR": { + "multiview": true + }, + "VkPhysicalDeviceRobustness2FeaturesEXT": { + "robustImageAccess2": true + }, + "VkPhysicalDeviceScalarBlockLayoutFeaturesEXT": { + "scalarBlockLayout": true + }, + "VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT": { + "texelBufferAlignment": true + }, + "VkPhysicalDeviceTimelineSemaphoreFeaturesKHR": { + "timelineSemaphore": true + }, + "VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR": { + "uniformBufferStandardLayout": true + }, + "VkPhysicalDeviceVariablePointersFeaturesKHR": { + "variablePointersStorageBuffer": true, + "variablePointers": true + }, + "VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT": { + "vertexAttributeInstanceRateDivisor": true, + "vertexAttributeInstanceRateZeroDivisor": true + } + }, + "properties": { + "VkPhysicalDeviceDepthStencilResolvePropertiesKHR": { + "independentResolve": true, + "independentResolveNone": true, + "supportedDepthResolveModes": [ + "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT" + ], + "supportedStencilResolveModes": [ + "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT" + ] + }, + "VkPhysicalDeviceDescriptorIndexingPropertiesEXT": { + "maxDescriptorSetUpdateAfterBindInputAttachments": 256, + "maxDescriptorSetUpdateAfterBindSampledImages": 640, + "maxDescriptorSetUpdateAfterBindSamplers": 80, + "maxDescriptorSetUpdateAfterBindStorageBuffers": 155, + "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 8, + "maxDescriptorSetUpdateAfterBindStorageImages": 40, + "maxDescriptorSetUpdateAfterBindUniformBuffers": 90, + "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 8, + "maxPerStageDescriptorUpdateAfterBindInputAttachments": 64, + "maxPerStageDescriptorUpdateAfterBindSampledImages": 128, + "maxPerStageDescriptorUpdateAfterBindSamplers": 16, + "maxPerStageDescriptorUpdateAfterBindStorageBuffers": 31, + "maxPerStageDescriptorUpdateAfterBindStorageImages": 8, + "maxPerStageDescriptorUpdateAfterBindUniformBuffers": 15, + "maxPerStageUpdateAfterBindResources": 159, + "maxUpdateAfterBindDescriptorsInAllPools": 1048576, + "robustBufferAccessUpdateAfterBind": true + }, + "VkPhysicalDeviceInlineUniformBlockPropertiesEXT": { + "maxDescriptorSetInlineUniformBlocks": 4, + "maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4, + "maxInlineUniformBlockSize": 256, + "maxPerStageDescriptorInlineUniformBlocks": 4, + "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4 + }, + "VkPhysicalDeviceMaintenance3PropertiesKHR": { + "maxMemoryAllocationSize": 2147483648, + "maxPerSetDescriptors": 700 + }, + "VkPhysicalDeviceMultiviewPropertiesKHR": { + "maxMultiviewInstanceIndex": 134217727, + "maxMultiviewViewCount": 6 + }, + "VkPhysicalDeviceProperties": { + "sparseProperties": {}, + "limits": { + "bufferImageGranularity": 65536, + "discreteQueuePriorities": 2, + "framebufferColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferNoAttachmentsSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "lineWidthGranularity": 1.0, + "maxBoundDescriptorSets": 8, + "maxClipDistances": 8, + "maxColorAttachments": 8, + "maxCombinedClipAndCullDistances": 8, + "maxComputeSharedMemorySize": 32768, + "maxComputeWorkGroupInvocations": 1024, + "maxCullDistances": 0, + "maxDescriptorSetInputAttachments": 7, + "maxDescriptorSetSampledImages": 640, + "maxDescriptorSetSamplers": 80, + "maxDescriptorSetStorageBuffers": 155, + "maxDescriptorSetStorageBuffersDynamic": 8, + "maxDescriptorSetStorageImages": 40, + "maxDescriptorSetUniformBuffers": 90, + "maxDescriptorSetUniformBuffersDynamic": 8, + "maxDrawIndexedIndexValue": 4294967294, + "maxDrawIndirectCount": 1073741824, + "maxFragmentCombinedOutputResources": 8, + "maxFragmentDualSrcAttachments": 1, + "maxFragmentInputComponents": 116, + "maxFragmentOutputAttachments": 8, + "maxFramebufferHeight": 16384, + "maxFramebufferLayers": 1024, + "maxFramebufferWidth": 16384, + "maxGeometryInputComponents": 0, + "maxGeometryOutputComponents": 0, + "maxGeometryOutputVertices": 0, + "maxGeometryShaderInvocations": 0, + "maxGeometryTotalOutputComponents": 0, + "maxImageArrayLayers": 2048, + "maxImageDimension1D": 16384, + "maxImageDimension2D": 16384, + "maxImageDimension3D": 2048, + "maxImageDimensionCube": 16384, + "maxInterpolationOffset": 0.4375, + "maxMemoryAllocationCount": 4096, + "maxPerStageDescriptorInputAttachments": 7, + "maxPerStageDescriptorSampledImages": 128, + "maxPerStageDescriptorSamplers": 16, + "maxPerStageDescriptorStorageBuffers": 31, + "maxPerStageDescriptorStorageImages": 8, + "maxPerStageDescriptorUniformBuffers": 15, + "maxPerStageResources": 159, + "maxPushConstantsSize": 128, + "maxSampleMaskWords": 1, + "maxSamplerAllocationCount": 1024, + "maxSamplerAnisotropy": 16, + "maxSamplerLodBias": 0.0, + "maxStorageBufferRange": 1073741820, + "maxTessellationControlPerPatchOutputComponents": 120, + "maxTessellationControlPerVertexInputComponents": 124, + "maxTessellationControlPerVertexOutputComponents": 124, + "maxTessellationControlTotalOutputComponents": 2048, + "maxTessellationEvaluationInputComponents": 124, + "maxTessellationEvaluationOutputComponents": 124, + "maxTessellationGenerationLevel": 64, + "maxTessellationPatchSize": 32, + "maxTexelBufferElements": 67108864, + "maxTexelGatherOffset": 7, + "maxTexelOffset": 7, + "maxUniformBufferRange": 65536, + "maxVertexInputAttributeOffset": 2047, + "maxVertexInputAttributes": 28, + "maxVertexInputBindingStride": 2048, + "maxVertexInputBindings": 28, + "maxVertexOutputComponents": 124, + "maxViewports": 16, + "minInterpolationOffset": -0.5, + "minMemoryMapAlignment": 4096, + "minStorageBufferOffsetAlignment": 64, + "minTexelBufferOffsetAlignment": 256, + "minTexelGatherOffset": -8, + "minTexelOffset": -8, + "minUniformBufferOffsetAlignment": 256, + "mipmapPrecisionBits": 4, + "nonCoherentAtomSize": 256, + "optimalBufferCopyOffsetAlignment": 256, + "optimalBufferCopyRowPitchAlignment": 128, + "pointSizeGranularity": 1, + "sampledImageColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageIntegerSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sparseAddressSpaceSize": 0, + "storageImageSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT" + ], + "subPixelInterpolationOffsetBits": 4, + "subPixelPrecisionBits": 4, + "subTexelPrecisionBits": 4, + "timestampComputeAndGraphics": true, + "viewportSubPixelBits": 0, + "maxComputeWorkGroupCount": [ + 65535, + 65535, + 65535 + ], + "maxViewportDimensions": [ + 16384, + 16384 + ], + "pointSizeRange": [ + 1, + 64 + ], + "viewportBoundsRange": [ + -32768, + 32767 + ], + "lineWidthRange": [ + 1, + 1 + ] + } + }, + "VkPhysicalDeviceRobustness2PropertiesEXT": { + "robustStorageBufferAccessSizeAlignment": 4, + "robustUniformBufferAccessSizeAlignment": 256 + }, + "VkPhysicalDeviceSubgroupSizeControlPropertiesEXT": { + "maxComputeWorkgroupSubgroups": 16, + "maxSubgroupSize": 1, + "minSubgroupSize": 64, + "requiredSubgroupSizeStages": [] + }, + "VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT": { + "storageTexelBufferOffsetAlignmentBytes": 256, + "uniformTexelBufferOffsetAlignmentBytes": 256 + }, + "VkPhysicalDeviceTimelineSemaphorePropertiesKHR": { + "maxTimelineSemaphoreValueDifference": 2147483647 + }, + "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT": { + "maxVertexAttribDivisor": 268435455 + } + }, + "formats": { + "VK_FORMAT_A2B10G10R10_SNORM_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_UINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2R10G10B10_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SRGB_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SSCALED_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_UINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_USCALED_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_B10G11R11_UFLOAT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_B8G8R8A8_SRGB": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_B8G8R8A8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGBA_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGBA_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGB_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGB_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC2_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC2_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC3_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC3_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC4_SNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC4_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC5_SNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC5_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC6H_SFLOAT_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC6H_UFLOAT_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC7_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC7_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D16_UNORM": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D32_SFLOAT": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D32_SFLOAT_S8_UINT": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_SFLOAT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_SINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_UINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SRGB": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + } + } + }, + "VP_LUNARG_desktop_baseline_2023_block": { + "extensions": { + "VK_EXT_descriptor_indexing": 2, + "VK_EXT_host_query_reset": 1, + "VK_EXT_image_robustness": 1, + "VK_EXT_inline_uniform_block": 1, + "VK_EXT_memory_budget": 1, + "VK_EXT_robustness2": 1, + "VK_EXT_subgroup_size_control": 2, + "VK_EXT_texel_buffer_alignment": 1, + "VK_EXT_vertex_attribute_divisor": 3, + "VK_KHR_16bit_storage": 1, + "VK_KHR_8bit_storage": 1, + "VK_KHR_bind_memory2": 1, + "VK_KHR_create_renderpass2": 1, + "VK_KHR_dedicated_allocation": 3, + "VK_KHR_depth_stencil_resolve": 1, + "VK_KHR_descriptor_update_template": 1, + "VK_KHR_device_group": 4, + "VK_KHR_driver_properties": 1, + "VK_KHR_external_fence": 1, + "VK_KHR_external_memory": 1, + "VK_KHR_external_semaphore": 1, + "VK_KHR_get_memory_requirements2": 1, + "VK_KHR_image_format_list": 1, + "VK_KHR_imageless_framebuffer": 1, + "VK_KHR_maintenance1": 2, + "VK_KHR_maintenance2": 1, + "VK_KHR_maintenance3": 1, + "VK_KHR_multiview": 1, + "VK_KHR_relaxed_block_layout": 1, + "VK_KHR_sampler_mirror_clamp_to_edge": 3, + "VK_KHR_separate_depth_stencil_layouts": 1, + "VK_KHR_shader_draw_parameters": 1, + "VK_KHR_shader_float16_int8": 1, + "VK_KHR_shader_float_controls": 4, + "VK_KHR_spirv_1_4": 1, + "VK_KHR_storage_buffer_storage_class": 1, + "VK_KHR_swapchain": 70, + "VK_KHR_swapchain_mutable_format": 1, + "VK_KHR_timeline_semaphore": 2, + "VK_KHR_uniform_buffer_standard_layout": 1, + "VK_KHR_variable_pointers": 1 + }, + "features": { + "VkPhysicalDeviceFeatures": { + "depthBiasClamp": true, + "depthClamp": true, + "drawIndirectFirstInstance": true, + "dualSrcBlend": true, + "fillModeNonSolid": true, + "fragmentStoresAndAtomics": true, + "fullDrawIndexUint32": true, + "imageCubeArray": true, + "independentBlend": true, + "inheritedQueries": true, + "largePoints": true, + "multiDrawIndirect": true, + "multiViewport": true, + "occlusionQueryPrecise": true, + "robustBufferAccess": true, + "sampleRateShading": true, + "samplerAnisotropy": true, + "shaderClipDistance": true, + "shaderImageGatherExtended": true, + "shaderSampledImageArrayDynamicIndexing": true, + "shaderStorageBufferArrayDynamicIndexing": true, + "shaderStorageImageArrayDynamicIndexing": true, + "shaderStorageImageExtendedFormats": true, + "shaderStorageImageWriteWithoutFormat": true, + "shaderTessellationAndGeometryPointSize": true, + "shaderUniformBufferArrayDynamicIndexing": true, + "tessellationShader": true, + "textureCompressionBC": true, + "vertexPipelineStoresAndAtomics": true + }, + "VkPhysicalDeviceImageRobustnessFeaturesEXT": { + "robustImageAccess": true + }, + "VkPhysicalDeviceInlineUniformBlockFeaturesEXT": { + "inlineUniformBlock": true, + "descriptorBindingInlineUniformBlockUpdateAfterBind": true + }, + "VkPhysicalDeviceRobustness2FeaturesEXT": { + "robustImageAccess2": true + }, + "VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT": { + "texelBufferAlignment": true + }, + "VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT": { + "vertexAttributeInstanceRateDivisor": true, + "vertexAttributeInstanceRateZeroDivisor": true + }, + "VkPhysicalDeviceVulkan11Features": { + "storageBuffer16BitAccess": true, + "uniformAndStorageBuffer16BitAccess": true, + "multiview": true, + "variablePointersStorageBuffer": true, + "variablePointers": true, + "protectedMemory": false, + "shaderDrawParameters": true + }, + "VkPhysicalDeviceVulkan12Features": { + "samplerMirrorClampToEdge": true, + "storageBuffer8BitAccess": true, + "uniformAndStorageBuffer8BitAccess": true, + "shaderInt8": true, + "descriptorIndexing": true, + "shaderUniformTexelBufferArrayDynamicIndexing": true, + "shaderStorageTexelBufferArrayDynamicIndexing": true, + "shaderSampledImageArrayNonUniformIndexing": true, + "shaderUniformTexelBufferArrayNonUniformIndexing": true, + "descriptorBindingSampledImageUpdateAfterBind": true, + "descriptorBindingStorageImageUpdateAfterBind": true, + "descriptorBindingStorageBufferUpdateAfterBind": true, + "descriptorBindingUniformTexelBufferUpdateAfterBind": true, + "descriptorBindingStorageTexelBufferUpdateAfterBind": true, + "descriptorBindingUpdateUnusedWhilePending": true, + "descriptorBindingPartiallyBound": true, + "descriptorBindingVariableDescriptorCount": true, + "runtimeDescriptorArray": true, + "imagelessFramebuffer": true, + "uniformBufferStandardLayout": true, + "separateDepthStencilLayouts": true, + "hostQueryReset": true, + "timelineSemaphore": true + } + }, + "properties": { + "VkPhysicalDeviceProperties": { + "sparseProperties": {}, + "limits": { + "bufferImageGranularity": 65536, + "discreteQueuePriorities": 2, + "framebufferColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferNoAttachmentsSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "maxBoundDescriptorSets": 8, + "maxClipDistances": 8, + "maxColorAttachments": 8, + "maxCombinedClipAndCullDistances": 8, + "maxComputeSharedMemorySize": 32768, + "maxComputeWorkGroupInvocations": 1024, + "maxCullDistances": 0, + "maxDescriptorSetInputAttachments": 7, + "maxDescriptorSetSampledImages": 640, + "maxDescriptorSetSamplers": 80, + "maxDescriptorSetStorageBuffers": 155, + "maxDescriptorSetStorageBuffersDynamic": 8, + "maxDescriptorSetStorageImages": 40, + "maxDescriptorSetUniformBuffers": 90, + "maxDescriptorSetUniformBuffersDynamic": 8, + "maxDrawIndexedIndexValue": 4294967295, + "maxDrawIndirectCount": 1073741824, + "maxFragmentCombinedOutputResources": 8, + "maxFragmentDualSrcAttachments": 1, + "maxFragmentInputComponents": 116, + "maxFragmentOutputAttachments": 8, + "maxFramebufferHeight": 16384, + "maxFramebufferLayers": 1024, + "maxFramebufferWidth": 16384, + "maxGeometryInputComponents": 0, + "maxGeometryOutputComponents": 0, + "maxGeometryOutputVertices": 0, + "maxGeometryShaderInvocations": 0, + "maxGeometryTotalOutputComponents": 0, + "maxImageArrayLayers": 2048, + "maxImageDimension1D": 16384, + "maxImageDimension2D": 16384, + "maxImageDimension3D": 2048, + "maxImageDimensionCube": 16384, + "maxInterpolationOffset": 0.4375, + "maxMemoryAllocationCount": 4096, + "maxPerStageDescriptorInputAttachments": 7, + "maxPerStageDescriptorSampledImages": 128, + "maxPerStageDescriptorSamplers": 16, + "maxPerStageDescriptorStorageBuffers": 31, + "maxPerStageDescriptorStorageImages": 8, + "maxPerStageDescriptorUniformBuffers": 15, + "maxPerStageResources": 159, + "maxPushConstantsSize": 128, + "maxSampleMaskWords": 1, + "maxSamplerAllocationCount": 4000, + "maxSamplerAnisotropy": 16, + "maxSamplerLodBias": 4, + "maxStorageBufferRange": 1073741820, + "maxTessellationControlPerPatchOutputComponents": 120, + "maxTessellationControlPerVertexInputComponents": 124, + "maxTessellationControlPerVertexOutputComponents": 124, + "maxTessellationControlTotalOutputComponents": 2048, + "maxTessellationEvaluationInputComponents": 124, + "maxTessellationEvaluationOutputComponents": 124, + "maxTessellationGenerationLevel": 64, + "maxTessellationPatchSize": 32, + "maxTexelBufferElements": 67108864, + "maxTexelGatherOffset": 7, + "maxTexelOffset": 7, + "maxUniformBufferRange": 65536, + "maxVertexInputAttributeOffset": 2047, + "maxVertexInputAttributes": 28, + "maxVertexInputBindingStride": 2048, + "maxVertexInputBindings": 28, + "maxVertexOutputComponents": 124, + "maxViewports": 16, + "minInterpolationOffset": -0.5, + "minMemoryMapAlignment": 4096, + "minStorageBufferOffsetAlignment": 64, + "minTexelBufferOffsetAlignment": 256, + "minTexelGatherOffset": -8, + "minTexelOffset": -8, + "minUniformBufferOffsetAlignment": 256, + "mipmapPrecisionBits": 4, + "nonCoherentAtomSize": 256, + "optimalBufferCopyOffsetAlignment": 256, + "optimalBufferCopyRowPitchAlignment": 128, + "pointSizeGranularity": 1, + "sampledImageColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageIntegerSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sparseAddressSpaceSize": 0, + "storageImageSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT" + ], + "subPixelInterpolationOffsetBits": 4, + "subPixelPrecisionBits": 4, + "subTexelPrecisionBits": 4, + "timestampComputeAndGraphics": true, + "viewportSubPixelBits": 0, + "maxComputeWorkGroupCount": [ + 65535, + 65535, + 65535 + ], + "maxComputeWorkGroupSize": [ + 1024, + 1024, + 64 + ], + "maxViewportDimensions": [ + 16384, + 16384 + ], + "pointSizeRange": [ + 1, + 64 + ], + "viewportBoundsRange": [ + -32768, + 32767 + ], + "lineWidthGranularity": 1.0, + "lineWidthRange": [ + 1, + 1 + ] + } + }, + "VkPhysicalDeviceVulkan11Properties": { + "subgroupSize": 1, + "subgroupSupportedStages": [ + "VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT", + "VK_SHADER_STAGE_FRAGMENT_BIT", + "VK_SHADER_STAGE_COMPUTE_BIT" + ], + "subgroupSupportedOperations": [ + "VK_SUBGROUP_FEATURE_BASIC_BIT" + ], + "maxMultiviewViewCount": 6, + "maxMultiviewInstanceIndex": 134217727, + "maxPerSetDescriptors": 700, + "maxMemoryAllocationSize": 1610612736 + }, + "VkPhysicalDeviceVulkan12Properties": { + "shaderSignedZeroInfNanPreserveFloat32": true, + "maxUpdateAfterBindDescriptorsInAllPools": 1048576, + "maxPerStageDescriptorUpdateAfterBindSamplers": 16, + "maxPerStageDescriptorUpdateAfterBindUniformBuffers": 15, + "maxPerStageDescriptorUpdateAfterBindStorageBuffers": 31, + "maxPerStageDescriptorUpdateAfterBindSampledImages": 128, + "maxPerStageDescriptorUpdateAfterBindStorageImages": 8, + "maxPerStageDescriptorUpdateAfterBindInputAttachments": 64, + "maxPerStageUpdateAfterBindResources": 159, + "maxDescriptorSetUpdateAfterBindSamplers": 80, + "maxDescriptorSetUpdateAfterBindUniformBuffers": 90, + "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 8, + "maxDescriptorSetUpdateAfterBindStorageBuffers": 155, + "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 8, + "maxDescriptorSetUpdateAfterBindSampledImages": 640, + "maxDescriptorSetUpdateAfterBindStorageImages": 40, + "maxDescriptorSetUpdateAfterBindInputAttachments": 256, + "supportedDepthResolveModes": [ + "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT" + ], + "supportedStencilResolveModes": [ + "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT" + ], + "independentResolveNone": true, + "independentResolve": true, + "maxTimelineSemaphoreValueDifference": 0, + "framebufferIntegerColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT" + ] + } + }, + "formats": { + "VK_FORMAT_A2B10G10R10_SNORM_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_UINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2R10G10B10_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SRGB_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SSCALED_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_UINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_USCALED_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_B10G11R11_UFLOAT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_B8G8R8A8_SRGB": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_B8G8R8A8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGBA_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGBA_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGB_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGB_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC2_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC2_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC3_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC3_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC4_SNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC4_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC5_SNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC5_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC6H_SFLOAT_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC6H_UFLOAT_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC7_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC7_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D16_UNORM": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D32_SFLOAT": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D32_SFLOAT_S8_UINT": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_SFLOAT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_SINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_UINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SRGB": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + } + } + }, + "VP_LUNARG_desktop_baseline_2024_block": { + "extensions": { + "VK_EXT_4444_formats": 1, + "VK_EXT_calibrated_timestamps": 2, + "VK_EXT_descriptor_indexing": 2, + "VK_EXT_extended_dynamic_state": 1, + "VK_EXT_extended_dynamic_state2": 1, + "VK_EXT_external_memory_host": 1, + "VK_EXT_host_query_reset": 1, + "VK_EXT_image_robustness": 1, + "VK_EXT_inline_uniform_block": 1, + "VK_EXT_memory_budget": 1, + "VK_EXT_pipeline_creation_cache_control": 3, + "VK_EXT_pipeline_creation_feedback": 1, + "VK_EXT_private_data": 1, + "VK_EXT_robustness2": 1, + "VK_EXT_scalar_block_layout": 1, + "VK_EXT_separate_stencil_usage": 1, + "VK_EXT_shader_atomic_float": 1, + "VK_EXT_shader_demote_to_helper_invocation": 1, + "VK_EXT_shader_subgroup_ballot": 1, + "VK_EXT_shader_subgroup_vote": 1, + "VK_EXT_shader_viewport_index_layer": 1, + "VK_EXT_subgroup_size_control": 2, + "VK_EXT_texel_buffer_alignment": 1, + "VK_EXT_vertex_attribute_divisor": 3, + "VK_KHR_16bit_storage": 1, + "VK_KHR_8bit_storage": 1, + "VK_KHR_bind_memory2": 1, + "VK_KHR_buffer_device_address": 1, + "VK_KHR_copy_commands2": 1, + "VK_KHR_create_renderpass2": 1, + "VK_KHR_dedicated_allocation": 3, + "VK_KHR_depth_stencil_resolve": 1, + "VK_KHR_descriptor_update_template": 1, + "VK_KHR_device_group": 4, + "VK_KHR_driver_properties": 1, + "VK_KHR_dynamic_rendering": 1, + "VK_KHR_external_fence": 1, + "VK_KHR_external_memory": 1, + "VK_KHR_external_semaphore": 1, + "VK_KHR_format_feature_flags2": 2, + "VK_KHR_get_memory_requirements2": 1, + "VK_KHR_image_format_list": 1, + "VK_KHR_imageless_framebuffer": 1, + "VK_KHR_maintenance1": 2, + "VK_KHR_maintenance2": 1, + "VK_KHR_maintenance3": 1, + "VK_KHR_multiview": 1, + "VK_KHR_push_descriptor": 2, + "VK_KHR_relaxed_block_layout": 1, + "VK_KHR_sampler_mirror_clamp_to_edge": 3, + "VK_KHR_separate_depth_stencil_layouts": 1, + "VK_KHR_shader_draw_parameters": 1, + "VK_KHR_shader_float16_int8": 1, + "VK_KHR_shader_float_controls": 4, + "VK_KHR_shader_non_semantic_info": 1, + "VK_KHR_shader_subgroup_extended_types": 1, + "VK_KHR_spirv_1_4": 1, + "VK_KHR_storage_buffer_storage_class": 1, + "VK_KHR_swapchain": 70, + "VK_KHR_swapchain_mutable_format": 1, + "VK_KHR_synchronization2": 1, + "VK_KHR_timeline_semaphore": 2, + "VK_KHR_uniform_buffer_standard_layout": 1, + "VK_KHR_variable_pointers": 1 + }, + "features": { + "VkPhysicalDevice4444FormatsFeaturesEXT": { + "formatA4R4G4B4": true + }, + "VkPhysicalDeviceExtendedDynamicState2FeaturesEXT": { + "extendedDynamicState2": true + }, + "VkPhysicalDeviceExtendedDynamicStateFeaturesEXT": { + "extendedDynamicState": true + }, + "VkPhysicalDeviceFeatures": { + "depthBiasClamp": true, + "depthClamp": true, + "drawIndirectFirstInstance": true, + "dualSrcBlend": true, + "fillModeNonSolid": true, + "fragmentStoresAndAtomics": true, + "fullDrawIndexUint32": true, + "imageCubeArray": true, + "independentBlend": true, + "inheritedQueries": true, + "largePoints": true, + "multiDrawIndirect": true, + "multiViewport": true, + "occlusionQueryPrecise": true, + "robustBufferAccess": true, + "sampleRateShading": true, + "samplerAnisotropy": true, + "shaderClipDistance": true, + "shaderImageGatherExtended": true, + "shaderInt16": true, + "shaderSampledImageArrayDynamicIndexing": true, + "shaderStorageBufferArrayDynamicIndexing": true, + "shaderStorageImageArrayDynamicIndexing": true, + "shaderStorageImageExtendedFormats": true, + "shaderStorageImageWriteWithoutFormat": true, + "shaderTessellationAndGeometryPointSize": true, + "shaderUniformBufferArrayDynamicIndexing": true, + "tessellationShader": true, + "textureCompressionBC": true, + "vertexPipelineStoresAndAtomics": true + }, + "VkPhysicalDeviceRobustness2FeaturesEXT": { + "robustImageAccess2": true + }, + "VkPhysicalDeviceShaderAtomicFloatFeaturesEXT": { + "shaderBufferFloat32Atomics": true, + "shaderSharedFloat32Atomics": true + }, + "VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT": { + "texelBufferAlignment": true + }, + "VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT": { + "vertexAttributeInstanceRateDivisor": true, + "vertexAttributeInstanceRateZeroDivisor": true + }, + "VkPhysicalDeviceVulkan11Features": { + "storageBuffer16BitAccess": true, + "uniformAndStorageBuffer16BitAccess": true, + "multiview": true, + "variablePointersStorageBuffer": true, + "variablePointers": true, + "protectedMemory": false, + "shaderDrawParameters": true + }, + "VkPhysicalDeviceVulkan12Features": { + "samplerMirrorClampToEdge": true, + "storageBuffer8BitAccess": true, + "uniformAndStorageBuffer8BitAccess": true, + "shaderInt8": true, + "descriptorIndexing": true, + "shaderUniformTexelBufferArrayDynamicIndexing": true, + "shaderStorageTexelBufferArrayDynamicIndexing": true, + "shaderSampledImageArrayNonUniformIndexing": true, + "shaderStorageBufferArrayNonUniformIndexing": true, + "shaderStorageImageArrayNonUniformIndexing": true, + "shaderUniformTexelBufferArrayNonUniformIndexing": true, + "shaderStorageTexelBufferArrayNonUniformIndexing": true, + "descriptorBindingSampledImageUpdateAfterBind": true, + "descriptorBindingStorageImageUpdateAfterBind": true, + "descriptorBindingStorageBufferUpdateAfterBind": true, + "descriptorBindingUniformTexelBufferUpdateAfterBind": true, + "descriptorBindingStorageTexelBufferUpdateAfterBind": true, + "descriptorBindingUpdateUnusedWhilePending": true, + "descriptorBindingPartiallyBound": true, + "descriptorBindingVariableDescriptorCount": true, + "runtimeDescriptorArray": true, + "scalarBlockLayout": true, + "imagelessFramebuffer": true, + "uniformBufferStandardLayout": true, + "shaderSubgroupExtendedTypes": true, + "separateDepthStencilLayouts": true, + "hostQueryReset": true, + "timelineSemaphore": true, + "bufferDeviceAddress": true, + "shaderOutputViewportIndex": true, + "shaderOutputLayer": true, + "subgroupBroadcastDynamicId": true + } + }, + "properties": { + "VkPhysicalDeviceExternalMemoryHostPropertiesEXT": { + "minImportedHostPointerAlignment": 4096 + }, + "VkPhysicalDeviceFloatControlsPropertiesKHR": { + "shaderDenormPreserveFloat16": true, + "shaderRoundingModeRTEFloat16": true, + "shaderRoundingModeRTEFloat32": true, + "shaderRoundingModeRTEFloat64": true, + "shaderRoundingModeRTZFloat32": true, + "shaderRoundingModeRTZFloat64": true, + "shaderSignedZeroInfNanPreserveFloat16": true, + "shaderSignedZeroInfNanPreserveFloat32": true, + "shaderSignedZeroInfNanPreserveFloat64": true + }, + "VkPhysicalDeviceInlineUniformBlockPropertiesEXT": { + "maxDescriptorSetInlineUniformBlocks": 4, + "maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4, + "maxInlineUniformBlockSize": 256, + "maxPerStageDescriptorInlineUniformBlocks": 4, + "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4 + }, + "VkPhysicalDeviceProperties": { + "sparseProperties": { + "residencyAlignedMipSize": false + }, + "limits": { + "bufferImageGranularity": 1024, + "discreteQueuePriorities": 2, + "framebufferColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferNoAttachmentsSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "lineWidthGranularity": 0.125, + "maxBoundDescriptorSets": 8, + "maxClipDistances": 8, + "maxColorAttachments": 8, + "maxCombinedClipAndCullDistances": 8, + "maxComputeSharedMemorySize": 32768, + "maxComputeWorkGroupInvocations": 1024, + "maxCullDistances": 0, + "maxDescriptorSetInputAttachments": 7, + "maxDescriptorSetSampledImages": 640, + "maxDescriptorSetSamplers": 80, + "maxDescriptorSetStorageBuffers": 155, + "maxDescriptorSetStorageBuffersDynamic": 8, + "maxDescriptorSetStorageImages": 40, + "maxDescriptorSetUniformBuffers": 155, + "maxDescriptorSetUniformBuffersDynamic": 8, + "maxDrawIndexedIndexValue": 4294967295, + "maxDrawIndirectCount": 1073741824, + "maxFragmentCombinedOutputResources": 16, + "maxFragmentDualSrcAttachments": 1, + "maxFragmentInputComponents": 116, + "maxFragmentOutputAttachments": 8, + "maxFramebufferHeight": 16384, + "maxFramebufferLayers": 1024, + "maxFramebufferWidth": 16384, + "maxGeometryInputComponents": 0, + "maxGeometryOutputComponents": 0, + "maxGeometryOutputVertices": 0, + "maxGeometryShaderInvocations": 0, + "maxGeometryTotalOutputComponents": 0, + "maxImageArrayLayers": 2048, + "maxImageDimension1D": 16384, + "maxImageDimension2D": 16384, + "maxImageDimension3D": 2048, + "maxImageDimensionCube": 16384, + "maxInterpolationOffset": 0.4375, + "maxMemoryAllocationCount": 4096, + "maxPerStageDescriptorInputAttachments": 7, + "maxPerStageDescriptorSampledImages": 128, + "maxPerStageDescriptorSamplers": 16, + "maxPerStageDescriptorStorageBuffers": 31, + "maxPerStageDescriptorStorageImages": 8, + "maxPerStageDescriptorUniformBuffers": 15, + "maxPerStageResources": 159, + "maxPushConstantsSize": 128, + "maxSampleMaskWords": 1, + "maxSamplerAllocationCount": 4000, + "maxSamplerAnisotropy": 16, + "maxSamplerLodBias": 4.0, + "maxStorageBufferRange": 1073741820, + "maxTessellationControlPerPatchOutputComponents": 120, + "maxTessellationControlPerVertexInputComponents": 124, + "maxTessellationControlPerVertexOutputComponents": 124, + "maxTessellationControlTotalOutputComponents": 2048, + "maxTessellationEvaluationInputComponents": 124, + "maxTessellationEvaluationOutputComponents": 124, + "maxTessellationGenerationLevel": 64, + "maxTessellationPatchSize": 32, + "maxTexelBufferElements": 67108864, + "maxTexelGatherOffset": 7, + "maxTexelOffset": 7, + "maxUniformBufferRange": 65536, + "maxVertexInputAttributeOffset": 2047, + "maxVertexInputAttributes": 29, + "maxVertexInputBindingStride": 2048, + "maxVertexInputBindings": 31, + "maxVertexOutputComponents": 124, + "maxViewports": 16, + "minInterpolationOffset": -0.5, + "minMemoryMapAlignment": 4096, + "minStorageBufferOffsetAlignment": 64, + "minTexelBufferOffsetAlignment": 64, + "minTexelGatherOffset": -8, + "minTexelOffset": -8, + "minUniformBufferOffsetAlignment": 256, + "mipmapPrecisionBits": 4, + "nonCoherentAtomSize": 128, + "optimalBufferCopyOffsetAlignment": 128, + "optimalBufferCopyRowPitchAlignment": 128, + "pointSizeGranularity": 1.0, + "sampledImageColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageIntegerSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_2_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sparseAddressSpaceSize": 0, + "storageImageSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT" + ], + "subPixelInterpolationOffsetBits": 4, + "subPixelPrecisionBits": 4, + "subTexelPrecisionBits": 4, + "timestampComputeAndGraphics": true, + "viewportSubPixelBits": 0, + "maxComputeWorkGroupCount": [ + 65535, + 65535, + 65535 + ], + "maxComputeWorkGroupSize": [ + 1024, + 1024, + 64 + ], + "maxViewportDimensions": [ + 16384, + 16384 + ], + "pointSizeRange": [ + 1, + 255.875 + ], + "viewportBoundsRange": [ + -32768, + 32767 + ], + "lineWidthRange": [ + 1, + 1 + ] + } + }, + "VkPhysicalDevicePushDescriptorPropertiesKHR": { + "maxPushDescriptors": 32 + }, + "VkPhysicalDeviceRobustness2PropertiesEXT": { + "robustStorageBufferAccessSizeAlignment": 4, + "robustUniformBufferAccessSizeAlignment": 256 + }, + "VkPhysicalDeviceSubgroupSizeControlPropertiesEXT": { + "maxComputeWorkgroupSubgroups": 32, + "maxSubgroupSize": 32, + "minSubgroupSize": 64, + "requiredSubgroupSizeStages": [] + }, + "VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT": { + "storageTexelBufferOffsetAlignmentBytes": 16, + "uniformTexelBufferOffsetAlignmentBytes": 16 + }, + "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT": { + "maxVertexAttribDivisor": 268435455 + }, + "VkPhysicalDeviceVulkan11Properties": { + "subgroupSize": 32, + "subgroupSupportedStages": [ + "VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT", + "VK_SHADER_STAGE_FRAGMENT_BIT", + "VK_SHADER_STAGE_COMPUTE_BIT" + ], + "subgroupSupportedOperations": [ + "VK_SUBGROUP_FEATURE_BASIC_BIT", + "VK_SUBGROUP_FEATURE_VOTE_BIT", + "VK_SUBGROUP_FEATURE_ARITHMETIC_BIT", + "VK_SUBGROUP_FEATURE_BALLOT_BIT", + "VK_SUBGROUP_FEATURE_SHUFFLE_BIT", + "VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT", + "VK_SUBGROUP_FEATURE_QUAD_BIT" + ], + "subgroupQuadOperationsInAllStages": true, + "maxMultiviewViewCount": 6, + "maxMultiviewInstanceIndex": 134217727, + "maxPerSetDescriptors": 1024, + "maxMemoryAllocationSize": 2147483648 + }, + "VkPhysicalDeviceVulkan12Properties": { + "shaderSignedZeroInfNanPreserveFloat32": true, + "maxUpdateAfterBindDescriptorsInAllPools": 1048576, + "robustBufferAccessUpdateAfterBind": true, + "maxPerStageDescriptorUpdateAfterBindSamplers": 16, + "maxPerStageDescriptorUpdateAfterBindUniformBuffers": 15, + "maxPerStageDescriptorUpdateAfterBindStorageBuffers": 31, + "maxPerStageDescriptorUpdateAfterBindSampledImages": 128, + "maxPerStageDescriptorUpdateAfterBindStorageImages": 8, + "maxPerStageDescriptorUpdateAfterBindInputAttachments": 64, + "maxPerStageUpdateAfterBindResources": 159, + "maxDescriptorSetUpdateAfterBindSamplers": 80, + "maxDescriptorSetUpdateAfterBindUniformBuffers": 155, + "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 8, + "maxDescriptorSetUpdateAfterBindStorageBuffers": 155, + "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 8, + "maxDescriptorSetUpdateAfterBindSampledImages": 640, + "maxDescriptorSetUpdateAfterBindStorageImages": 40, + "maxDescriptorSetUpdateAfterBindInputAttachments": 256, + "supportedDepthResolveModes": [ + "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT", + "VK_RESOLVE_MODE_MIN_BIT", + "VK_RESOLVE_MODE_MAX_BIT" + ], + "supportedStencilResolveModes": [ + "VK_RESOLVE_MODE_SAMPLE_ZERO_BIT" + ], + "independentResolveNone": true, + "independentResolve": true, + "maxTimelineSemaphoreValueDifference": 2147483647, + "framebufferIntegerColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT" + ] + } + }, + "formats": { + "VK_FORMAT_A1R5G5B5_UNORM_PACK16": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_SNORM_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_UINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2B10G10R10_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A2R10G10B10_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SRGB_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_SSCALED_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_UINT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_UNORM_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_A8B8G8R8_USCALED_PACK32": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_B10G11R11_UFLOAT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_B4G4R4A4_UNORM_PACK16": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_B8G8R8A8_SRGB": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_B8G8R8A8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGBA_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGBA_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGB_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC1_RGB_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC2_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC2_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC3_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC3_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC4_SNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC4_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC5_SNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC5_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC6H_SFLOAT_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC6H_UFLOAT_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC7_SRGB_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_BC7_UNORM_BLOCK": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D16_UNORM": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D32_SFLOAT": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_D32_SFLOAT_S8_UINT": { + "VkFormatProperties": { + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16A16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16_SNORM": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16_UNORM": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16B16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16G16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R16_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32A32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_SFLOAT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_SINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32B32_UINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32G32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_SFLOAT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R32_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R4G4B4A4_UNORM_PACK16": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R5G6B5_UNORM_PACK16": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SRGB": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8A8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8_SINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8_SNORM": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8_UINT": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8_UNORM": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8B8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8G8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_SSCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_UINT": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_UNORM": { + "VkFormatProperties": { + "linearTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "optimalTilingFeatures": [ + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", + "VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT", + "VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT", + "VK_FORMAT_FEATURE_BLIT_SRC_BIT", + "VK_FORMAT_FEATURE_BLIT_DST_BIT", + "VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT", + "VK_FORMAT_FEATURE_TRANSFER_SRC_BIT", + "VK_FORMAT_FEATURE_TRANSFER_DST_BIT" + ], + "bufferFeatures": [ + "VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT", + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + }, + "VK_FORMAT_R8_USCALED": { + "VkFormatProperties": { + "bufferFeatures": [ + "VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT" + ] + } + } + } + } + }, + "profiles": { + "VP_LUNARG_desktop_baseline_2022": { + "version": 2, + "api-version": "1.1.139", + "label": "LunarG Vulkan Desktop Baseline 2022 profile", + "description": "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developer.", + "capabilities": [ + "VP_LUNARG_desktop_baseline_2022_block" + ] + }, + "VP_LUNARG_desktop_baseline_2023": { + "version": 2, + "api-version": "1.2.148", + "label": "LunarG Vulkan Desktop Baseline 2023 profile", + "description": "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developer.", + "capabilities": [ + "VP_LUNARG_desktop_baseline_2023_block" + ] + }, + "VP_LUNARG_desktop_baseline_2024": { + "version": 1, + "api-version": "1.2.197", + "label": "LunarG Vulkan Desktop Baseline 2024 profile", + "description": "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developer.", + "capabilities": [ + "VP_LUNARG_desktop_baseline_2024_block" + ] + } + }, + "contributors": { + "Christophe Riccio": { + "company": "LunarG", + "email": "christophe@lunarg.com", + "contact": true + } + }, + "history": [ + { + "revision": 2, + "date": "2024-02-21", + "author": "Christophe Riccio", + "comment": "Updated Desktop Baseline 2023 and 2022 to version 2 with ARC support" + }, + { + "revision": 1, + "date": "2024-02-21", + "author": "Christophe Riccio", + "comment": "Merged Desktop Baseline 2024, 2023 and 2022 into a single file" + } + ] +} \ No newline at end of file diff --git a/vkconfig_core/test/profiles/VP_LUNARG_desktop_baseline_config.json b/vkconfig_core/test/profiles/VP_LUNARG_desktop_baseline_config.json new file mode 100644 index 0000000000..86b00e0be2 --- /dev/null +++ b/vkconfig_core/test/profiles/VP_LUNARG_desktop_baseline_config.json @@ -0,0 +1,56 @@ +{ + "$schema": "profiles-config-latest", + "profiles": { + "VP_LUNARG_desktop_baseline_2022": { + "version": 2, + "input": "VP_LUNARG_desktop_baseline_2022", + "label": "LunarG Vulkan Desktop Baseline 2022 profile", + "description": "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developer.", + "date": "2023-01-26", + "stage": "STABLE", + "api-version": "1.1.139", + "required-profiles": "" + }, + "VP_LUNARG_desktop_baseline_2023": { + "version": 2, + "input": "VP_LUNARG_desktop_baseline_2023", + "label": "LunarG Vulkan Desktop Baseline 2023 profile", + "description": "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developer.", + "date": "2023-01-30", + "stage": "STABLE", + "api-version": "1.2.148", + "required-profiles": "" + }, + "VP_LUNARG_desktop_baseline_2024": { + "version": 1, + "input": "VP_LUNARG_desktop_baseline_2024", + "label": "LunarG Vulkan Desktop Baseline 2024 profile", + "description": "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developer.", + "date": "2024-02-20", + "stage": "STABLE", + "api-version": "1.2.197", + "required-profiles": "" + } + }, + "contributors": { + "Christophe Riccio": { + "company": "LunarG", + "email": "christophe@lunarg.com", + "contact": true + } + }, + "history": [ + { + "revision": 2, + "date": "2024-02-21", + "author": "Christophe Riccio", + "comment": "Updated Desktop Baseline 2023 and 2022 to version 2 with ARC support" + }, + { + "revision": 1, + "date": "2024-02-21", + "author": "Christophe Riccio", + "comment": "Merged Desktop Baseline 2024, 2023 and 2022 into a single file" + } + ] +} \ No newline at end of file diff --git a/vkconfig_core/test/profiles/VP_LUNARG_minimum_requirements.json b/vkconfig_core/test/profiles/VP_LUNARG_minimum_requirements.json new file mode 100644 index 0000000000..f8c1b55a64 --- /dev/null +++ b/vkconfig_core/test/profiles/VP_LUNARG_minimum_requirements.json @@ -0,0 +1,400 @@ +{ + "$schema": "https://schema.khronos.org/vulkan/profiles-0.8.1-204.json#", + "capabilities": { + "vulkan10requirements": { + "features": { + "VkPhysicalDeviceFeatures": { + "robustBufferAccess": true + } + }, + "properties": { + "VkPhysicalDeviceProperties": { + "limits": { + "maxImageDimension1D": 4096, + "maxImageDimension2D": 4096, + "maxImageDimension3D": 256, + "maxImageDimensionCube": 4096, + "maxImageArrayLayers": 256, + "maxTexelBufferElements": 65536, + "maxUniformBufferRange": 16384, + "maxStorageBufferRange": 134217728, + "maxPushConstantsSize": 128, + "maxMemoryAllocationCount": 4096, + "maxSamplerAllocationCount": 4000, + "bufferImageGranularity": 131072, + "sparseAddressSpaceSize": 0, + "maxBoundDescriptorSets": 4, + "maxPerStageDescriptorSamplers": 16, + "maxPerStageDescriptorUniformBuffers": 12, + "maxPerStageDescriptorStorageBuffers": 4, + "maxPerStageDescriptorSampledImages": 16, + "maxPerStageDescriptorStorageImages": 4, + "maxPerStageDescriptorInputAttachments": 4, + "maxPerStageResources": 128, + "maxDescriptorSetSamplers": 96, + "maxDescriptorSetUniformBuffers": 72, + "maxDescriptorSetUniformBuffersDynamic": 8, + "maxDescriptorSetStorageBuffers": 24, + "maxDescriptorSetStorageBuffersDynamic": 4, + "maxDescriptorSetSampledImages": 96, + "maxDescriptorSetStorageImages": 24, + "maxDescriptorSetInputAttachments": 4, + "maxVertexInputAttributes": 16, + "maxVertexInputBindings": 16, + "maxVertexInputAttributeOffset": 2047, + "maxVertexInputBindingStride": 2048, + "maxVertexOutputComponents": 64, + "maxTessellationGenerationLevel": 0, + "maxTessellationPatchSize": 0, + "maxTessellationControlPerVertexInputComponents": 0, + "maxTessellationControlPerVertexOutputComponents": 0, + "maxTessellationControlPerPatchOutputComponents": 0, + "maxTessellationControlTotalOutputComponents": 0, + "maxTessellationEvaluationInputComponents": 0, + "maxTessellationEvaluationOutputComponents": 0, + "maxGeometryShaderInvocations": 0, + "maxGeometryInputComponents": 0, + "maxGeometryOutputComponents": 0, + "maxGeometryOutputVertices": 0, + "maxGeometryTotalOutputComponents": 0, + "maxFragmentInputComponents": 64, + "maxFragmentOutputAttachments": 4, + "maxFragmentDualSrcAttachments": 0, + "maxFragmentCombinedOutputResources": 4, + + "maxComputeSharedMemorySize": 16384, + "maxComputeWorkGroupCount": [ + 65535, + 65535, + 65535 + ], + "maxComputeWorkGroupInvocations": 128, + "maxComputeWorkGroupSize": [ + 128, + 128, + 64 + ], + "subPixelPrecisionBits": 4, + "subTexelPrecisionBits": 4, + "mipmapPrecisionBits": 4, + "maxDrawIndexedIndexValue": 16777216, + "maxDrawIndirectCount": 1, + "maxSamplerLodBias": 2, + "maxSamplerAnisotropy": 1, + "maxViewports": 1, + "maxViewportDimensions": [ + 4096, + 4096 + ], + "viewportBoundsRange": [ + -8192, + 8192 + ], + "viewportSubPixelBits": 0, + "minMemoryMapAlignment": 64, + "minTexelBufferOffsetAlignment": 256, + "minUniformBufferOffsetAlignment": 256, + "minStorageBufferOffsetAlignment": 256, + "minTexelOffset": -8, + "maxTexelOffset": 7, + "minTexelGatherOffset": -8, + "maxTexelGatherOffset": 7, + "minInterpolationOffset": 0.0, + "maxInterpolationOffset": 0.0, + "subPixelInterpolationOffsetBits": 0, + "maxFramebufferWidth": 4096, + "maxFramebufferHeight": 4096, + "maxFramebufferLayers": 256, + "framebufferColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "framebufferNoAttachmentsSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "maxColorAttachments": 4, + "sampledImageColorSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageIntegerSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageDepthSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "sampledImageStencilSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT", + "VK_SAMPLE_COUNT_4_BIT" + ], + "storageImageSampleCounts": [ + "VK_SAMPLE_COUNT_1_BIT" + ], + "maxSampleMaskWords": 1, + "maxClipDistances": 0, + "maxCullDistances": 0, + "maxCombinedClipAndCullDistances": 0, + "discreteQueuePriorities": 2, + "pointSizeRange": [ + 1.0, + 1.0 + ], + "lineWidthRange": [ + 1.0, + 1.0 + ], + "pointSizeGranularity": 1.0, + "lineWidthGranularity": 1.0, + "nonCoherentAtomSize": 256 + }, + "sparseProperties": { + "residencyStandard2DBlockShape": false, + "residencyStandard2DMultisampleBlockShape": false, + "residencyStandard3DBlockShape": false, + "residencyNonResidentStrict": false + } + } + } + }, + "vulkan11requirements_split": { + "features": { + "VkPhysicalDeviceMultiviewFeatures": { + "multiview": true + } + }, + "properties": { + "VkPhysicalDeviceSubgroupProperties": { + "subgroupSize": 1, + "supportedStages": [ "VK_SHADER_STAGE_COMPUTE_BIT" ], + "supportedOperations": [ "VK_SUBGROUP_FEATURE_BASIC_BIT" ] + }, + "VkPhysicalDeviceMultiviewProperties": { + "maxMultiviewViewCount": 6, + "maxMultiviewInstanceIndex": 134217727 + }, + "VkPhysicalDeviceMaintenance3Properties": { + "maxPerSetDescriptors": 1024, + "maxMemoryAllocationSize": 1073741824 + } + + } + }, + "vulkan11requirements": { + "features": { + "VkPhysicalDeviceVulkan11Features": { + "multiview": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan11Properties": { + "subgroupSize": 1, + "subgroupSupportedStages": [ "VK_SHADER_STAGE_COMPUTE_BIT" ], + "subgroupSupportedOperations": [ "VK_SUBGROUP_FEATURE_BASIC_BIT" ], + "maxMultiviewViewCount": 6, + "maxMultiviewInstanceIndex": 134217727, + "maxPerSetDescriptors": 1024, + "maxMemoryAllocationSize": 1073741824 + } + } + }, + "vulkan12requirements": { + "features": { + "VkPhysicalDeviceVulkan12Features": { + "uniformBufferStandardLayout": true, + "subgroupBroadcastDynamicId": true, + "imagelessFramebuffer": true, + "separateDepthStencilLayouts": true, + "hostQueryReset": true, + "timelineSemaphore": true, + "shaderSubgroupExtendedTypes": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan12Properties": { + "shaderSignedZeroInfNanPreserveFloat16": false, + "shaderSignedZeroInfNanPreserveFloat32": false, + "shaderSignedZeroInfNanPreserveFloat64": false, + "shaderDenormPreserveFloat16": false, + "shaderDenormPreserveFloat32": false, + "shaderDenormPreserveFloat64": false, + "shaderDenormFlushToZeroFloat16": false, + "shaderDenormFlushToZeroFloat32": false, + "shaderDenormFlushToZeroFloat64": false, + "shaderRoundingModeRTEFloat16": false, + "shaderRoundingModeRTEFloat32": false, + "shaderRoundingModeRTEFloat64": false, + "shaderRoundingModeRTZFloat16": false, + "shaderRoundingModeRTZFloat32": false, + "shaderRoundingModeRTZFloat64": false, + "maxUpdateAfterBindDescriptorsInAllPools": 0, + "shaderUniformBufferArrayNonUniformIndexingNative": false, + "shaderSampledImageArrayNonUniformIndexingNative": false, + "shaderStorageBufferArrayNonUniformIndexingNative": false, + "shaderStorageImageArrayNonUniformIndexingNative": false, + "shaderInputAttachmentArrayNonUniformIndexingNative": false, + "robustBufferAccessUpdateAfterBind": false, + "quadDivergentImplicitLod": false, + "maxPerStageDescriptorUpdateAfterBindSamplers": 0, + "maxPerStageDescriptorUpdateAfterBindUniformBuffers": 0, + "maxPerStageDescriptorUpdateAfterBindStorageBuffers": 0, + "maxPerStageDescriptorUpdateAfterBindSampledImages": 0, + "maxPerStageDescriptorUpdateAfterBindStorageImages": 0, + "maxPerStageDescriptorUpdateAfterBindInputAttachments": 0, + "maxPerStageUpdateAfterBindResources": 0, + "maxDescriptorSetUpdateAfterBindSamplers": 0, + "maxDescriptorSetUpdateAfterBindUniformBuffers": 0, + "maxDescriptorSetUpdateAfterBindUniformBuffersDynamic": 0, + "maxDescriptorSetUpdateAfterBindStorageBuffers": 0, + "maxDescriptorSetUpdateAfterBindStorageBuffersDynamic": 0, + "maxDescriptorSetUpdateAfterBindSampledImages": 0, + "maxDescriptorSetUpdateAfterBindStorageImages": 0, + "maxDescriptorSetUpdateAfterBindInputAttachments": 0, + "supportedDepthResolveModes": [], + "supportedStencilResolveModes": [], + "independentResolveNone": false, + "independentResolve": false, + "filterMinmaxSingleComponentFormats": false, + "filterMinmaxImageComponentMapping": false, + "maxTimelineSemaphoreValueDifference": 2147483647, + "framebufferIntegerColorSampleCounts": [ "VK_SAMPLE_COUNT_1_BIT" ] + } + } + }, + "vulkan13requirements": { + "features": { + "VkPhysicalDeviceVulkan12Features": { + "vulkanMemoryModel": true, + "vulkanMemoryModelDeviceScope": true, + "bufferDeviceAddress": true + }, + "VkPhysicalDeviceVulkan13Features": { + "robustImageAccess": true, + "inlineUniformBlock": true, + "pipelineCreationCacheControl": true, + "shaderDemoteToHelperInvocation": true, + "shaderTerminateInvocation": true, + "subgroupSizeControl": true, + "computeFullSubgroups": true, + "synchronization2": true, + "shaderZeroInitializeWorkgroupMemory": true, + "dynamicRendering": true, + "shaderIntegerDotProduct": true, + "maintenance4": true + } + }, + "properties": { + "VkPhysicalDeviceVulkan13Properties": { + "maxComputeWorkgroupSubgroups": 0, + "requiredSubgroupSizeStages": [], + "maxInlineUniformBlockSize": 256, + "maxPerStageDescriptorInlineUniformBlocks": 4, + "maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks": 4, + "maxDescriptorSetInlineUniformBlocks": 4, + "maxDescriptorSetUpdateAfterBindInlineUniformBlocks": 4, + "maxInlineUniformTotalSize": 256, + "integerDotProduct8BitUnsignedAccelerated": false, + "integerDotProduct8BitSignedAccelerated": false, + "integerDotProduct8BitMixedSignednessAccelerated": false, + "integerDotProduct4x8BitPackedUnsignedAccelerated": false, + "integerDotProduct4x8BitPackedSignedAccelerated": false, + "integerDotProduct4x8BitPackedMixedSignednessAccelerated": false, + "integerDotProduct16BitUnsignedAccelerated": false, + "integerDotProduct16BitSignedAccelerated": false, + "integerDotProduct16BitMixedSignednessAccelerated": false, + "integerDotProduct32BitUnsignedAccelerated": false, + "integerDotProduct32BitSignedAccelerated": false, + "integerDotProduct32BitMixedSignednessAccelerated": false, + "integerDotProduct64BitUnsignedAccelerated": false, + "integerDotProduct64BitSignedAccelerated": false, + "integerDotProduct64BitMixedSignednessAccelerated": false, + "integerDotProductAccumulatingSaturating8BitUnsignedAccelerated": false, + "integerDotProductAccumulatingSaturating8BitSignedAccelerated": false, + "integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated": false, + "integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated": false, + "integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated": false, + "integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated": false, + "integerDotProductAccumulatingSaturating16BitUnsignedAccelerated": false, + "integerDotProductAccumulatingSaturating16BitSignedAccelerated": false, + "integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated": false, + "integerDotProductAccumulatingSaturating32BitUnsignedAccelerated": false, + "integerDotProductAccumulatingSaturating32BitSignedAccelerated": false, + "integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated": false, + "integerDotProductAccumulatingSaturating64BitUnsignedAccelerated": false, + "integerDotProductAccumulatingSaturating64BitSignedAccelerated": false, + "integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated": false, + "maxBufferSize": 1073741824 + } + } + } + }, + "profiles": { + "VP_LUNARG_minimum_requirements_1_0": { + "version": 1, + "api-version": "1.0.68", + "label": "Vulkan Core 1.0 Minimum Requirements", + "description": "Vulkan Core 1.0 Minimum Requirements.", + "capabilities": [ + "vulkan10requirements" + ] + }, + "VP_LUNARG_minimum_requirements_1_1": { + "version": 1, + "api-version": "1.1.108", + "label": "Vulkan Core 1.1 Minimum Requirements", + "description": "Vulkan Core 1.1 Minimum Requirements.", + "capabilities": [ + "vulkan10requirements", + "vulkan11requirements_split" + ] + }, + "VP_LUNARG_minimum_requirements_1_2": { + "version": 1, + "api-version": "1.2.131", + "label": "Vulkan Core 1.2 Minimum Requirements", + "description": "Vulkan Core 1.2 Minimum Requirements.", + "capabilities": [ + "vulkan10requirements", + "vulkan11requirements", + "vulkan12requirements" + ] + }, + "VP_LUNARG_minimum_requirements_1_3": { + "version": 1, + "api-version": "1.3.204", + "label": "Vulkan Core 1.3 Minimum Requirements", + "description": "Vulkan Core 1.3 Minimum Requirements.", + "capabilities": [ + "vulkan10requirements", + "vulkan11requirements", + "vulkan12requirements", + "vulkan13requirements" + ] + } + }, + "contributors": { + "Christophe Riccio": { + "company": "LunarG", + "email": "christophe@lunarg.com", + "contact": true + } + }, + "history": [ + { + "revision": 1, + "date": "2023-11-01", + "author": "Christophe Riccio", + "comment": "Initial revision" + } + ] +} diff --git a/vkconfig_core/test/resources.qrc b/vkconfig_core/test/resources.qrc index fb214b31f4..c3de24915b 100644 --- a/vkconfig_core/test/resources.qrc +++ b/vkconfig_core/test/resources.qrc @@ -1,89 +1,54 @@ - - Configuration 2.2.2.json - - VK_LAYER_LUNARG_reference_1_1_0.json - VK_LAYER_LUNARG_reference_1_2_0.json - VK_LAYER_LUNARG_reference_1_2_1.json - - VK_LAYER_LUNARG_test_00.json - VK_LAYER_LUNARG_test_01.json - VK_LAYER_LUNARG_test_02.json - VK_LAYER_LUNARG_test_03.json - VK_LAYER_LUNARG_test_04.json - VK_LAYER_LUNARG_test_05.json - VK_LAYER_LUNARG_test_06.json - - override_layers_2_2_2_schema_1_2_1.json - override_settings_2_2_2_schema_1_2_1.txt - - - - ../configurations/2.2.2/API dump.json - ../configurations/2.2.2/Frame Capture.json - ../configurations/2.2.2/Portability.json - ../configurations/2.2.2/Synchronization.json - ../configurations/2.2.2/Validation.json - - - + ../layers/layers_schema.json ../layers/validusage.json - - ../layers/130/VK_LAYER_KHRONOS_validation.json - ../layers/130/VK_LAYER_LUNARG_api_dump.json - ../layers/130/VK_LAYER_LUNARG_monitor.json - ../layers/130/VK_LAYER_LUNARG_screenshot.json - + + Configuration 3.0.0.json - - ../layers/135/VK_LAYER_KHRONOS_validation.json - ../layers/135/VK_LAYER_LUNARG_api_dump.json - ../layers/135/VK_LAYER_LUNARG_monitor.json - ../layers/135/VK_LAYER_LUNARG_screenshot.json + loader_settings.json + layers_settings.txt - - ../layers/141/VK_LAYER_KHRONOS_validation.json - ../layers/141/VK_LAYER_LUNARG_api_dump.json - ../layers/141/VK_LAYER_LUNARG_gfxreconstruct.json - ../layers/141/VK_LAYER_LUNARG_monitor.json - ../layers/141/VK_LAYER_LUNARG_screenshot.json + + ./sdk/VkLayer_api_dump.json + ./sdk/VkLayer_gfxreconstruct.json + ./sdk/VkLayer_khronos_profiles.json + ./sdk/VkLayer_khronos_shader_object.json + ./sdk/VkLayer_khronos_synchronization2.json + ./sdk/VkLayer_khronos_validation.json + ./sdk/VkLayer_monitor.json + ./sdk/VkLayer_screenshot.json - - ../layers/148/VK_LAYER_KHRONOS_validation.json - ../layers/148/VK_LAYER_LUNARG_api_dump.json - ../layers/148/VK_LAYER_LUNARG_gfxreconstruct.json - ../layers/148/VK_LAYER_LUNARG_monitor.json - ../layers/148/VK_LAYER_LUNARG_screenshot.json - + + ./layers/VK_LAYER_LUNARG_reference_1_1_0.json + ./layers/VK_LAYER_LUNARG_reference_1_2_0.json + ./layers/VK_LAYER_LUNARG_reference_1_2_1.json - - ../layers/154/VK_LAYER_KHRONOS_validation.json - ../layers/154/VK_LAYER_LUNARG_api_dump.json - ../layers/154/VK_LAYER_LUNARG_gfxreconstruct.json - ../layers/154/VK_LAYER_LUNARG_monitor.json - ../layers/154/VK_LAYER_LUNARG_screenshot.json + ./layers/VK_LAYER_LUNARG_test_00.json + ./layers/VK_LAYER_LUNARG_test_01.json + ./layers/VK_LAYER_LUNARG_test_02.json + ./layers/VK_LAYER_LUNARG_test_03.json + ./layers/VK_LAYER_LUNARG_test_04.json + ./layers/VK_LAYER_LUNARG_test_05.json + ./layers/VK_LAYER_LUNARG_test_06.json - - ../layers/162/VK_LAYER_KHRONOS_validation.json - ../layers/162/VK_LAYER_LUNARG_api_dump.json - ../layers/162/VK_LAYER_LUNARG_gfxreconstruct.json - ../layers/162/VK_LAYER_LUNARG_monitor.json - ../layers/162/VK_LAYER_LUNARG_screenshot.json - + + ../configurations/3.0.0/API dump.json + ../configurations/3.0.0/Frame Capture.json + ../configurations/3.0.0/Portability.json + ../configurations/3.0.0/Synchronization.json + ../configurations/3.0.0/Validation.json + - - ../layers/170/VK_LAYER_KHRONOS_synchronization2.json - ../layers/170/VK_LAYER_KHRONOS_validation.json - ../layers/170/VK_LAYER_LUNARG_api_dump.json - ../layers/170/VK_LAYER_LUNARG_gfxreconstruct.json - ../layers/170/VK_LAYER_LUNARG_monitor.json - ../layers/170/VK_LAYER_LUNARG_screenshot.json - + + ./profiles/VP_KHR_roadmap.json + ./profiles/VP_LUNARG_desktop_baseline.json + ./profiles/VP_LUNARG_desktop_baseline_config.json + ./profiles/VP_LUNARG_minimum_requirements.json + diff --git a/vkconfig_core/layers/170/VK_LAYER_LUNARG_api_dump.json b/vkconfig_core/test/sdk/VkLayer_api_dump.json similarity index 88% rename from vkconfig_core/layers/170/VK_LAYER_LUNARG_api_dump.json rename to vkconfig_core/test/sdk/VkLayer_api_dump.json index 87a65ca201..08cdb5d949 100644 --- a/vkconfig_core/layers/170/VK_LAYER_LUNARG_api_dump.json +++ b/vkconfig_core/test/sdk/VkLayer_api_dump.json @@ -4,12 +4,23 @@ "name": "VK_LAYER_LUNARG_api_dump", "type": "GLOBAL", "library_path": ".\\VkLayer_api_dump.dll", - "api_version": "1.2.170", + "api_version": "1.3.283", "implementation_version": "2", "description": "LunarG API dump layer", "introduction": "The API Dump utility layer prints API calls, parameters, and values to the identified output stream.", "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/api_dump_layer.html", - "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "instance_extensions": [ + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + } + ], "device_extensions": [ { "name": "VK_EXT_tooling_info", @@ -24,7 +35,12 @@ { "label": "Console Output", "description": "Output API dump to stdout", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], "status": "STABLE", "settings": [ { @@ -44,7 +60,12 @@ { "label": "Text Output", "description": "Output API dump to a text file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], "status": "STABLE", "settings": [ { @@ -64,7 +85,12 @@ { "label": "HTML Output", "description": "Output API dump to a HTML file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], "status": "STABLE", "settings": [ { @@ -84,7 +110,12 @@ { "label": "JSON Output", "description": "Output API dump to a JSON file", - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], "status": "STABLE", "settings": [ { @@ -142,7 +173,6 @@ "description": "Setting this to true indicates that output should be written to file instead of stdout", "type": "BOOL", "default": false, - "platforms": [ "WINDOWS", "LINUX", "MACOS" ], "settings": [ { "key": "log_filename", @@ -195,7 +225,7 @@ "label": "Type Size", "description": "The number of characters the name of a type should consume, assuming more are not required", "type": "INT", - "default": 32, + "default": 0, "range": { "min": 0 }, @@ -212,7 +242,7 @@ ] }, { - "key": "show_timestamp", + "key": "timestamp", "env": "VK_APIDUMP_TIMESTAMP", "label": "Show Timestamp", "description": "Show the timestamp of function calls since start in microseconds", @@ -271,6 +301,13 @@ } } ] + }, + { + "key": "show_thread_and_frame", + "label": "Show Thread and Frame", + "description": "Show the thread and frame of each function called", + "type": "BOOL", + "default": true } ] } diff --git a/vkconfig_core/layers/170/VK_LAYER_LUNARG_gfxreconstruct.json b/vkconfig_core/test/sdk/VkLayer_gfxreconstruct.json similarity index 79% rename from vkconfig_core/layers/170/VK_LAYER_LUNARG_gfxreconstruct.json rename to vkconfig_core/test/sdk/VkLayer_gfxreconstruct.json index f359921d93..c7095acb59 100644 --- a/vkconfig_core/layers/170/VK_LAYER_LUNARG_gfxreconstruct.json +++ b/vkconfig_core/test/sdk/VkLayer_gfxreconstruct.json @@ -4,12 +4,13 @@ "name": "VK_LAYER_LUNARG_gfxreconstruct", "type": "GLOBAL", "library_path": ".\\VkLayer_gfxreconstruct.dll", - "api_version": "1.2.170", - "implementation_version": "36870", - "description": "GFXReconstruct Capture Layer Version 0.9.6", + "api_version": "1.3.283", + "implementation_version": "4194308", + "description": "GFXReconstruct Capture Layer Version 1.0.4", "introduction": "The GFXReconstruct Capture Layer intercepts Vulkan API calls and logs them to a capture file. Other tools in the GFXReconstruct suite can inspect, modify, or replay capture files generated by this component.", - "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/capture_tools.html", "platforms": [ "WINDOWS", "LINUX", "ANDROID" ], + "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/capture_tools.html", + "status": "STABLE", "device_extensions": [ { "name": "VK_EXT_tooling_info", @@ -22,6 +23,7 @@ { "label": "Initialization", "description": "Capture the first two frames.", + "platforms": [ "WINDOWS", "LINUX" ], "settings": [ { "key": "capture_trigger", @@ -30,16 +32,13 @@ { "key": "capture_frames", "value": "1-2" - }, - { - "key": "memory_tracking_mode", - "value": "unassisted" } ] }, { "label": "Range", "description": "Capture a range of frames between presses of the F5 key.", + "platforms": [ "WINDOWS", "LINUX" ], "settings": [ { "key": "capture_trigger", @@ -48,10 +47,6 @@ { "key": "capture_frames", "value": "" - }, - { - "key": "memory_tracking_mode", - "value": "page_guard" } ] } @@ -62,6 +57,7 @@ "env": "GFXRECON_CAPTURE_TRIGGER", "label": "Hotkey Capture Trigger", "description": "Specify a hotkey (any one of F1-F12, TAB, CONTROL) that will be used to start/stop capture. Example: F3 will set the capture trigger to F3 hotkey. One capture file will be generated for each pair of start/stop hotkey presses. Default is: Empty string (hotkey capture trigger is disabled).", + "platforms" : [ "WINDOWS", "LINUX" ], "type": "ENUM", "flags": [ { @@ -72,81 +68,84 @@ { "key": "F1", "label": "F1", - "description": "" + "description": "F1 Key" }, { "key": "F2", "label": "F2", - "description": "" + "description": "F2 Key" }, { "key": "F3", "label": "F3", - "description": "" + "description": "F3 Key" }, { "key": "F4", "label": "F4", - "description": "" + "description": "F4 Key" }, { "key": "F5", "label": "F5", - "description": "" + "description": "F5 Key" }, { "key": "F6", "label": "F6", - "description": "" + "description": "F6 Key" }, { "key": "F7", "label": "F7", - "description": "" + "description": "F7 Key" }, { "key": "F8", "label": "F8", - "description": "" + "description": "F8 Key" }, { "key": "F9", "label": "F9", - "description": "" + "description": "F9 Key" }, { "key": "F10", "label": "F10", - "description": "" - }, - { - "key": "F10", - "label": "F10", - "description": "" + "description": "F10 Key" }, { "key": "F11", "label": "F11", - "description": "" + "description": "F11 Key" }, { "key": "F12", "label": "F12", - "description": "" + "description": "F12 Key" }, { "key": "TAB", "label": "TAB", - "description": "" + "description": "TAB Key" }, { "key": "CONTROL", "label": "CONTROL", - "description": "" + "description": "CONTROL Key" } ], "default": "" }, + { + "key": "capture_trigger_frames", + "env": "GFXRECON_CAPTURE_TRIGGER_FRAMES", + "label": "Hotkey Capture Frame Limit", + "description": "Specify a limit on the number of frames to be captured via hotkey. Example: 1 will capture exactly one frame when the trigger key is pressed. Default is: Empty string (no limit)", + "type": "STRING", + "default": "" + }, { "key": "capture_frames", "env": "GFXRECON_CAPTURE_FRAMES", @@ -162,7 +161,7 @@ "description": "Path to use when creating the capture file. Default is: gfxrecon_capture.gfxr", "type": "SAVE_FILE", "filter": "*.gfxr", - "default": "${VK_LOCAL}/gfxrecon_capture.gfxr", + "default": "gfxrecon_capture.gfxr", "settings": [ { "key": "capture_file_timestamp", @@ -178,7 +177,7 @@ "label": "Capture File Flush After Write", "description": "Flush output stream after each packet is written to the capture file. Default is: false.", "type": "BOOL", - "default": true + "default": false } ] }, @@ -292,7 +291,7 @@ { "key": "page_guard_persistent_memory", "env": "GFXRECON_PAGE_GUARD_PERSISTENT_MEMORY", - "label": "Page Guard Persisent Memory", + "label": "Page Guard Persistent Memory", "description": "When the page_guard memory tracking mode is enabled, this option changes the way that the shadow memory used to detect modifications to mapped memory is allocated. The default behavior is to allocate and copy the mapped memory range on map and free the allocation on unmap. When this option is enabled, an allocation with a size equal to that of the object being mapped is made once on the first map and is not freed until the object is destroyed. This option is intended to be used with applications that frequently map and unmap large memory ranges, to avoid frequent allocation and copy operations that can have a negative impact on performance. This option is ignored when GFXRECON_PAGE_GUARD_EXTERNAL_MEMORY is enabled.", "type": "BOOL", "default": false, @@ -309,6 +308,48 @@ } ] } + }, + { + "key": "page_guard_align_buffer_sizes", + "env": "GFXRECON_PAGE_GUARD_ALIGN_BUFFER_SIZES", + "label": "Page Guard Align Buffer Sizes", + "description": "When the page_guard memory tracking mode is enabled, this option overrides the Vulkan API calls that report buffer memory properties to report that buffer sizes and alignments must be a multiple of the system page size. This option is intended to be used with applications that perform CPU writes and GPU writes/copies to different buffers that are bound to the same page of mapped memory, which may result in data being lost when copying pages from the page_guard shadow allocation to the real allocation. This data loss can result in visible corruption during capture. Forcing buffer sizes and alignments to a multiple of the system page size prevents multiple buffers from being bound to the same page, avoiding data loss from simultaneous CPU writes to the shadow allocation and GPU writes to the real allocation for different buffers bound to the same page. This option is only available for the Vulkan API.", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "memory_tracking_mode", + "value": "page_guard" + }, + { + "key": "page_guard_external_memory", + "value": false + } + ] + } + }, + { + "key": "page_guard_unblock_sigsegv", + "env": "GFXRECON_PAGE_GUARD_UNBLOCK_SIGSEGV", + "label": "Page Guard unblock SIGSEGV from thread's signal mask", + "description": "When the page_guard memory tracking mode is enabled, this option overrides enables SIGSEGV in thread's signal mask in the case that it has been disabled.", + "type": "BOOL", + "default": false, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "memory_tracking_mode", + "value": "page_guard" + }, + { + "key": "page_guard_external_memory", + "value": false + } + ] + } } ] }, @@ -322,7 +363,7 @@ "key": "log_level", "env": "GFXRECON_LOG_LEVEL", "label": "Level", - "description": "Specify the highest level message to log. Options are: debug, info, warning, error, and fatal. The specified level and all levels listed after it will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.", + "description": "Specify the minimum severity level of messages to log. Options are: debug, info, warning, error, and fatal. The specified level and all higher levels will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.", "type": "ENUM", "flags": [ { @@ -361,6 +402,14 @@ "type": "BOOL", "default": false }, + { + "key": "log_allow_indents", + "env": "GFXRECON_LOG_ALLOW_INDENTS", + "label": "Log Name and Line Number", + "description": "Apply additional indentation formatting to log messages.", + "type": "BOOL", + "default": false + }, { "key": "log_output_to_console", "env": "GFXRECON_LOG_OUTPUT_TO_CONSOLE", diff --git a/vkconfig_core/test/sdk/VkLayer_khronos_profiles.json b/vkconfig_core/test/sdk/VkLayer_khronos_profiles.json new file mode 100644 index 0000000000..9280b82a6a --- /dev/null +++ b/vkconfig_core/test/sdk/VkLayer_khronos_profiles.json @@ -0,0 +1,1280 @@ +{ + "file_format_version": "1.2.1", + "layer": { + "name": "VK_LAYER_KHRONOS_profiles", + "type": "GLOBAL", + "library_path": ".\\VkLayer_khronos_profiles.dll", + "api_version": "1.3.283", + "implementation_version": "1.3.0", + "status": "STABLE", + "description": "Khronos Profiles layer", + "introduction": "The Khronos Profiles layer helps test across a wide range of hardware capabilities without requiring a physical copy of every device.", + "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/profiles_layer.html", + "instance_extensions": [ + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + } + ], + "device_extensions": [ + { + "name": "VK_EXT_tooling_info", + "spec_version": "1", + "entrypoints": [ + "vkGetPhysicalDeviceToolPropertiesEXT" + ] + } + ], + "features": { + "presets": [ + { + "label": "Force Physical Device Only", + "description": "Use the Profiles layer to force a specific physical device", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "status": "STABLE", + "settings": [ + { + "key": "force_device", + "value": "FORCE_DEVICE_WITH_NAME" + }, + { + "key": "profile_emulation", + "value": false + }, + { + "key": "simulate_capabilities", + "value": [] + }, + { + "key": "emulate_portability", + "value": false + } + ] + }, + { + "label": "Emulate a Vulkan Conformant Profile", + "description": "Emulate a Conformant Vulkan Profile", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "status": "STABLE", + "settings": [ + { + "key": "force_device", + "value": "FORCE_DEVICE_OFF" + }, + { + "key": "profile_emulation", + "value": true + }, + { + "key": "profile_dirs", + "value": "${VULKAN_CONTENT}/VK_LAYER_KHRONOS_profiles" + }, + { + "key": "profile_name", + "value": "VP_LUNARG_desktop_baseline_2023" + }, + { + "key": "simulate_capabilities", + "value": [ "SIMULATE_API_VERSION_BIT", "SIMULATE_FEATURES_BIT", "SIMULATE_PROPERTIES_BIT" ] + }, + { + "key": "emulate_portability", + "value": false + } + ] + }, + { + "label": "Emulate a Vulkan Portability Profile", + "description": "Emulate a Vulkan Profile with Vulkan Portability", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "status": "STABLE", + "settings": [ + { + "key": "force_device", + "value": "FORCE_DEVICE_OFF" + }, + { + "key": "profile_emulation", + "value": true + }, + { + "key": "profile_dirs", + "value": "${VULKAN_CONTENT}/VK_LAYER_KHRONOS_profiles" + }, + { + "key": "profile_name", + "value": "VP_LUNARG_desktop_baseline_2023" + }, + { + "key": "simulate_capabilities", + "value": [ "SIMULATE_API_VERSION_BIT", "SIMULATE_FEATURES_BIT", "SIMULATE_PROPERTIES_BIT" ] + }, + { + "key": "emulate_portability", + "value": true + }, + { + "key": "vertexAttributeAccessBeyondStride", + "value": true + }, + { + "key": "separateStencilMaskRef", + "value": true + }, + { + "key": "mutableComparisonSamplers", + "value": true + }, + { + "key": "multisampleArrayImage", + "value": true + }, + { + "key": "imageViewFormatSwizzle", + "value": true + }, + { + "key": "imageViewFormatReinterpretation", + "value": true + }, + { + "key": "events", + "value": true + }, + { + "key": "constantAlphaColorBlendFactors", + "value": true + } + ] + } + ], + "settings": [ + { + "key": "force_device", + "label": "Force Device", + "description": "On system with multiple physical devices, force the use of one specific physical device.", + "status": "STABLE", + "type": "ENUM", + "default": "FORCE_DEVICE_OFF", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "flags": [ + { + "key": "FORCE_DEVICE_OFF", + "label": "Off", + "description": "Let the Vulkan Loader list all the Physical Device." + }, + { + "key": "FORCE_DEVICE_WITH_UUID", + "label": "Using Device UUID", + "description": "Force the Physical Device identified by the device UUID.", + "settings": [ + { + "key": "force_device_uuid", + "label": "Device UUID", + "description": "Device UUID of the forced physical devices", + "status": "STABLE", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "type": "STRING", + "default": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "force_device", + "value": "FORCE_DEVICE_WITH_UUID" + } + ] + } + } + ] + }, + { + "key": "FORCE_DEVICE_WITH_NAME", + "label": "Using Device Name", + "description": "Force the Physical Device identified by the device UUID.", + "settings": [ + { + "key": "force_device_name", + "label": "Device Name", + "description": "Device Name of the forced physical devices", + "status": "STABLE", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "type": "ENUM", + "flags": [], + "default": "${VP_PHYSICAL_DEVICES}", + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "force_device", + "value": "FORCE_DEVICE_WITH_NAME" + } + ] + } + } + ] + } + ] + }, + { + "key": "profile_emulation", + "label": "Emulate a Vulkan Profile", + "description": "Emulate a Vulkan Profile on the Developer System", + "status": "STABLE", + "type": "BOOL", + "default": true, + "settings": [ + { + "key": "profile_dirs", + "label": "Loading Directory", + "description": "Select the location all the profiles.", + "type": "LOAD_FOLDER", + "format": "PROFILE", + "default": "", + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "profile_emulation", + "value": true + } + ] + } + }, + { + "key": "profile_name", + "label": "Name", + "description": "Name of the profile specified by the profile file to use.", + "type": "ENUM", + "flags": [], + "default": "${VP_DEFAULT}", + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "profile_emulation", + "value": true + } + ] + } + }, + { + "key": "profile_validation", + "label": "Schema Validation", + "description": "Validate the profile files against the Vulkan SDK profile schema if the file is found.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "profile_emulation", + "value": true + } + ] + } + } + ] + }, + { + "key": "simulate_capabilities", + "label": "Simulate Profile Capabilities", + "description": "Control of the simulated capabilities of the Vulkan physical device from the selected Vulkan Profile.", + "status": "STABLE", + "type": "FLAGS", + "flags": [ + { + "key": "SIMULATE_API_VERSION_BIT", + "label": "Version", + "description": "The Vulkan device will report the API version from the selected Profile. It also overrides the `api-version` set in VkPhysicalDeviceProperties." + }, + { + "key": "SIMULATE_FEATURES_BIT", + "label": "Features", + "description": "The Vulkan device will report the features from the selected Profile.", + "settings": [ + { + "key": "default_feature_values", + "label": "Unspecified Features", + "description": "Feature values when not specified in the select Vulkan profiles.", + "status": "STABLE", + "type": "ENUM", + "default": "DEFAULT_FEATURE_VALUES_DEVICE", + "flags": [ + { + "key": "DEFAULT_FEATURE_VALUES_DEVICE", + "label": "Use Device Values", + "description": "When a feature is not mentionned in the select Vulkan profiles, set is to the physical device value." + }, + { + "key": "DEFAULT_FEATURE_VALUES_FALSE", + "label": "Use False", + "description": "When a feature is not mentionned in the select Vulkan profiles, set it to false." + } + ] + } + ] + }, + { + "key": "SIMULATE_PROPERTIES_BIT", + "label": "Properties", + "description": "The Vulkan device will report the properties from the selected Profile." + }, + { + "key": "SIMULATE_EXTENSIONS_BIT", + "label": "Device Extensions", + "description": "The Vulkan device will report the extensions from the selected Profile." + }, + { + "key": "SIMULATE_FORMATS_BIT", + "label": "Formats", + "description": "The Vulkan device will report the formats from the selected Profile." + } + ], + "default": [ "SIMULATE_API_VERSION_BIT", "SIMULATE_FEATURES_BIT", "SIMULATE_PROPERTIES_BIT" ] + }, + { + "key": "emulate_portability", + "label": "Emulate VK_KHR_portability_subset", + "description": "Emulate the VK_KHR_portability_subset extension on the device.", + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "type": "BOOL", + "default": true, + "settings": [ + { + "key": "constantAlphaColorBlendFactors", + "label": "constantAlphaColorBlendFactors", + "description": "Indicates whether this implementation supports constant alpha Blend Factors used as source or destination color Blending.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "events", + "label": "events", + "description": "Indicates whether this implementation supports synchronization using Events", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "imageViewFormatReinterpretation", + "label": "imageViewFormatReinterpretation", + "description": "Indicates whether this implementation supports a VkImageView being created with a texel format containing a different number of components, or a different number of bits in each component, than the texel format of the underlying VkImage.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "imageViewFormatSwizzle", + "label": "imageViewFormatSwizzle", + "description": "Indicates whether this implementation supports remapping format components using VkImageViewCreateInfo::components.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "imageView2DOn3DImage", + "label": "imageView2DOn3DImage", + "description": "Indicates whether this implementation supports a VkImage being created with the VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT flag set, permitting a 2D or 2D array image view to be created on a 3D VkImage.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "multisampleArrayImage", + "label": "multisampleArrayImage", + "description": "Indicates whether this implementation supports a VkImage being created as a 2D array with multiple samples per texel.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "mutableComparisonSamplers", + "label": "mutableComparisonSamplers", + "description": "Indicates whether this implementation allows descriptors with comparison samplers to be updated.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "pointPolygons", + "label": "pointPolygons", + "description": "Indicates whether this implementation supports Rasterization using a point Polygon Mode.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "samplerMipLodBias", + "label": "samplerMipLodBias", + "description": "Indicates whether this implementation supports setting a mipmap LOD bias value when creating a sampler.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "separateStencilMaskRef", + "label": "separateStencilMaskRef", + "description": "Indicates whether this implementation supports separate front and back Stencil Test reference values.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "shaderSampleRateInterpolationFunctions", + "label": "shaderSampleRateInterpolationFunctions", + "description": "Indicates whether this implementation supports fragment shaders which use the InterpolationFunction capability.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "tessellationIsolines", + "label": "tessellationIsolines", + "description": "Indicates whether this implementation supports isoline output from the Tessellation stage of a graphics pipeline. This member is only meaningful if tessellationShader are supported.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "triangleFans", + "label": "triangleFans", + "description": "Indicates whether this implementation supports Triangle Fans primitive topology.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + } + }, + { + "key": "vertexAttributeAccessBeyondStride", + "label": "vertexAttributeAccessBeyondStride", + "description": "Indicates whether this implementation supports accessing a vertex input attribute beyond the stride of the corresponding vertex input binding.", + "type": "BOOL", + "default": false, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "emulate_portability", + "value": true + } + ] + }, + "settings": [ + { + "key": "minVertexInputBindingStrideAlignment", + "label": "minVertexInputBindingStrideAlignment", + "description": "Indicates whether this implementation supports accessing a vertex input attribute beyond the stride of the corresponding vertex input binding.", + "type": "INT", + "default": 4, + "platforms": [ "WINDOWS", "LINUX" ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "vertexAttributeAccessBeyondStride", + "value": false + } + ] + } + } + ] + } + ] + }, + { + "key": "exclude_device_extensions", + "label": "Exclude Device Extensions", + "description": "Removes the listed device extensions from being reported by the Vulkan physical device.", + "status": "STABLE", + "type": "LIST", + "list": [ + "VK_KHR_16bit_storage", + "VK_KHR_8bit_storage", + "VK_KHR_acceleration_structure", + "VK_KHR_bind_memory2", + "VK_KHR_buffer_device_address", + "VK_KHR_copy_commands2", + "VK_KHR_create_renderpass2", + "VK_KHR_dedicated_allocation", + "VK_KHR_deferred_host_operations", + "VK_KHR_depth_stencil_resolve", + "VK_KHR_descriptor_update_template", + "VK_KHR_device_group", + "VK_KHR_display_swapchain", + "VK_KHR_draw_indirect_count", + "VK_KHR_driver_properties", + "VK_KHR_dynamic_rendering", + "VK_KHR_external_fence", + "VK_KHR_external_fence_fd", + "VK_KHR_external_fence_win32", + "VK_KHR_external_memory", + "VK_KHR_external_memory_fd", + "VK_KHR_external_memory_win32", + "VK_KHR_external_semaphore", + "VK_KHR_external_semaphore_fd", + "VK_KHR_external_semaphore_win32", + "VK_KHR_format_feature_flags2", + "VK_KHR_fragment_shading_rate", + "VK_KHR_get_memory_requirements2", + "VK_KHR_image_format_list", + "VK_KHR_imageless_framebuffer", + "VK_KHR_incremental_present", + "VK_KHR_maintenance1", + "VK_KHR_maintenance2", + "VK_KHR_maintenance3", + "VK_KHR_maintenance4", + "VK_KHR_multiview", + "VK_KHR_performance_query", + "VK_KHR_pipeline_executable_properties", + "VK_KHR_pipeline_library", + "VK_KHR_portability_subset", + "VK_KHR_present_id", + "VK_KHR_present_wait", + "VK_KHR_push_descriptor", + "VK_KHR_ray_query", + "VK_KHR_ray_tracing_pipeline", + "VK_KHR_relaxed_block_layout", + "VK_KHR_sampler_mirror_clamp_to_edge", + "VK_KHR_sampler_ycbcr_conversion", + "VK_KHR_separate_depth_stencil_layouts", + "VK_KHR_shader_atomic_int64", + "VK_KHR_shader_clock", + "VK_KHR_shader_draw_parameters", + "VK_KHR_shader_float16_int8", + "VK_KHR_shader_float_controls", + "VK_KHR_shader_integer_dot_product", + "VK_KHR_shader_non_semantic_info", + "VK_KHR_shader_subgroup_extended_types", + "VK_KHR_shader_subgroup_uniform_control_flow", + "VK_KHR_shader_terminate_invocation", + "VK_KHR_shared_presentable_image", + "VK_KHR_spirv_1_4", + "VK_KHR_storage_buffer_storage_class", + "VK_KHR_swapchain", + "VK_KHR_swapchain_mutable_format", + "VK_KHR_synchronization2", + "VK_KHR_timeline_semaphore", + "VK_KHR_uniform_buffer_standard_layout", + "VK_KHR_variable_pointers", + "VK_KHR_video_decode_queue", + "VK_KHR_video_encode_queue", + "VK_KHR_video_queue", + "VK_KHR_vulkan_memory_model", + "VK_KHR_win32_keyed_mutex", + "VK_KHR_workgroup_memory_explicit_layout", + "VK_KHR_zero_initialize_workgroup_memory", + "VK_EXT_4444_formats", + "VK_EXT_astc_decode_mode", + "VK_EXT_blend_operation_advanced", + "VK_EXT_border_color_swizzle", + "VK_EXT_buffer_device_address", + "VK_EXT_calibrated_timestamps", + "VK_EXT_color_write_enable", + "VK_EXT_conditional_rendering", + "VK_EXT_conservative_rasterization", + "VK_EXT_custom_border_color", + "VK_EXT_debug_marker", + "VK_EXT_depth_clip_control", + "VK_EXT_depth_clip_enable", + "VK_EXT_depth_range_unrestricted", + "VK_EXT_descriptor_indexing", + "VK_EXT_device_memory_report", + "VK_EXT_discard_rectangles", + "VK_EXT_display_control", + "VK_EXT_extended_dynamic_state", + "VK_EXT_extended_dynamic_state2", + "VK_EXT_external_memory_dma_buf", + "VK_EXT_external_memory_host", + "VK_EXT_filter_cubic", + "VK_EXT_fragment_density_map", + "VK_EXT_fragment_density_map2", + "VK_EXT_fragment_shader_interlock", + "VK_EXT_full_screen_exclusive", + "VK_EXT_global_priority", + "VK_EXT_global_priority_query", + "VK_EXT_hdr_metadata", + "VK_EXT_host_query_reset", + "VK_EXT_image_drm_format_modifier", + "VK_EXT_image_robustness", + "VK_EXT_image_view_min_lod", + "VK_EXT_index_type_uint8", + "VK_EXT_inline_uniform_block", + "VK_EXT_line_rasterization", + "VK_EXT_load_store_op_none", + "VK_EXT_memory_budget", + "VK_EXT_memory_priority", + "VK_EXT_multi_draw", + "VK_EXT_pageable_device_local_memory", + "VK_EXT_pci_bus_info", + "VK_EXT_physical_device_drm", + "VK_EXT_pipeline_creation_cache_control", + "VK_EXT_pipeline_creation_feedback", + "VK_EXT_post_depth_coverage", + "VK_EXT_primitive_topology_list_restart", + "VK_EXT_private_data", + "VK_EXT_provoking_vertex", + "VK_EXT_queue_family_foreign", + "VK_EXT_rgba10x6_formats", + "VK_EXT_robustness2", + "VK_EXT_sample_locations", + "VK_EXT_sampler_filter_minmax", + "VK_EXT_scalar_block_layout", + "VK_EXT_separate_stencil_usage", + "VK_EXT_shader_atomic_float", + "VK_EXT_shader_atomic_float2", + "VK_EXT_shader_demote_to_helper_invocation", + "VK_EXT_shader_image_atomic_int64", + "VK_EXT_shader_stencil_export", + "VK_EXT_shader_subgroup_ballot", + "VK_EXT_shader_subgroup_vote", + "VK_EXT_shader_viewport_index_layer", + "VK_EXT_subgroup_size_control", + "VK_EXT_texel_buffer_alignment", + "VK_EXT_texture_compression_astc_hdr", + "VK_EXT_tooling_info", + "VK_EXT_transform_feedback", + "VK_EXT_validation_cache", + "VK_EXT_vertex_attribute_divisor", + "VK_EXT_vertex_input_dynamic_state", + "VK_EXT_video_decode_h264", + "VK_EXT_video_decode_h265", + "VK_EXT_video_encode_h264", + "VK_EXT_video_encode_h265", + "VK_EXT_ycbcr_2plane_444_formats", + "VK_EXT_ycbcr_image_arrays", + "VK_AMD_buffer_marker", + "VK_AMD_device_coherent_memory", + "VK_AMD_display_native_hdr", + "VK_AMD_draw_indirect_count", + "VK_AMD_gcn_shader", + "VK_AMD_gpu_shader_half_float", + "VK_AMD_gpu_shader_int16", + "VK_AMD_memory_overallocation_behavior", + "VK_AMD_mixed_attachment_samples", + "VK_AMD_negative_viewport_height", + "VK_AMD_pipeline_compiler_control", + "VK_AMD_rasterization_order", + "VK_AMD_shader_ballot", + "VK_AMD_shader_core_properties", + "VK_AMD_shader_core_properties2", + "VK_AMD_shader_explicit_vertex_parameter", + "VK_AMD_shader_fragment_mask", + "VK_AMD_shader_image_load_store_lod", + "VK_AMD_shader_info", + "VK_AMD_shader_trinary_minmax", + "VK_AMD_texture_gather_bias_lod", + "VK_ANDROID_external_memory_android_hardware_buffer", + "VK_ARM_rasterization_order_attachment_access", + "VK_FUCHSIA_buffer_collection", + "VK_FUCHSIA_external_memory", + "VK_FUCHSIA_external_semaphore", + "VK_GGP_frame_token", + "VK_GOOGLE_decorate_string", + "VK_GOOGLE_display_timing", + "VK_GOOGLE_hlsl_functionality1", + "VK_GOOGLE_user_type", + "VK_HUAWEI_invocation_mask", + "VK_HUAWEI_subpass_shading", + "VK_IMG_filter_cubic", + "VK_IMG_format_pvrtc", + "VK_INTEL_performance_query", + "VK_INTEL_shader_integer_functions2", + "VK_NV_acquire_winrt_display", + "VK_NV_clip_space_w_scaling", + "VK_NV_compute_shader_derivatives", + "VK_NV_cooperative_matrix", + "VK_NV_corner_sampled_image", + "VK_NV_coverage_reduction_mode", + "VK_NV_dedicated_allocation", + "VK_NV_dedicated_allocation_image_aliasing", + "VK_NV_device_diagnostic_checkpoints", + "VK_NV_device_diagnostics_config", + "VK_NV_device_generated_commands", + "VK_NV_external_memory", + "VK_NV_external_memory_rdma", + "VK_NV_external_memory_win32", + "VK_NV_fill_rectangle", + "VK_NV_fragment_coverage_to_color", + "VK_NV_fragment_shader_barycentric", + "VK_NV_fragment_shading_rate_enums", + "VK_NV_framebuffer_mixed_samples", + "VK_NV_geometry_shader_passthrough", + "VK_NV_glsl_shader", + "VK_NV_inherited_viewport_scissor", + "VK_NV_mesh_shader", + "VK_NV_ray_tracing", + "VK_NV_ray_tracing_motion_blur", + "VK_NV_representative_fragment_test", + "VK_NV_sample_mask_override_coverage", + "VK_NV_scissor_exclusive", + "VK_NV_shader_image_footprint", + "VK_NV_shader_sm_builtins", + "VK_NV_shader_subgroup_partitioned", + "VK_NV_shading_rate_image", + "VK_NV_viewport_array2", + "VK_NV_viewport_swizzle", + "VK_NV_win32_keyed_mutex", + "VK_QCOM_render_pass_shader_resolve", + "VK_QCOM_render_pass_store_ops", + "VK_QCOM_render_pass_transform", + "VK_QCOM_rotated_copy_commands", + "VK_VALVE_mutable_descriptor_type", + "VK_QCOM_fragment_density_map_offset", + "VK_NV_linear_color_attachment", + "VK_KHR_global_priority" + ], + "default": [] + }, + { + "key": "exclude_formats", + "label": "Exclude Formats", + "description": "Removes the format feature flags from being reported by the Vulkan physical device.", + "status": "STABLE", + "type": "LIST", + "list": [ + "VK_FORMAT_R4G4_UNORM_PACK8", + "VK_FORMAT_R4G4B4A4_UNORM_PACK16", + "VK_FORMAT_B4G4R4A4_UNORM_PACK16", + "VK_FORMAT_R5G6B5_UNORM_PACK16", + "VK_FORMAT_B5G6R5_UNORM_PACK16", + "VK_FORMAT_R5G5B5A1_UNORM_PACK16", + "VK_FORMAT_B5G5R5A1_UNORM_PACK16", + "VK_FORMAT_A1R5G5B5_UNORM_PACK16", + "VK_FORMAT_R8_UNORM", + "VK_FORMAT_R8_SNORM", + "VK_FORMAT_R8_USCALED", + "VK_FORMAT_R8_SSCALED", + "VK_FORMAT_R8_UINT", + "VK_FORMAT_R8_SINT", + "VK_FORMAT_R8_SRGB", + "VK_FORMAT_R8G8_UNORM", + "VK_FORMAT_R8G8_SNORM", + "VK_FORMAT_R8G8_USCALED", + "VK_FORMAT_R8G8_SSCALED", + "VK_FORMAT_R8G8_UINT", + "VK_FORMAT_R8G8_SINT", + "VK_FORMAT_R8G8_SRGB", + "VK_FORMAT_R8G8B8_UNORM", + "VK_FORMAT_R8G8B8_SNORM", + "VK_FORMAT_R8G8B8_USCALED", + "VK_FORMAT_R8G8B8_SSCALED", + "VK_FORMAT_R8G8B8_UINT", + "VK_FORMAT_R8G8B8_SINT", + "VK_FORMAT_R8G8B8_SRGB", + "VK_FORMAT_B8G8R8_UNORM", + "VK_FORMAT_B8G8R8_SNORM", + "VK_FORMAT_B8G8R8_USCALED", + "VK_FORMAT_B8G8R8_SSCALED", + "VK_FORMAT_B8G8R8_UINT", + "VK_FORMAT_B8G8R8_SINT", + "VK_FORMAT_B8G8R8_SRGB", + "VK_FORMAT_R8G8B8A8_UNORM", + "VK_FORMAT_R8G8B8A8_SNORM", + "VK_FORMAT_R8G8B8A8_USCALED", + "VK_FORMAT_R8G8B8A8_SSCALED", + "VK_FORMAT_R8G8B8A8_UINT", + "VK_FORMAT_R8G8B8A8_SINT", + "VK_FORMAT_R8G8B8A8_SRGB", + "VK_FORMAT_B8G8R8A8_UNORM", + "VK_FORMAT_B8G8R8A8_SNORM", + "VK_FORMAT_B8G8R8A8_USCALED", + "VK_FORMAT_B8G8R8A8_SSCALED", + "VK_FORMAT_B8G8R8A8_UINT", + "VK_FORMAT_B8G8R8A8_SINT", + "VK_FORMAT_B8G8R8A8_SRGB", + "VK_FORMAT_A8B8G8R8_UNORM_PACK32", + "VK_FORMAT_A8B8G8R8_SNORM_PACK32", + "VK_FORMAT_A8B8G8R8_USCALED_PACK32", + "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", + "VK_FORMAT_A8B8G8R8_UINT_PACK32", + "VK_FORMAT_A8B8G8R8_SINT_PACK32", + "VK_FORMAT_A8B8G8R8_SRGB_PACK32", + "VK_FORMAT_A2R10G10B10_UNORM_PACK32", + "VK_FORMAT_A2R10G10B10_SNORM_PACK32", + "VK_FORMAT_A2R10G10B10_USCALED_PACK32", + "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", + "VK_FORMAT_A2R10G10B10_UINT_PACK32", + "VK_FORMAT_A2R10G10B10_SINT_PACK32", + "VK_FORMAT_A2B10G10R10_UNORM_PACK32", + "VK_FORMAT_A2B10G10R10_SNORM_PACK32", + "VK_FORMAT_A2B10G10R10_USCALED_PACK32", + "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", + "VK_FORMAT_A2B10G10R10_UINT_PACK32", + "VK_FORMAT_A2B10G10R10_SINT_PACK32", + "VK_FORMAT_R16_UNORM", + "VK_FORMAT_R16_SNORM", + "VK_FORMAT_R16_USCALED", + "VK_FORMAT_R16_SSCALED", + "VK_FORMAT_R16_UINT", + "VK_FORMAT_R16_SINT", + "VK_FORMAT_R16_SFLOAT", + "VK_FORMAT_R16G16_UNORM", + "VK_FORMAT_R16G16_SNORM", + "VK_FORMAT_R16G16_USCALED", + "VK_FORMAT_R16G16_SSCALED", + "VK_FORMAT_R16G16_UINT", + "VK_FORMAT_R16G16_SINT", + "VK_FORMAT_R16G16_SFLOAT", + "VK_FORMAT_R16G16B16_UNORM", + "VK_FORMAT_R16G16B16_SNORM", + "VK_FORMAT_R16G16B16_USCALED", + "VK_FORMAT_R16G16B16_SSCALED", + "VK_FORMAT_R16G16B16_UINT", + "VK_FORMAT_R16G16B16_SINT", + "VK_FORMAT_R16G16B16_SFLOAT", + "VK_FORMAT_R16G16B16A16_UNORM", + "VK_FORMAT_R16G16B16A16_SNORM", + "VK_FORMAT_R16G16B16A16_USCALED", + "VK_FORMAT_R16G16B16A16_SSCALED", + "VK_FORMAT_R16G16B16A16_UINT", + "VK_FORMAT_R16G16B16A16_SINT", + "VK_FORMAT_R16G16B16A16_SFLOAT", + "VK_FORMAT_R32_UINT", + "VK_FORMAT_R32_SINT", + "VK_FORMAT_R32_SFLOAT", + "VK_FORMAT_R32G32_UINT", + "VK_FORMAT_R32G32_SINT", + "VK_FORMAT_R32G32_SFLOAT", + "VK_FORMAT_R32G32B32_UINT", + "VK_FORMAT_R32G32B32_SINT", + "VK_FORMAT_R32G32B32_SFLOAT", + "VK_FORMAT_R32G32B32A32_UINT", + "VK_FORMAT_R32G32B32A32_SINT", + "VK_FORMAT_R32G32B32A32_SFLOAT", + "VK_FORMAT_R64_UINT", + "VK_FORMAT_R64_SINT", + "VK_FORMAT_R64_SFLOAT", + "VK_FORMAT_R64G64_UINT", + "VK_FORMAT_R64G64_SINT", + "VK_FORMAT_R64G64_SFLOAT", + "VK_FORMAT_R64G64B64_UINT", + "VK_FORMAT_R64G64B64_SINT", + "VK_FORMAT_R64G64B64_SFLOAT", + "VK_FORMAT_R64G64B64A64_UINT", + "VK_FORMAT_R64G64B64A64_SINT", + "VK_FORMAT_R64G64B64A64_SFLOAT", + "VK_FORMAT_B10G11R11_UFLOAT_PACK32", + "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", + "VK_FORMAT_D16_UNORM", + "VK_FORMAT_X8_D24_UNORM_PACK32", + "VK_FORMAT_D32_SFLOAT", + "VK_FORMAT_S8_UINT", + "VK_FORMAT_D16_UNORM_S8_UINT", + "VK_FORMAT_D24_UNORM_S8_UINT", + "VK_FORMAT_D32_SFLOAT_S8_UINT", + "VK_FORMAT_BC1_RGB_UNORM_BLOCK", + "VK_FORMAT_BC1_RGB_SRGB_BLOCK", + "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", + "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", + "VK_FORMAT_BC2_UNORM_BLOCK", + "VK_FORMAT_BC2_SRGB_BLOCK", + "VK_FORMAT_BC3_UNORM_BLOCK", + "VK_FORMAT_BC3_SRGB_BLOCK", + "VK_FORMAT_BC4_UNORM_BLOCK", + "VK_FORMAT_BC4_SNORM_BLOCK", + "VK_FORMAT_BC5_UNORM_BLOCK", + "VK_FORMAT_BC5_SNORM_BLOCK", + "VK_FORMAT_BC6H_UFLOAT_BLOCK", + "VK_FORMAT_BC6H_SFLOAT_BLOCK", + "VK_FORMAT_BC7_UNORM_BLOCK", + "VK_FORMAT_BC7_SRGB_BLOCK", + "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", + "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", + "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", + "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", + "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", + "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", + "VK_FORMAT_EAC_R11_UNORM_BLOCK", + "VK_FORMAT_EAC_R11_SNORM_BLOCK", + "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", + "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", + "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", + "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", + "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", + "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", + "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", + "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", + "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", + "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", + "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", + "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", + "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", + "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", + "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", + "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", + "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", + "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", + "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", + "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", + "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", + "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", + "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", + "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", + "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", + "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", + "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", + "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", + "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", + "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", + "VK_FORMAT_G8B8G8R8_422_UNORM", + "VK_FORMAT_B8G8R8G8_422_UNORM", + "VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", + "VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", + "VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", + "VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", + "VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", + "VK_FORMAT_R10X6_UNORM_PACK16", + "VK_FORMAT_R10X6G10X6_UNORM_2PACK16", + "VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", + "VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", + "VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", + "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", + "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", + "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", + "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", + "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", + "VK_FORMAT_R12X4_UNORM_PACK16", + "VK_FORMAT_R12X4G12X4_UNORM_2PACK16", + "VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", + "VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", + "VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", + "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", + "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", + "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", + "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", + "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", + "VK_FORMAT_G16B16G16R16_422_UNORM", + "VK_FORMAT_B16G16R16G16_422_UNORM", + "VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", + "VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", + "VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", + "VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", + "VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", + "VK_FORMAT_G8_B8R8_2PLANE_444_UNORM", + "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16", + "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16", + "VK_FORMAT_G16_B16R16_2PLANE_444_UNORM", + "VK_FORMAT_A4R4G4B4_UNORM_PACK16", + "VK_FORMAT_A4B4G4R4_UNORM_PACK16", + "VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK", + "VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK", + "VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG", + "VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG", + "VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG", + "VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG", + "VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG", + "VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG", + "VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG", + "VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG" + ], + "default": [] + }, + { + "key": "debug_actions", + "label": "Debug Actions", + "description": "This indicates what action is to be taken when a layer wants to report information", + "status": "STABLE", + "type": "FLAGS", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "flags": [ + { + "key": "DEBUG_ACTION_STDOUT_BIT", + "label": "Log to stdout", + "description": "Log messages using the stdout." + }, + { + "key": "DEBUG_ACTION_OUTPUT_BIT", + "label": "Log to OutputDebugString", + "description": "Log messages using the Windows OutputDebugString for Vulkan Studio output display.", + "platforms": [ "WINDOWS" ] + }, + { + "key": "DEBUG_ACTION_FILE_BIT", + "label": "Log to File", + "description": "Log messages to a file.", + "settings": [ + { + "key": "debug_filename", + "label": "Log Filename", + "description": "Specifies the output filename", + "type": "SAVE_FILE", + "default": "profiles_layer_log.txt", + "dependence": { + "mode": "ANY", + "settings": [ + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + } + ] + } + }, + { + "key": "debug_file_clear", + "label": "Clear Log at Launch", + "description": "Discard the content of the log file between each layer run", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ANY", + "settings": [ + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + }, + { + "key": "debug_actions", + "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ] + } + ] + } + } + ], + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "expanded": true + }, + { + "key": "DEBUG_ACTION_BREAKPOINT_BIT", + "label": "Break", + "description": "Trigger a breakpoint if a debugger is in use." + } + ], + "default": [ "DEBUG_ACTION_STDOUT_BIT" ] + }, + { + "key": "debug_fail_on_error", + "label": "Fail on Error", + "description": "If the device doesn't support the capabilities of the selected Profile, the layer fail to load. When enabled, vkEnumeratePhysicalDevices will fail when the selected Profile is not supported.", + "status": "STABLE", + "type": "BOOL", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "default": false + }, + { + "key": "debug_reports", + "label": "Message Types", + "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back", + "status": "STABLE", + "type": "FLAGS", + "platforms": [ "WINDOWS", "LINUX", "MACOS" ], + "flags": [ + { + "key": "DEBUG_REPORT_NOTIFICATION_BIT", + "label": "Notification", + "description": "Report notifications." + }, + { + "key": "DEBUG_REPORT_WARNING_BIT", + "label": "Warning", + "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." + }, + { + "key": "DEBUG_REPORT_ERROR_BIT", + "label": "Error", + "description": "Report errors in API usage." + }, + { + "key": "DEBUG_REPORT_DEBUG_BIT", + "label": "Debug", + "description": "Report debug information for the Profiles Layer development.", + "view": "ADVANCED" + } + ], + "default": [ + "DEBUG_REPORT_NOTIFICATION_BIT", + "DEBUG_REPORT_WARNING_BIT", + "DEBUG_REPORT_ERROR_BIT" + ] + } + ] + } + } +} diff --git a/vkconfig_core/test/sdk/VkLayer_khronos_shader_object.json b/vkconfig_core/test/sdk/VkLayer_khronos_shader_object.json new file mode 100644 index 0000000000..d3b9a2a4f4 --- /dev/null +++ b/vkconfig_core/test/sdk/VkLayer_khronos_shader_object.json @@ -0,0 +1,90 @@ +{ + "file_format_version" : "1.2.0", + "layer": { + "name": "VK_LAYER_KHRONOS_shader_object", + "type": "GLOBAL", + "library_path": ".\\VkLayer_khronos_shader_object.dll", + "api_version": "1.3.283", + "implementation_version": "1", + "description": "Khronos Shader object layer", + "instance_extensions": [ + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + } + ], + "device_extensions": [ + { + "name": "VK_EXT_shader_object", + "spec_version": "1", + "entrypoints": [ + "vkCmdBindShadersEXT", + "vkCmdBindVertexBuffers2EXT", + "vkCmdSetAlphaToCoverageEnableEXT", + "vkCmdSetAlphaToOneEnableEXT", + "vkCmdSetColorBlendAdvancedEXT", + "vkCmdSetColorBlendEnableEXT", + "vkCmdSetColorBlendEquationEXT", + "vkCmdSetColorWriteMaskEXT", + "vkCmdSetConservativeRasterizationModeEXT", + "vkCmdSetCoverageModulationModeNV", + "vkCmdSetCoverageModulationTableEnableNV", + "vkCmdSetCoverageModulationTableNV", + "vkCmdSetCoverageReductionModeNV", + "vkCmdSetCoverageToColorEnableNV", + "vkCmdSetCoverageToColorLocationNV", + "vkCmdSetCullModeEXT", + "vkCmdSetDepthBiasEnableEXT", + "vkCmdSetDepthBoundsTestEnableEXT", + "vkCmdSetDepthClampEnableEXT", + "vkCmdSetDepthClipEnableEXT", + "vkCmdSetDepthClipNegativeOneToOneEXT", + "vkCmdSetDepthCompareOpEXT", + "vkCmdSetDepthTestEnableEXT", + "vkCmdSetDepthWriteEnableEXT", + "vkCmdSetExtraPrimitiveOverestimationSizeEXT", + "vkCmdSetFrontFaceEXT", + "vkCmdSetLineRasterizationModeEXT", + "vkCmdSetLineStippleEnableEXT", + "vkCmdSetLogicOpEXT", + "vkCmdSetLogicOpEnableEXT", + "vkCmdSetPatchControlPointsEXT", + "vkCmdSetPolygonModeEXT", + "vkCmdSetPrimitiveRestartEnableEXT", + "vkCmdSetPrimitiveTopologyEXT", + "vkCmdSetProvokingVertexModeEXT", + "vkCmdSetRasterizationSamplesEXT", + "vkCmdSetRasterizationStreamEXT", + "vkCmdSetRasterizerDiscardEnableEXT", + "vkCmdSetRepresentativeFragmentTestEnableNV", + "vkCmdSetSampleLocationsEnableEXT", + "vkCmdSetSampleMaskEXT", + "vkCmdSetScissorWithCountEXT", + "vkCmdSetShadingRateImageEnableNV", + "vkCmdSetStencilOpEXT", + "vkCmdSetStencilTestEnableEXT", + "vkCmdSetTessellationDomainOriginEXT", + "vkCmdSetVertexInputEXT", + "vkCmdSetViewportSwizzleNV", + "vkCmdSetViewportWScalingEnableNV", + "vkCmdSetViewportWithCountEXT", + "vkCreateShadersEXT", + "vkDestroyShaderEXT", + "vkGetShaderBinaryDataEXT" + ] + } + ], + "features": { + "settings": [ + { + "key": "force_enable", + "env": "VK_SHADER_OBJECT_FORCE_ENABLE", + "label": "Force Enable", + "description": "Force the layer to be active even if the underlying driver also implements the shader object extension.", + "type": "BOOL", + "default": false + } + ] + } + } +} diff --git a/vkconfig_core/layers/170/VK_LAYER_KHRONOS_synchronization2.json b/vkconfig_core/test/sdk/VkLayer_khronos_synchronization2.json similarity index 52% rename from vkconfig_core/layers/170/VK_LAYER_KHRONOS_synchronization2.json rename to vkconfig_core/test/sdk/VkLayer_khronos_synchronization2.json index a35effffbb..7b3fc1556e 100644 --- a/vkconfig_core/layers/170/VK_LAYER_KHRONOS_synchronization2.json +++ b/vkconfig_core/test/sdk/VkLayer_khronos_synchronization2.json @@ -3,27 +3,43 @@ "layer": { "name": "VK_LAYER_KHRONOS_synchronization2", "type": "GLOBAL", - "library_path": "./libVkLayer_khronos_synchronization2.so", - "api_version": "1.2.170", + "library_path": ".\\VkLayer_khronos_synchronization2.dll", + "api_version": "1.3.283", "implementation_version": "1", "description": "Khronos Synchronization2 layer", "introduction": "The VK_LAYER_KHRONOS_synchronization2 extension layer implements the VK_KHR_synchronization2 extension.", "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/synchronization2_layer.html", + "status": "STABLE", "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], - "status": "BETA", + "instance_extensions": [ + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + } + ], "device_extensions": [ { "name": "VK_KHR_synchronization2", - "spec_version": 1 + "spec_version": "1", + "entrypoints": [ + "vkCmdSetEvent2KHR", + "vkCmdResetEvent2KHR", + "vkCmdWaitEvents2KHR", + "vkCmdPipelineBarrier2KHR", + "vkCmdWriteTimestamp2KHR", + "vkQueueSubmit2KHR", + "vkCmdWriteBufferMarker2AMD", + "vkGetQueueCheckpointData2NV" + ] } ], "features": { "settings": [ { "key": "force_enable", - "env": "VK_SYNC2_FORCE_ENABLE", + "env": "VK_SYNCHRONIZATION2_FORCE_ENABLE", "label": "Force Enable", - "description": "Force the layer to be active even if the underlying driver already supports the synchonization2 extension.", + "description": "Force the layer to be active even if the underlying driver also implements the synchonization2 extension.", "type": "BOOL", "default": false } diff --git a/vkconfig_core/test/sdk/VkLayer_khronos_validation.json b/vkconfig_core/test/sdk/VkLayer_khronos_validation.json new file mode 100644 index 0000000000..082dacc1ff --- /dev/null +++ b/vkconfig_core/test/sdk/VkLayer_khronos_validation.json @@ -0,0 +1,1694 @@ +{ + "file_format_version": "1.2.0", + "layer": { + "name": "VK_LAYER_KHRONOS_validation", + "type": "GLOBAL", + "library_path": ".\\VkLayer_khronos_validation.dll", + "api_version": "1.3.283", + "implementation_version": "1", + "description": "Khronos Validation Layer", + "introduction": "The main, comprehensive Khronos validation layer.\n\nVulkan is an Explicit API, enabling direct control over how GPUs actually work. By design, minimal error checking is done inside a Vulkan driver. Applications have full control and responsibility for correct operation. Any errors in how Vulkan is used can result in a crash. \n\nThe Khronos Valiation Layer can be enabled to assist development by enabling developers to verify their applications correctly use the Vulkan API.", + "platforms": [ + "WINDOWS", + "LINUX", + "ANDROID", + "MACOS" + ], + "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/khronos_validation_layer.html", + "instance_extensions": [ + { + "name": "VK_EXT_debug_report", + "spec_version": "9" + }, + { + "name": "VK_EXT_debug_utils", + "spec_version": "1" + }, + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + }, + { + "name": "VK_EXT_validation_features", + "spec_version": "2" + } + ], + "device_extensions": [ + { + "name": "VK_EXT_debug_marker", + "spec_version": "4", + "entrypoints": [ + "vkDebugMarkerSetObjectTagEXT", + "vkDebugMarkerSetObjectNameEXT", + "vkCmdDebugMarkerBeginEXT", + "vkCmdDebugMarkerEndEXT", + "vkCmdDebugMarkerInsertEXT" + ] + }, + { + "name": "VK_EXT_validation_cache", + "spec_version": "1", + "entrypoints": [ + "vkCreateValidationCacheEXT", + "vkDestroyValidationCacheEXT", + "vkGetValidationCacheDataEXT", + "vkMergeValidationCachesEXT" + ] + }, + { + "name": "VK_EXT_tooling_info", + "spec_version": "1", + "entrypoints": [ + "vkGetPhysicalDeviceToolPropertiesEXT" + ] + } + ], + "features": { + "presets": [ + { + "label": "Standard", + "description": "Good default validation setup that balance validation coverage and performance.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "status": "STABLE", + "settings": [ + { + "key": "validate_core", + "value": true + }, + { + "key": "check_image_layout", + "value": true + }, + { + "key": "check_command_buffer", + "value": true + }, + { + "key": "check_object_in_use", + "value": true + }, + { + "key": "check_query", + "value": true + }, + { + "key": "check_shaders", + "value": true + }, + { + "key": "check_shaders_caching", + "value": true + }, + { + "key": "unique_handles", + "value": true + }, + { + "key": "object_lifetime", + "value": true + }, + { + "key": "stateless_param", + "value": true + }, + { + "key": "thread_safety", + "value": false + }, + { + "key": "validate_sync", + "value": false + }, + { + "key": "validate_gpu_based", + "value": "GPU_BASED_NONE" + }, + { + "key": "validate_best_practices", + "value": false + }, + { + "key": "report_flags", + "value": ["error"] + } + ] + }, + { + "label": "Reduced-Overhead", + "description": "Disables some checks in the interest of better performance.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS" + ], + "status": "STABLE", + "settings": [ + { + "key": "validate_core", + "value": true + }, + { + "key": "check_image_layout", + "value": false + }, + { + "key": "check_command_buffer", + "value": false + }, + { + "key": "check_object_in_use", + "value": false + }, + { + "key": "check_query", + "value": false + }, + { + "key": "check_shaders", + "value": true + }, + { + "key": "check_shaders_caching", + "value": true + }, + { + "key": "unique_handles", + "value": false + }, + { + "key": "object_lifetime", + "value": true + }, + { + "key": "stateless_param", + "value": true + }, + { + "key": "thread_safety", + "value": false + }, + { + "key": "validate_sync", + "value": false + }, + { + "key": "validate_gpu_based", + "value": "GPU_BASED_NONE" + }, + { + "key": "validate_best_practices", + "value": false + }, + { + "key": "report_flags", + "value": ["error"] + } + ] + }, + { + "label": "Best Practices", + "description": "Provides warnings on valid API usage that is potential API misuse.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "status": "STABLE", + "settings": [ + { + "key": "validate_core", + "value": false + }, + { + "key": "check_image_layout", + "value": false + }, + { + "key": "check_command_buffer", + "value": false + }, + { + "key": "check_object_in_use", + "value": false + }, + { + "key": "check_query", + "value": false + }, + { + "key": "check_shaders", + "value": false + }, + { + "key": "check_shaders_caching", + "value": false + }, + { + "key": "unique_handles", + "value": false + }, + { + "key": "object_lifetime", + "value": false + }, + { + "key": "stateless_param", + "value": false + }, + { + "key": "thread_safety", + "value": false + }, + { + "key": "validate_sync", + "value": false + }, + { + "key": "validate_gpu_based", + "value": "GPU_BASED_NONE" + }, + { + "key": "validate_best_practices", + "value": true + }, + { + "key": "report_flags", + "value": ["error", "warn", "perf"] + } + ] + }, + { + "label": "Synchronization", + "description": "Identify resource access conflicts due to missing or incorrect synchronization operations between actions reading or writing the same regions of memory.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "status": "STABLE", + "settings": [ + { + "key": "validate_core", + "value": false + }, + { + "key": "check_image_layout", + "value": false + }, + { + "key": "check_command_buffer", + "value": false + }, + { + "key": "check_object_in_use", + "value": false + }, + { + "key": "check_query", + "value": false + }, + { + "key": "check_shaders", + "value": false + }, + { + "key": "check_shaders_caching", + "value": false + }, + { + "key": "unique_handles", + "value": true + }, + { + "key": "object_lifetime", + "value": false + }, + { + "key": "stateless_param", + "value": false + }, + { + "key": "thread_safety", + "value": true + }, + { + "key": "validate_sync", + "value": true + }, + { + "key": "sync_queue_submit", + "value": true + }, + { + "key": "validate_gpu_based", + "value": "GPU_BASED_NONE" + }, + { + "key": "validate_best_practices", + "value": false + }, + { + "key": "report_flags", + "value": ["error"] + } + ] + }, + { + "label": "GPU-Assisted", + "description": "Check for API usage errors at shader execution time.", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "status": "STABLE", + "settings": [ + { + "key": "validate_core", + "value": false + }, + { + "key": "check_image_layout", + "value": false + }, + { + "key": "check_command_buffer", + "value": false + }, + { + "key": "check_object_in_use", + "value": false + }, + { + "key": "check_query", + "value": false + }, + { + "key": "check_shaders", + "value": false + }, + { + "key": "check_shaders_caching", + "value": false + }, + { + "key": "unique_handles", + "value": false + }, + { + "key": "object_lifetime", + "value": false + }, + { + "key": "stateless_param", + "value": false + }, + { + "key": "thread_safety", + "value": false + }, + { + "key": "validate_sync", + "value": false + }, + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + }, + { + "key": "gpuav_reserve_binding_slot", + "value": true + }, + { + "key": "validate_best_practices", + "value": false + }, + { + "key": "report_flags", + "value": ["error"] + } + ] + }, + { + "label": "Debug Printf", + "description": "Debug shader code by \"printing\" any values of interest to the debug callback or stdout.", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "status": "STABLE", + "settings": [ + { + "key": "validate_core", + "value": false + }, + { + "key": "check_image_layout", + "value": false + }, + { + "key": "check_command_buffer", + "value": false + }, + { + "key": "check_object_in_use", + "value": false + }, + { + "key": "check_query", + "value": false + }, + { + "key": "check_shaders", + "value": false + }, + { + "key": "check_shaders_caching", + "value": false + }, + { + "key": "unique_handles", + "value": false + }, + { + "key": "object_lifetime", + "value": false + }, + { + "key": "stateless_param", + "value": false + }, + { + "key": "thread_safety", + "value": false + }, + { + "key": "validate_sync", + "value": false + }, + { + "key": "validate_gpu_based", + "value": "GPU_BASED_DEBUG_PRINTF" + }, + { + "key": "validate_best_practices", + "value": false + }, + { + "key": "report_flags", + "value": ["error"] + } + ] + } + ], + "settings": [ + { + "key": "validation_control", + "label": "Validation Areas", + "description": "Control of the Validation layer validation", + "type": "GROUP", + "expanded": true, + "settings": [ + { + "key": "fine_grained_locking", + "env": "VK_LAYER_FINE_GRAINED_LOCKING", + "label": "Fine Grained Locking", + "description": "Enable fine grained locking for Core Validation, which should improve performance in multithreaded applications. This setting allows the optimization to be disabled for debugging.", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "validate_core", + "label": "Core", + "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors.", + "type": "BOOL", + "default": true, + "settings": [ + { + "key": "check_image_layout", + "label": "Image Layout", + "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_core", + "value": true + } + ] + } + }, + { + "key": "check_command_buffer", + "label": "Command Buffer State", + "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_core", + "value": true + } + ] + } + }, + { + "key": "check_object_in_use", + "label": "Object in Use", + "description": "Check that Vulkan objects are not in use by a command buffer when they are destroyed.", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_core", + "value": true + } + ] + } + }, + { + "key": "check_query", + "label": "Query", + "description": "Checks for commands that use VkQueryPool objects.", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_core", + "value": true + } + ] + } + }, + { + "key": "check_shaders", + "label": "Shader", + "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", + "type": "BOOL", + "default": true, + "expanded": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_core", + "value": true + } + ] + }, + "settings": [ + { + "key": "check_shaders_caching", + "label": "Caching", + "description": "Enable caching of shader validation results.", + "type": "BOOL", + "default": true, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_core", + "value": true + }, + { + "key": "check_shaders", + "value": true + } + ] + } + } + ] + } + ] + }, + { + "key": "unique_handles", + "label": "Handle Wrapping", + "description": "Handle wrapping checks. Disable this feature if you are exerience crashes when creating new extensions or developing new Vulkan objects/structures.", + "type": "BOOL", + "default": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "object_lifetime", + "label": "Object Lifetime", + "description": "Object tracking checks. This may not always be necessary late in a development cycle.", + "type": "BOOL", + "default": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "stateless_param", + "label": "Stateless Parameter", + "description": "Stateless parameter checks. This may not always be necessary late in a development cycle.", + "type": "BOOL", + "default": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "thread_safety", + "label": "Thread Safety", + "description": "Thread checks. In order to not degrade performance, it might be best to run your program with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check or when debugging difficult application behaviors.", + "type": "BOOL", + "default": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "validate_sync", + "label": "Synchronization", + "description": "Enable synchronization validation during command buffers recording. This feature reports resource access conflicts due to missing or incorrect synchronization operations between actions (Draw, Copy, Dispatch, Blit) reading or writing the same regions of memory.", + "url": "${LUNARG_SDK}/synchronization_usage.html", + "type": "BOOL", + "default": false, + "expanded": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "settings": [ + { + "key": "sync_queue_submit", + "label": "QueueSubmit Synchronization Validation", + "description": "Enable synchronization validation between submitted command buffers when Synchronization Validation is enabled. This option will increase the synchronization performance cost.", + "type": "BOOL", + "default": true, + "status": "STABLE", + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_sync", + "value": true + } + ] + } + } + ] + }, + { + "key": "validate_gpu_based", + "label": "GPU Base", + "description": "Setting an option here will enable specialized areas of validation", + "type": "ENUM", + "default": "GPU_BASED_NONE", + "expanded": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "flags": [ + { + "key": "GPU_BASED_NONE", + "label": "None", + "description": "No GPU-based validation." + }, + { + "key": "GPU_BASED_DEBUG_PRINTF", + "label": "Debug Printf", + "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback.", + "url": "${LUNARG_SDK}/debug_printf.html", + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "settings": [ + { + "key": "printf_to_stdout", + "label": "Redirect Printf messages to stdout", + "description": "Enable redirection of Debug Printf messages from the debug callback to stdout", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_DEBUG_PRINTF" + } + ] + } + }, + { + "key": "printf_verbose", + "label": "Printf verbose", + "description": "Set the verbosity of debug printf messages", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_DEBUG_PRINTF" + } + ] + } + }, + { + "key": "printf_buffer_size", + "label": "Printf buffer size", + "description": "Set the size in bytes of the buffer used by debug printf", + "type": "INT", + "default": 1024, + "range": { + "min": 128, + "max": 1048576 + }, + "unit": "bytes", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_DEBUG_PRINTF" + } + ] + } + } + ] + }, + { + "key": "GPU_BASED_GPU_ASSISTED", + "label": "GPU-Assisted", + "description": "Check for API usage errors at shader execution time.", + "url": "${LUNARG_SDK}/gpu_validation.html", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "label": "Shader instrumentation", + "description": "Instrument shaders to validate descriptors, descriptor indexing, buffer device addresses and ray queries. Warning: will considerably slow down shader executions.", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + }, + "settings": [ + { + "key": "gpuav_descriptor_checks", + "label": "Descriptors indexing", + "description": "Enable descriptors and buffer out of bounds validation when using descriptor indexing", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + }, + "settings": [ + { + "key": "gpuav_warn_on_robust_oob", + "label": "Generate warning on out of bounds accesses even if buffer robustness is enabled", + "description": "Warn on out of bounds accesses even if robustness is enabled", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + } + } + ] + }, + { + "key": "gpuav_buffer_address_oob", + "label": "Out of bounds buffer device addresses", + "type": "BOOL", + "default": true, + "description": "Check for ", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + }, + "settings": [ + { + "key": "gpuav_max_buffer_device_addresses", + "label": "Maximum number of buffer device addresses in use at one time", + "description": "", + "type": "INT", + "default": 10000, + "range": { + "min": 100, + "max": 10000000 + }, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + } + } + ] + }, + { + "key": "gpuav_validate_ray_query", + "label": "RayQuery SPIR-V Instructions", + "description": "Enable shader instrumentation on OpRayQueryInitializeKHR", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + } + }, + { + "key": "gpuav_cache_instrumented_shaders", + "label": "Cache instrumented shaders rather than instrumenting them on every run", + "description": "Enable instrumented shader caching", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + } + }, + { + "key": "gpuav_select_instrumented_shaders", + "label": "Enable instrumenting shaders selectively", + "description": "Select which shaders to instrument passing a VkValidationFeaturesEXT struct with GPU-AV enabled in the VkShaderModuleCreateInfo pNext", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_shader_instrumentation", + "value": true + } + ] + } + } + ] + }, + { + "key": "gpuav_buffers_validation", + "label": "Buffer content validation", + "description": "Validate buffers containing parameters used in indirect Vulkan commands, or used in copy commands", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + }, + "settings": [ + { + "key": "gpuav_indirect_draws_buffers", + "label": "Indirect draws parameters", + "type": "BOOL", + "default": true, + "description": "Validate buffers containing draw parameters used in indirect draw commands", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_buffers_validation", + "value": true + } + ] + } + }, + { + "key": "indirect_dispatches", + "label": "Indirect dispatches parameters", + "type": "BOOL", + "default": true, + "description": "Validate buffers containing dispatch parameters used in indirect dispatch commands", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_buffers_validation", + "value": true + } + ] + } + }, + { + "key": "indirect_trace_rays", + "label": "Indirect trace rays parameters", + "type": "BOOL", + "default": true, + "description": "Validate buffers containing ray tracing parameters used in indirect ray tracing commands", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_buffers_validation", + "value": true + } + ] + } + }, + { + "key": "gpuav_buffer_copies", + "label": "Buffer copies", + "type": "BOOL", + "default": true, + "description": "Validate copies involving a VkBuffer. Right now only validates copy buffer to image.", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "gpuav_buffers_validation", + "value": true + } + ] + } + } + ] + }, + { + "key": "gpuav_advanced_settings", + "label": "Advanced Settings", + "description": "GPU-AV advanced settings", + "type": "GROUP", + "view": "ADVANCED", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + }, + "settings": [ + { + "key": "gpuav_reserve_binding_slot", + "label": "Reserve Descriptor Set Binding Slot", + "type": "BOOL", + "default": true, + "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + } + }, + { + "key": "gpuav_vma_linear_output", + "label": "Linear Memory Allocation Mode", + "description": "Use VMA linear memory allocations for GPU-AV output buffers instead of finding best place for new allocations among free regions to optimize memory usage. Enabling this setting reduces performance cost but disabling this method minimizes memory usage.", + "type": "BOOL", + "default": true, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + } + } + ] + }, + { + "key": "gpuav_debug_settings", + "label": "Developer Debug Settings", + "description": "GPU-AV debug settings", + "type": "GROUP", + "view": "ADVANCED", + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + }, + "settings": [ + { + "key": "gpuav_debug_validate_instrumented_shaders", + "label": "Validate instrumented shaders", + "description": "Run spirv-val after doing shader instrumentation", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + } + }, + { + "key": "gpuav_debug_dump_instrumented_shaders", + "label": "Dump instrumented shaders", + "description": "Will dump the instrumented shaders (before and after) to working directory", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_gpu_based", + "value": "GPU_BASED_GPU_ASSISTED" + } + ] + } + } + ] + } + ] + } + ] + }, + { + "key": "validate_best_practices", + "label": "Best Practices", + "description": "Outputs warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", + "url": "${LUNARG_SDK}/best_practices.html", + "type": "BOOL", + "default": false, + "expanded": true, + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "settings": [ + { + "key": "validate_best_practices_arm", + "label": "ARM-specific best practices", + "description": "Outputs warnings for spec-conforming but non-ideal code on ARM GPUs.", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_best_practices", + "value": true + } + ] + } + }, + { + "key": "validate_best_practices_amd", + "label": "AMD-specific best practices", + "description": "Outputs warnings for spec-conforming but non-ideal code on AMD GPUs.", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_best_practices", + "value": true + } + ] + } + }, + { + "key": "validate_best_practices_img", + "label": "IMG-specific best practices", + "description": "Outputs warnings for spec-conforming but non-ideal code on Imagination GPUs.", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_best_practices", + "value": true + } + ] + } + }, + { + "key": "validate_best_practices_nvidia", + "label": "NVIDIA-specific best practices", + "description": "Outputs warnings for spec-conforming but non-ideal code on NVIDIA GPUs.", + "type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX", + "ANDROID" + ], + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "validate_best_practices", + "value": true + } + ] + } + } + ] + } + ] + }, + { + "key": "debug_action", + "label": "Debug Action", + "description": "Specifies what action is to be taken when a layer reports information", + "type": "FLAGS", + "flags": [ + { + "key": "VK_DBG_LAYER_ACTION_LOG_MSG", + "label": "Log Message", + "description": "Log a txt message to stdout or to a log filename.", + "settings": [ + { + "key": "log_filename", + "label": "Log Filename", + "description": "Specifies the output filename", + "type": "SAVE_FILE", + "default": "stdout", + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "debug_action", + "value": [ + "VK_DBG_LAYER_ACTION_LOG_MSG" + ] + } + ] + } + } + ] + }, + { + "key": "VK_DBG_LAYER_ACTION_CALLBACK", + "label": "Callback", + "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.", + "view": "HIDDEN" + }, + { + "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT", + "label": "Debug Output", + "description": "Log a txt message using the Windows OutputDebugString function.", + "platforms": [ + "WINDOWS" + ] + }, + { + "key": "VK_DBG_LAYER_ACTION_BREAK", + "label": "Break", + "description": "Trigger a breakpoint if a debugger is in use." + } + ], + "default": [ + "VK_DBG_LAYER_ACTION_LOG_MSG" + ] + }, + { + "key": "report_flags", + "label": "Message Severity", + "description": "Comma-delineated list of options specifying the types of messages to be reported", + "type": "FLAGS", + "flags": [ + { + "key": "info", + "label": "Info", + "description": "Report informational messages." + }, + { + "key": "warn", + "label": "Warning", + "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior." + }, + { + "key": "perf", + "label": "Performance", + "description": "Report usage of the API that may cause suboptimal performance." + }, + { + "key": "error", + "label": "Error", + "description": "Report errors in API usage." + }, + { + "key": "debug", + "label": "Debug", + "description": "For layer development. Report messages for debugging layer behavior.", + "view": "HIDDEN" + } + ], + "default": [ + "error" + ] + }, + { + "key": "enable_message_limit", + "label": "Limit Duplicated Messages", + "description": "Enable limiting of duplicate messages.", + "type": "BOOL", + "default": true, + "settings": [ + { + "key": "duplicate_message_limit", + "env": "VK_LAYER_DUPLICATE_MESSAGE_LIMIT", + "label": "Max Duplicated Messages", + "description": "Maximum number of times any single validation message should be reported.", + "type": "INT", + "default": 10, + "range": { + "min": 1 + }, + "dependence": { + "mode": "ALL", + "settings": [ + { + "key": "enable_message_limit", + "value": true + } + ] + } + } + ] + }, + { + "key": "message_id_filter", + "label": "Mute Message VUIDs", + "description": "List of VUIDs and VUID identifers which are to be IGNORED by the validation layer", + "type": "LIST", + "env": "VK_LAYER_MESSAGE_ID_FILTER", + "default": [] + }, + { + "key": "message_format", + "label": "Message Format", + "description": "Specifies how error messages are reported", + "type": "GROUP", + "expanded": true, + "settings": [ + { + "key": "message_format_display_application_name", + "label": "Display Application Name", + "description": "Useful when running multiple instances to know which instance the message is from.","type": "BOOL", + "default": false, + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + } + ] + }, + { + "key": "disables", + "label": "Disables", + "description": "Specify areas of validation to be disabled", + "type": "FLAGS", + "env": "VK_LAYER_DISABLES", + "flags": [ + { + "key": "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT", + "label": "Thread Safety", + "description": "Thread checks. In order to not degrade performance, it might be best to run your program with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check or when debugging difficult application behaviors." + }, + { + "key": "VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT", + "label": "Stateless Parameter", + "description": "Stateless parameter checks. This may not always be necessary late in a development cycle." + }, + { + "key": "VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT", + "label": "Object Lifetime", + "description": "Object tracking checks. This may not always be necessary late in a development cycle." + }, + { + "key": "VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT", + "label": "Core", + "description": "The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors." + }, + { + "key": "VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT", + "label": "Handle Wrapping", + "description": "Handle wrapping checks. Disable this feature if you are exerience crashes when creating new extensions or developing new Vulkan objects/structures." + }, + { + "key": "VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT", + "label": "Shader Validation", + "description": "Shader checks. These checks can be CPU intensive during application start up, especially if Shader Validation Caching is also disabled.", + "view": "ADVANCED" + }, + { + "key": "VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE", + "label": "Command Buffer State", + "description": "Check that all Vulkan objects used by a command buffer have not been destroyed. These checks can be CPU intensive for some applications.", + "view": "ADVANCED" + }, + { + "key": "VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION", + "label": "Image Layout", + "description": "Check that the layout of each image subresource is correct whenever it is used by a command buffer. These checks are very CPU intensive for some applications.", + "view": "ADVANCED" + }, + { + "key": "VALIDATION_CHECK_DISABLE_QUERY_VALIDATION", + "label": "Query", + "description": "Checks for commands that use VkQueryPool objects.", + "view": "ADVANCED" + }, + { + "key": "VALIDATION_CHECK_DISABLE_OBJECT_IN_USE", + "label": "Object in Use", + "description": "Check that Vulkan objects are not in use by a command buffer when they are destroyed.", + "view": "ADVANCED" + }, + { + "key": "VALIDATION_CHECK_DISABLE_SYNCHRONIZATION_VALIDATION_QUEUE_SUBMIT", + "label": "QueueSubmit Synchronization Validation", + "description": "Check synchronization validation between submitted command buffers when Synchronization Validation is enabled.", + "view": "ADVANCED" + }, + { + "key": "VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT", + "label": "Shader Validation Caching", + "description": "Disable caching of shader validation results.", + "view": "ADVANCED" + } + ], + "default": [ + "VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT" + ] + }, + { + "key": "enables", + "label": "Enables", + "description": "Setting an option here will enable specialized areas of validation", + "type": "FLAGS", + "env": "VK_LAYER_ENABLES", + "flags": [ + { + "key": "VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT", + "label": "Synchronization", + "description": "This feature reports resource access conflicts due to missing or incorrect synchronization operations between actions (Draw, Copy, Dispatch, Blit) reading or writing the same regions of memory.", + "url": "${LUNARG_SDK}/synchronization_usage.html", + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT", + "label": "Debug Printf", + "description": "Enables processing of debug printf instructions in shaders and sending debug strings to the debug callback.", + "url": "${LUNARG_SDK}/debug_printf.html", + "status": "STABLE", + "platforms": [ + "WINDOWS", + "LINUX" + ] + }, + { + "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT", + "label": "GPU-Assisted", + "description": "Check for API usage errors at shader execution time.", + "url": "${LUNARG_SDK}/gpu_validation.html", + "platforms": [ + "WINDOWS", + "LINUX" + ] + }, + { + "key": "VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT", + "label": "Reserve Descriptor Set Binding Slot", + "description": "Specifies that the validation layers reserve a descriptor set binding slot for their own use. The layer reports a value for VkPhysicalDeviceLimits::maxBoundDescriptorSets that is one less than the value reported by the device. If the device supports the binding of only one descriptor set, the validation layer does not perform GPU-assisted validation.", + "platforms": [ + "WINDOWS", + "LINUX" + ] + }, + { + "key": "VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT", + "label": "Best Practices", + "description": "Activating this feature enables the output of warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.", + "url": "${LUNARG_SDK}/best_practices.html", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM", + "label": "ARM-specific best practices", + "description": "Activating this feature enables the output of warnings related to ARM-specific misuse of the API, but which are not explicitly prohibited by the specification.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS", + "ANDROID" + ] + }, + { + "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_AMD", + "label": "AMD-specific best practices", + "description": "Adds check for spec-conforming but non-ideal code on AMD GPUs.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS" + ] + }, + { + "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_IMG", + "label": "IMG-specific best practices", + "description": "Adds check for spec-conforming but non-ideal code on Imagination GPUs.", + "platforms": [ + "WINDOWS", + "LINUX", + "MACOS" + ] + }, + { + "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_NVIDIA", + "label": "NVIDIA-specific best practices", + "description": "Activating this feature enables the output of warnings related to NVIDIA-specific misuse of the API, but which are not explicitly prohibited by the specification.", + "platforms": [ + "WINDOWS", + "LINUX", + "ANDROID" + ] + }, + { + "key": "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ALL", + "label": "Hardware specific best practices", + "description": "Activating this feature enables all vendor specific best practices.", + "platforms": [ + "WINDOWS", + "LINUX", + "ANDROID" + ] + } + ], + "default": [] + } + ] + } + } +} diff --git a/vkconfig_core/layers/170/VK_LAYER_LUNARG_monitor.json b/vkconfig_core/test/sdk/VkLayer_monitor.json similarity index 66% rename from vkconfig_core/layers/170/VK_LAYER_LUNARG_monitor.json rename to vkconfig_core/test/sdk/VkLayer_monitor.json index c5fc7d2b55..f14ed40a5d 100644 --- a/vkconfig_core/layers/170/VK_LAYER_LUNARG_monitor.json +++ b/vkconfig_core/test/sdk/VkLayer_monitor.json @@ -4,12 +4,18 @@ "name": "VK_LAYER_LUNARG_monitor", "type": "GLOBAL", "library_path": ".\\VkLayer_monitor.dll", - "api_version": "1.2.170", + "api_version": "1.3.283", "implementation_version": "1", "description": "Execution Monitoring Layer", - "introduction": "The monitor utility layer prints the real-time frames-per-second value to the application's title bar.", + "introduction": "The monitor utility layer displays the real-time frame rate in frames-per-second in the application's title bar.", "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/monitor_layer.html", "platforms": [ "WINDOWS", "LINUX" ], + "instance_extensions": [ + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + } + ], "device_extensions": [ { "name": "VK_EXT_tooling_info", diff --git a/vkconfig_core/layers/135/VK_LAYER_LUNARG_screenshot.json b/vkconfig_core/test/sdk/VkLayer_screenshot.json similarity index 71% rename from vkconfig_core/layers/135/VK_LAYER_LUNARG_screenshot.json rename to vkconfig_core/test/sdk/VkLayer_screenshot.json index 9509790d02..d5c9d728dd 100644 --- a/vkconfig_core/layers/135/VK_LAYER_LUNARG_screenshot.json +++ b/vkconfig_core/test/sdk/VkLayer_screenshot.json @@ -1,15 +1,21 @@ { - "file_format_version": "1.2.0", + "file_format_version" : "1.2.0", "layer": { "name": "VK_LAYER_LUNARG_screenshot", "type": "GLOBAL", "library_path": ".\\VkLayer_screenshot.dll", - "api_version": "1.2.135", + "api_version": "1.3.283", "implementation_version": "1", "description": "LunarG image capture layer", "introduction": "The screenshot layer records frames to image files.", "url": "https://vulkan.lunarg.com/doc/sdk/latest/windows/screenshot_layer.html", - "platforms": [ "WINDOWS", "LINUX" ], + "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ], + "instance_extensions": [ + { + "name": "VK_EXT_layer_settings", + "spec_version": "2" + } + ], "device_extensions": [ { "name": "VK_EXT_tooling_info", @@ -25,7 +31,7 @@ "key": "frames", "env": "VK_SCREENSHOT_FRAMES", "label": "Frames", - "description": "Comma separated list of frames to output as screen shots or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9.", + "description": "Specifies list of frames to output as screenshots. It is specified as a comma-separated list of frames or a range of frames with a start, count, and optional interval separated by a dash. Setting the variable to \"all\" will output every frame. Example: \"5-8-2\" will output frame 5, continue until frame 13, dumping every other frame. Example: \"3,8-2\" will output frames 3, 8, and 9. If it is not set or it set to an empty string, no screenshots are created.", "type": "STRING", "default": "" }, @@ -33,7 +39,7 @@ "key": "dir", "env": "VK_SCREENSHOT_DIR", "label": "Directory", - "description": "This can be set to specify the directory in which to create the screenshot files.", + "description": "Specifies the directory in which to create the screenshot files. If it is not set or is set to an empty string, the files will be created in the current working directory.", "type": "SAVE_FOLDER", "default": "" }, @@ -41,7 +47,7 @@ "key": "format", "env": "VK_SCREENSHOT_FORMAT", "label": "Format", - "description": "This can be set to a color space for the output.", + "description": "Specify a color space for the output. If it is not set, set to null, or set to USE_SWAPCHAIN_COLORSPACE the format will be set to use the same color space as the swapchain object.", "type": "ENUM", "flags": [ { diff --git a/vkconfig_core/test/test_bitfield.cpp b/vkconfig_core/test/test_bitfield.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vkconfig_core/test/test_command_line.cpp b/vkconfig_core/test/test_command_line.cpp index f1a6fe775c..2358c1f75d 100644 --- a/vkconfig_core/test/test_command_line.cpp +++ b/vkconfig_core/test/test_command_line.cpp @@ -21,7 +21,7 @@ #include "../command_line.h" #include "../util.h" -#include "../platform.h" +#include "../type_platform.h" #if VKC_PLATFORM == VKC_PLATFORM_LINUX #pragma GCC diagnostic push @@ -37,7 +37,7 @@ TEST(test_command_line, execute_mode) { static char* argv[] = {"vkconfig"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -49,7 +49,7 @@ TEST(test_command_line, execute_mode) { TEST(test_command_line, usage_mode_help) { static char* argv[] = {"vkconfig", "--help"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -62,7 +62,7 @@ TEST(test_command_line, usage_mode_help) { TEST(test_command_line, usage_mode_h) { static char* argv[] = {"vkconfig", "-h"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -75,7 +75,7 @@ TEST(test_command_line, usage_mode_h) { TEST(test_command_line, usage_mode_version) { static char* argv[] = {"vkconfig", "--version"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -88,7 +88,7 @@ TEST(test_command_line, usage_mode_version) { TEST(test_command_line, usage_mode_invalid) { static char* argv[] = {"vkconfig", "--dfhsjfgasjkgf"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -101,7 +101,7 @@ TEST(test_command_line, usage_mode_invalid) { TEST(test_command_line, usage_mode_layers_missing_argv) { static char* argv[] = {"vkconfig", "layers"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -114,7 +114,7 @@ TEST(test_command_line, usage_mode_layers_missing_argv) { TEST(test_command_line, usage_mode_layers_invalid_argv) { static char* argv[] = {"vkconfig", "layers", "--pouet"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -127,7 +127,7 @@ TEST(test_command_line, usage_mode_layers_invalid_argv) { TEST(test_command_line, usage_mode_layers_list) { static char* argv[] = {"vkconfig", "layers", "--list"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -140,7 +140,7 @@ TEST(test_command_line, usage_mode_layers_list) { TEST(test_command_line, usage_mode_layers_surrender) { static char* argv[] = {"vkconfig", "layers", "--surrender"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -153,7 +153,7 @@ TEST(test_command_line, usage_mode_layers_surrender) { TEST(test_command_line, usage_mode_layers_surrender_invalid) { static char* argv[] = {"vkconfig", "layers", "--surrender", "file.json"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -165,8 +165,8 @@ TEST(test_command_line, usage_mode_layers_surrender_invalid) { } TEST(test_command_line, usage_mode_layers_override) { - static char* argv[] = {"vkconfig", "layers", "--override", ":/Configuration 2.2.2.json"}; - int argc = static_cast(countof(argv)); + static char* argv[] = {"vkconfig", "layers", "--override", ":/test/Configuration 3.0.0.json"}; + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -179,7 +179,7 @@ TEST(test_command_line, usage_mode_layers_override) { TEST(test_command_line, usage_mode_layers_override_invalid) { static char* argv[] = {"vkconfig", "layers", "--override"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); @@ -192,7 +192,7 @@ TEST(test_command_line, usage_mode_layers_override_invalid) { TEST(test_command_line, usage_mode_layers_override_invalid_args) { static char* argv[] = {"vkconfig", "layers", "--override", "bla", "blo"}; - int argc = static_cast(countof(argv)); + int argc = static_cast(std::size(argv)); CommandLine command_line(argc, argv); diff --git a/vkconfig_core/test/test_configuration.cpp b/vkconfig_core/test/test_configuration.cpp index ff9151471e..5c17110910 100644 --- a/vkconfig_core/test/test_configuration.cpp +++ b/vkconfig_core/test/test_configuration.cpp @@ -45,7 +45,7 @@ static bool operator!=(const Configuration& a, const Configuration& b) { return static bool operator==(const Parameter& a, const Parameter& b) { if (a.key != b.key) return false; - if (a.state != b.state) return false; + if (a.control != b.control) return false; if (a.settings.size() != b.settings.size()) return false; @@ -58,21 +58,21 @@ static bool operator==(const Parameter& a, const Parameter& b) { static bool operator!=(const std::vector& a, const std::vector& b) { return !(a == b); } -TEST(test_configuration, load_and_save_v2_2_2) { +TEST(test_configuration, load_and_save) { Configuration configuration_loaded; - const bool load_loaded = configuration_loaded.Load(std::vector(), ":/Configuration 2.2.2.json"); + const bool load_loaded = configuration_loaded.Load(std::vector(), ":/test/Configuration 3.0.0.json"); EXPECT_TRUE(load_loaded); EXPECT_EQ(1, configuration_loaded.parameters.size()); EXPECT_TRUE(!configuration_loaded.description.empty()); Parameter* parameter = FindByKey(configuration_loaded.parameters, "VK_LAYER_LUNARG_reference_1_2_1"); EXPECT_TRUE(parameter != nullptr); - EXPECT_EQ(LAYER_STATE_OVERRIDDEN, parameter->state); + EXPECT_EQ(LAYER_CONTROL_ON, parameter->control); - configuration_loaded.Save(std::vector(), "test_v2_2_2_layer_1_2_1.json"); + configuration_loaded.Save(std::vector(), "test_layer_1_2_1.json"); Configuration configuration_saved; - configuration_saved.Load(std::vector(), "test_v2_2_2_layer_1_2_1.json"); + configuration_saved.Load(std::vector(), "test_layer_1_2_1.json"); EXPECT_EQ(configuration_loaded, configuration_saved); } diff --git a/vkconfig_core/test/test_configuration_built_in.cpp b/vkconfig_core/test/test_configuration_built_in.cpp index 2f30098db5..60e91f5efc 100644 --- a/vkconfig_core/test/test_configuration_built_in.cpp +++ b/vkconfig_core/test/test_configuration_built_in.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,13 @@ #include "../configuration.h" #include "../util.h" #include "../layer_manager.h" +#include "../environment.h" #include #include #include -static const std::vector SUPPORTED_CONFIG_FILES = {"_2_2_3", "_2_2_2", "_2_2_1"}; - static bool operator==(const Configuration& a, const Configuration& b) { if (a.key != b.key) return false; @@ -48,7 +47,7 @@ static bool operator!=(const Configuration& a, const Configuration& b) { return static bool operator==(const Parameter& a, const Parameter& b) { if (a.key != b.key) return false; - if (a.state != b.state) return false; + if (a.control != b.control) return false; if (a.settings.size() != b.settings.size()) return false; @@ -62,13 +61,8 @@ static bool operator==(const Parameter& a, const Parameter& b) { static bool operator!=(const std::vector& a, const std::vector& b) { return !(a == b); } struct TestBuilin { - TestBuilin(const char* layers_version, const char* configurations_version) - : paths("", SUPPORTED_CONFIG_FILES), - layers_version(layers_version), - configurations_version(configurations_version), - environment(paths), - layer_manager(environment) { - this->layer_manager.LoadLayersFromPath(format(":/layers/%s", layers_version).c_str()); + TestBuilin() : environment(), layer_manager() { + this->layer_manager.LoadLayersFromPath(":/sdk"); EXPECT_TRUE(!this->layer_manager.selected_layers.empty()); } @@ -78,14 +72,13 @@ struct TestBuilin { Configuration Load(const char* configuration_name) { Configuration configuration_loaded; - const bool result = configuration_loaded.Load( - layer_manager.selected_layers, - format(":/configurations/%s/%s.json", configurations_version.c_str(), configuration_name).c_str()); + const bool result = configuration_loaded.Load(layer_manager.selected_layers, + format(":/configurations/%s.json", configuration_name).c_str()); return result ? configuration_loaded : Configuration(); } Configuration Restore(const Configuration& configuration_loaded) { - const std::string filename = format("test_%s_layers_%s.json", configuration_loaded.key.c_str(), layers_version.c_str()); + const std::string filename = format("test_%s_layers.json", configuration_loaded.key.c_str()); const bool saved = configuration_loaded.Save(this->layer_manager.selected_layers, filename.c_str()); EXPECT_TRUE(saved); @@ -96,270 +89,13 @@ struct TestBuilin { std::string layers_version; std::string configurations_version; - PathManager paths; Environment environment; LayerManager layer_manager; }; -static const char* CONFIGURATION_VERSION = "2.2.2"; - -// Layers 130 - -TEST(test_built_in_load, layers_130_with_configuration) { - TestBuilin test("130", CONFIGURATION_VERSION); - EXPECT_EQ(4, test.layer_manager.selected_layers.size()); - - { - Configuration load_api_dump = test.Load("API dump"); - EXPECT_EQ(1, load_api_dump.Size()); - Configuration save_api_dump = test.Restore(load_api_dump); - EXPECT_EQ(save_api_dump, load_api_dump); - } - - { - Configuration load_frame_capture = test.Load("Frame Capture"); - EXPECT_EQ(1, load_frame_capture.Size()); - Configuration save_frame_capture = test.Restore(load_frame_capture); - EXPECT_EQ(save_frame_capture, load_frame_capture); - } - - { - Configuration load_portability = test.Load("Portability"); - EXPECT_EQ(7, load_portability.Size()); - Configuration save_portability = test.Restore(load_portability); - EXPECT_EQ(save_portability, load_portability); - } - - { - Configuration load_synchronization = test.Load("Synchronization"); - EXPECT_EQ(2, load_synchronization.Size()); - Configuration save_synchronization = test.Restore(load_synchronization); - EXPECT_EQ(save_synchronization, load_synchronization); - } - - { - Configuration load_validation = test.Load("Validation"); - EXPECT_EQ(1, load_validation.Size()); - Configuration save_validation = test.Restore(load_validation); - EXPECT_EQ(save_validation, load_validation); - } -} - -// Layers 135 - -TEST(test_built_in_load, layers_135_with_configuration) { - TestBuilin test("135", CONFIGURATION_VERSION); - EXPECT_EQ(4, test.layer_manager.selected_layers.size()); - - { - Configuration load_api_dump = test.Load("API dump"); - EXPECT_EQ(1, load_api_dump.Size()); - Configuration save_api_dump = test.Restore(load_api_dump); - EXPECT_EQ(save_api_dump, load_api_dump); - } - - { - Configuration load_frame_capture = test.Load("Frame Capture"); - EXPECT_EQ(1, load_frame_capture.Size()); - Configuration save_frame_capture = test.Restore(load_frame_capture); - EXPECT_EQ(save_frame_capture, load_frame_capture); - } - - { - Configuration load_portability = test.Load("Portability"); - EXPECT_EQ(7, load_portability.Size()); - Configuration save_portability = test.Restore(load_portability); - EXPECT_EQ(save_portability, load_portability); - } - - { - Configuration load_synchronization = test.Load("Synchronization"); - EXPECT_EQ(2, load_synchronization.Size()); - Configuration save_synchronization = test.Restore(load_synchronization); - EXPECT_EQ(save_synchronization, load_synchronization); - } - - { - Configuration load_validation = test.Load("Validation"); - EXPECT_EQ(1, load_validation.Size()); - Configuration save_validation = test.Restore(load_validation); - EXPECT_EQ(save_validation, load_validation); - } -} - -// Layers 141 - -TEST(test_built_in_load, layers_141_with_configuration) { - TestBuilin test("141", CONFIGURATION_VERSION); - EXPECT_EQ(5, test.layer_manager.selected_layers.size()); - - { - Configuration load_api_dump = test.Load("API dump"); - EXPECT_EQ(1, load_api_dump.Size()); - Configuration save_api_dump = test.Restore(load_api_dump); - EXPECT_EQ(save_api_dump, load_api_dump); - } - - { - Configuration load_frame_capture = test.Load("Frame Capture"); - EXPECT_EQ(1, load_frame_capture.Size()); - Configuration save_frame_capture = test.Restore(load_frame_capture); - EXPECT_EQ(save_frame_capture, load_frame_capture); - } - - { - Configuration load_portability = test.Load("Portability"); - EXPECT_EQ(7, load_portability.Size()); - Configuration save_portability = test.Restore(load_portability); - EXPECT_EQ(save_portability, load_portability); - } - - { - Configuration load_synchronization = test.Load("Synchronization"); - EXPECT_EQ(2, load_synchronization.Size()); - Configuration save_synchronization = test.Restore(load_synchronization); - EXPECT_EQ(save_synchronization, load_synchronization); - } - - { - Configuration load_validation = test.Load("Validation"); - EXPECT_EQ(1, load_validation.Size()); - Configuration save_validation = test.Restore(load_validation); - EXPECT_EQ(save_validation, load_validation); - } -} - -// Layers 148 - -TEST(test_built_in_load, layers_148_with_configuration) { - TestBuilin test("148", CONFIGURATION_VERSION); - EXPECT_EQ(5, test.layer_manager.selected_layers.size()); - - { - Configuration load_api_dump = test.Load("API dump"); - EXPECT_EQ(1, load_api_dump.Size()); - Configuration save_api_dump = test.Restore(load_api_dump); - EXPECT_EQ(save_api_dump, load_api_dump); - } - - { - Configuration load_frame_capture = test.Load("Frame Capture"); - EXPECT_EQ(1, load_frame_capture.Size()); - Configuration save_frame_capture = test.Restore(load_frame_capture); - EXPECT_EQ(save_frame_capture, load_frame_capture); - } - - { - Configuration load_portability = test.Load("Portability"); - EXPECT_EQ(7, load_portability.Size()); - Configuration save_portability = test.Restore(load_portability); - EXPECT_EQ(save_portability, load_portability); - } - - { - Configuration load_synchronization = test.Load("Synchronization"); - EXPECT_EQ(2, load_synchronization.Size()); - Configuration save_synchronization = test.Restore(load_synchronization); - EXPECT_EQ(save_synchronization, load_synchronization); - } - - { - Configuration load_validation = test.Load("Validation"); - EXPECT_EQ(1, load_validation.Size()); - Configuration save_validation = test.Restore(load_validation); - EXPECT_EQ(save_validation, load_validation); - } -} - -// Layers 154 - -TEST(test_built_in_load, layers_154_with_configuration) { - TestBuilin test("154", CONFIGURATION_VERSION); - EXPECT_EQ(5, test.layer_manager.selected_layers.size()); - - { - Configuration load_api_dump = test.Load("API dump"); - EXPECT_EQ(1, load_api_dump.Size()); - Configuration save_api_dump = test.Restore(load_api_dump); - EXPECT_EQ(save_api_dump, load_api_dump); - } - - { - Configuration load_frame_capture = test.Load("Frame Capture"); - EXPECT_EQ(1, load_frame_capture.Size()); - Configuration save_frame_capture = test.Restore(load_frame_capture); - EXPECT_EQ(save_frame_capture, load_frame_capture); - } - - { - Configuration load_portability = test.Load("Portability"); - EXPECT_EQ(7, load_portability.Size()); - Configuration save_portability = test.Restore(load_portability); - EXPECT_EQ(save_portability, load_portability); - } - - { - Configuration load_synchronization = test.Load("Synchronization"); - EXPECT_EQ(2, load_synchronization.Size()); - Configuration save_synchronization = test.Restore(load_synchronization); - EXPECT_EQ(save_synchronization, load_synchronization); - } - - { - Configuration load_validation = test.Load("Validation"); - EXPECT_EQ(1, load_validation.Size()); - Configuration save_validation = test.Restore(load_validation); - EXPECT_EQ(save_validation, load_validation); - } -} - -// Layers 162 - -TEST(test_built_in_load, layers_162_with_configuration) { - TestBuilin test("162", CONFIGURATION_VERSION); - EXPECT_EQ(5, test.layer_manager.selected_layers.size()); - - { - Configuration load_api_dump = test.Load("API dump"); - EXPECT_EQ(1, load_api_dump.Size()); - Configuration save_api_dump = test.Restore(load_api_dump); - EXPECT_EQ(save_api_dump, load_api_dump); - } - - { - Configuration load_frame_capture = test.Load("Frame Capture"); - EXPECT_EQ(1, load_frame_capture.Size()); - Configuration save_frame_capture = test.Restore(load_frame_capture); - EXPECT_EQ(save_frame_capture, load_frame_capture); - } - - { - Configuration load_portability = test.Load("Portability"); - EXPECT_EQ(7, load_portability.Size()); - Configuration save_portability = test.Restore(load_portability); - EXPECT_EQ(save_portability, load_portability); - } - - { - Configuration load_synchronization = test.Load("Synchronization"); - EXPECT_EQ(2, load_synchronization.Size()); - Configuration save_synchronization = test.Restore(load_synchronization); - EXPECT_EQ(save_synchronization, load_synchronization); - } - - { - Configuration load_validation = test.Load("Validation"); - EXPECT_EQ(1, load_validation.Size()); - Configuration save_validation = test.Restore(load_validation); - EXPECT_EQ(save_validation, load_validation); - } -} - -// Layers 170 - -TEST(test_built_in_load, layers_170_with_configuration) { - TestBuilin test("170", CONFIGURATION_VERSION); - EXPECT_EQ(6, test.layer_manager.selected_layers.size()); +TEST(test_built_in_load, sdk_layers_with_configuration) { + TestBuilin test; + EXPECT_TRUE(test.layer_manager.selected_layers.size() >= 8); { Configuration load_api_dump = test.Load("API dump"); diff --git a/vkconfig_core/test/test_configuration_manager.cpp b/vkconfig_core/test/test_configuration_manager.cpp index e1f09278f8..58a4fcb9d7 100644 --- a/vkconfig_core/test/test_configuration_manager.cpp +++ b/vkconfig_core/test/test_configuration_manager.cpp @@ -22,30 +22,19 @@ #include -static const std::vector SUPPORTED_CONFIG_FILES = {"_2_2_3", "_2_2_2", "_2_2_1"}; - TEST(test_configuration_manager, create_remove) { - PathManager path_manager("", SUPPORTED_CONFIG_FILES); - Environment environment(path_manager); - environment.Reset(Environment::DEFAULT); - std::vector available_layers; Layer layer; layer.key = "VK_LAYER_KHRONOS_validation"; layer.manifest_path = "VK_LAYER_KHRONOS_validation.dummy_path"; available_layers.push_back(layer); - ConfigurationManager configuration_manager(environment); - - // No active configuration by default - EXPECT_EQ(nullptr, configuration_manager.FindActiveConfiguration()); - EXPECT_EQ(false, configuration_manager.HasActiveConfiguration(available_layers)); + ConfigurationManager configuration_manager; // Create configuration configuration_manager.CreateConfiguration(available_layers, "Configuration A"); configuration_manager.CreateConfiguration(available_layers, "Configuration B"); EXPECT_EQ(2, configuration_manager.available_configurations.size()); - EXPECT_EQ(false, configuration_manager.HasActiveConfiguration(available_layers)); // Create configuration with the same name, updating the name const std::string configuration_duplicate_key = @@ -63,12 +52,8 @@ TEST(test_configuration_manager, create_remove) { // Already deleted configuration_manager.RemoveConfiguration(available_layers, "Configuration A"); EXPECT_EQ(1, configuration_manager.available_configurations.size()); - EXPECT_EQ(false, configuration_manager.HasActiveConfiguration(available_layers)); // Remove configuration configuration_manager.RemoveConfiguration(available_layers, configuration_duplicate_key.c_str()); EXPECT_EQ(true, configuration_manager.Empty()); - EXPECT_EQ(false, configuration_manager.HasActiveConfiguration(available_layers)); - - environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit } diff --git a/vkconfig_core/test/test_environment.cpp b/vkconfig_core/test/test_environment.cpp index 813e6715b7..158153bc28 100644 --- a/vkconfig_core/test/test_environment.cpp +++ b/vkconfig_core/test/test_environment.cpp @@ -19,24 +19,75 @@ * - Christophe Riccio */ -#include "../path_manager.h" #include "../environment.h" +#include "../type_platform.h" #include #include +TEST(test_environment, reset_default_applications_sdk_found) { + Environment environment(Environment::MODE_UNINITIALIZED); + environment.Reset(Environment::DEFAULT); + + const std::vector& applications = environment.GetApplications(); + + std::string result = qgetenv("VULKAN_SDK").toStdString(); + + if (!result.empty()) { + EXPECT_EQ(2, applications.size()); + + // Make sure the variable are not replaced + EXPECT_TRUE(applications[0].executable_path.RelativePath().find("${VULKAN_SDK}") != std::string::npos); + EXPECT_TRUE(applications[0].options[0].working_folder.RelativePath().find("${VULKAN_SDK}") != std::string::npos); + EXPECT_TRUE(applications[0].options[0].log_file.RelativePath().find("${VK_LOCAL}") != std::string::npos); + EXPECT_TRUE(applications[1].executable_path.RelativePath().find("${VULKAN_SDK}") != std::string::npos); + EXPECT_TRUE(applications[1].options[0].working_folder.RelativePath().find("${VULKAN_SDK}") != std::string::npos); + EXPECT_TRUE(applications[1].options[0].log_file.RelativePath().find("${VK_LOCAL}") != std::string::npos); + } + + environment.Reset(Environment::SYSTEM); +} + +TEST(test_environment, reset_default_applications_no_sdk) { + qunsetenv("VULKAN_SDK"); + + Environment environment(Environment::MODE_UNINITIALIZED); + environment.Reset(Environment::DEFAULT); + + const std::vector& applications = environment.GetApplications(); + + EXPECT_EQ(2, applications.size()); + + // Make sure the variable are not replaced + EXPECT_TRUE(applications[0].executable_path.RelativePath().find("vkcube") != std::string::npos); + EXPECT_TRUE(applications[0].options[0].working_folder.RelativePath().find(".") != std::string::npos); + EXPECT_TRUE(applications[0].options[0].log_file.RelativePath().find("${VK_LOCAL}") != std::string::npos); + EXPECT_TRUE(applications[1].executable_path.RelativePath().find("vkcubepp") != std::string::npos); + EXPECT_TRUE(applications[1].options[0].working_folder.RelativePath().find(".") != std::string::npos); + EXPECT_TRUE(applications[1].options[0].log_file.RelativePath().find("${VK_LOCAL}") != std::string::npos); + + environment.Reset(Environment::SYSTEM); +} + TEST(test_environment, remove_missing_applications) { - PathManager path_manager("", std::vector()); - Environment environment(path_manager); + Environment environment(Environment::MODE_UNINITIALIZED); + + const Path& path_missing = ::Get(Path::HOME) + "my_missing_executable"; + const Path& path_exciting = ::Get(Path::HOME) + "my_exciting_executable"; - QFile file("my_exciting_executable"); + QFile file(path_exciting.AbsolutePath().c_str()); const bool result = file.open(QIODevice::WriteOnly); ASSERT_TRUE(result); std::vector applications; - applications.push_back(Application("missing", "my_missing_executable", "")); - applications.push_back(Application("exciting", "my_exciting_executable", "")); + Application application; + + application.executable_path = path_missing.AbsolutePath(); + applications.push_back(application); + + application.executable_path = path_exciting.AbsolutePath(); + applications.push_back(application); EXPECT_EQ(1, environment.RemoveMissingApplications(applications).size()); } diff --git a/vkconfig_core/test/test_layer.cpp b/vkconfig_core/test/test_layer.cpp index 83bd9a318c..cc61f0e102 100644 --- a/vkconfig_core/test/test_layer.cpp +++ b/vkconfig_core/test/test_layer.cpp @@ -58,12 +58,12 @@ TEST(test_layer, collect_settings) { TEST(test_layer, load_header_overridden) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_00.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_00.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); EXPECT_STREQ("VK_LAYER_LUNARG_test_00", layer.key.c_str()); - EXPECT_STREQ(".\\VkLayer_test.dll", layer.binary_path.c_str()); + EXPECT_STREQ(Path(".\\VkLayer_test.dll").RelativePath().c_str(), layer.binary_path.RelativePath().c_str()); EXPECT_EQ(Version(1, 2, 170), layer.api_version); EXPECT_STREQ("Build 76", layer.implementation_version.c_str()); EXPECT_STREQ("test layer", layer.description.c_str()); @@ -76,12 +76,12 @@ TEST(test_layer, load_header_overridden) { TEST(test_layer, load_header_default) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_01.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_01.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); EXPECT_STREQ("VK_LAYER_LUNARG_test_01", layer.key.c_str()); - EXPECT_STREQ(".\\VkLayer_test.dll", layer.binary_path.c_str()); + EXPECT_STREQ(Path(".\\VkLayer_test.dll").RelativePath().c_str(), layer.binary_path.RelativePath().c_str()); EXPECT_EQ(Version(1, 2, 170), layer.api_version); EXPECT_STREQ("Build 76", layer.implementation_version.c_str()); EXPECT_STREQ("test layer", layer.description.c_str()); @@ -94,7 +94,7 @@ TEST(test_layer, load_header_default) { TEST(test_layer, load_header_override) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_02.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_02.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); @@ -106,7 +106,7 @@ TEST(test_layer, load_header_override) { TEST(test_layer, load_setting_interit) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_03.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_03.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); @@ -128,7 +128,7 @@ TEST(test_layer, load_setting_interit) { TEST(test_layer, load_preset_interit) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_04.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_04.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); @@ -148,7 +148,7 @@ TEST(test_layer, load_preset_interit) { TEST(test_layer, load_setting_children_interit) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_05.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_05.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); @@ -170,7 +170,7 @@ TEST(test_layer, load_setting_children_interit) { TEST(test_layer, load_setting_enum_interit) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_test_06.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_test_06.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 2, 0), layer.file_format_version); @@ -212,12 +212,12 @@ TEST(test_layer, load_setting_enum_interit) { TEST(test_layer, load_1_1_0_header) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_reference_1_1_0.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_reference_1_1_0.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); EXPECT_EQ(Version(1, 1, 0), layer.file_format_version); EXPECT_STREQ("VK_LAYER_LUNARG_reference_1_1_0", layer.key.c_str()); - EXPECT_STREQ(".\\VkLayer_reference.dll", layer.binary_path.c_str()); + EXPECT_STREQ(Path(".\\VkLayer_reference.dll").RelativePath().c_str(), layer.binary_path.RelativePath().c_str()); EXPECT_EQ(Version(1, 2, 162), layer.api_version); EXPECT_STREQ("Build 75", layer.implementation_version.c_str()); EXPECT_STREQ("reference layer", layer.description.c_str()); @@ -230,7 +230,7 @@ TEST(test_layer, load_1_1_0_header) { TEST(test_layer, load_1_2_0_preset_and_setting_type) { Layer layer; - const bool load_loaded = layer.Load(std::vector(), ":/VK_LAYER_LUNARG_reference_1_2_0.json", LAYER_TYPE_EXPLICIT); + const bool load_loaded = layer.Load(":/layers/VK_LAYER_LUNARG_reference_1_2_0.json", LAYER_TYPE_EXPLICIT); ASSERT_TRUE(load_loaded); // Preset Enum @@ -277,11 +277,11 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { { const std::size_t index = 2; - const SettingDataFileLoad* setting_only = - static_cast(FindSetting(layer.presets[index].settings, "string_required_only")); + const SettingDataString* setting_only = + static_cast(FindSetting(layer.presets[index].settings, "string_required_only")); ASSERT_TRUE(setting_only); - const SettingDataFileLoad* setting_opt = - static_cast(FindSetting(layer.presets[index].settings, "string_with_optional")); + const SettingDataString* setting_opt = + static_cast(FindSetting(layer.presets[index].settings, "string_with_optional")); ASSERT_TRUE(setting_opt); EXPECT_STREQ("Preset String", layer.presets[index].label.c_str()); @@ -321,8 +321,8 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_STREQ("Description Load File", layer.presets[index].description.c_str()); EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_MACOS_BIT, layer.presets[index].platform_flags); EXPECT_EQ(STATUS_DEPRECATED, layer.presets[index].status); - EXPECT_STREQ("./text.log", setting_only->value.c_str()); - EXPECT_STREQ("./text.log", setting_opt->value.c_str()); + EXPECT_STREQ(Path("./text.log").RelativePath().c_str(), setting_only->value.RelativePath().c_str()); + EXPECT_STREQ(Path("./text.log").RelativePath().c_str(), setting_opt->value.RelativePath().c_str()); } // Preset Load Folder @@ -340,8 +340,8 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_STREQ("Description Load Folder", layer.presets[index].description.c_str()); EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_MACOS_BIT, layer.presets[index].platform_flags); EXPECT_EQ(STATUS_DEPRECATED, layer.presets[index].status); - EXPECT_STREQ("./text", setting_only->value.c_str()); - EXPECT_STREQ("./text", setting_opt->value.c_str()); + EXPECT_STREQ(Path("./text").RelativePath().c_str(), setting_only->value.RelativePath().c_str()); + EXPECT_STREQ(Path("./text").RelativePath().c_str(), setting_opt->value.RelativePath().c_str()); } // Preset Save File @@ -359,8 +359,8 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_STREQ("Description Save File", layer.presets[index].description.c_str()); EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_MACOS_BIT, layer.presets[index].platform_flags); EXPECT_EQ(STATUS_DEPRECATED, layer.presets[index].status); - EXPECT_STREQ("./text.log", setting_only->value.c_str()); - EXPECT_STREQ("./text.log", setting_opt->value.c_str()); + EXPECT_STREQ(Path("./text.log").RelativePath().c_str(), setting_only->value.RelativePath().c_str()); + EXPECT_STREQ(Path("./text.log").RelativePath().c_str(), setting_opt->value.RelativePath().c_str()); } // Preset Save Folder @@ -378,8 +378,8 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_STREQ("Description Save Folder", layer.presets[index].description.c_str()); EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_MACOS_BIT, layer.presets[index].platform_flags); EXPECT_EQ(STATUS_DEPRECATED, layer.presets[index].status); - EXPECT_STREQ("./text", setting_only->value.c_str()); - EXPECT_STREQ("./text", setting_opt->value.c_str()); + EXPECT_STREQ(Path("./text").RelativePath().c_str(), setting_only->value.RelativePath().c_str()); + EXPECT_STREQ(Path("./text").RelativePath().c_str(), setting_opt->value.RelativePath().c_str()); } // Preset int @@ -705,7 +705,7 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_EQ(PLATFORM_DESKTOP_BIT, setting_meta->platform_flags); EXPECT_TRUE(setting_meta->filter.empty()); - EXPECT_STREQ("./test.txt", setting_meta->default_value.c_str()); + EXPECT_STREQ(setting_meta->default_value.RelativePath().c_str(), Path("./test.txt").RelativePath().c_str()); } // Load File With Optional @@ -725,7 +725,7 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_LINUX_BIT, setting_meta->platform_flags); EXPECT_STREQ("*.txt", setting_meta->filter.c_str()); - EXPECT_STREQ("./test.txt", setting_meta->default_value.c_str()); + EXPECT_STREQ(setting_meta->default_value.RelativePath().c_str(), Path("./test.txt").RelativePath().c_str()); } // Save File Required Only @@ -745,7 +745,7 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_EQ(PLATFORM_DESKTOP_BIT, setting_meta->platform_flags); EXPECT_TRUE(setting_meta->filter.empty()); - EXPECT_STREQ("./test.json", setting_meta->default_value.c_str()); + EXPECT_STREQ(setting_meta->default_value.RelativePath().c_str(), Path("./test.json").RelativePath().c_str()); } // Save File With Optional @@ -765,7 +765,7 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_LINUX_BIT, setting_meta->platform_flags); EXPECT_STREQ("*.json", setting_meta->filter.c_str()); - EXPECT_STREQ("./test.json", setting_meta->default_value.c_str()); + EXPECT_STREQ(setting_meta->default_value.RelativePath().c_str(), Path("./test.json").RelativePath().c_str()); } // Save Folder Required Only @@ -784,7 +784,7 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_EQ(SETTING_VIEW_STANDARD, setting_meta->view); EXPECT_EQ(PLATFORM_DESKTOP_BIT, setting_meta->platform_flags); - EXPECT_STREQ("./test", setting_meta->default_value.c_str()); + EXPECT_STREQ(setting_meta->default_value.RelativePath().c_str(), Path("./test").RelativePath().c_str()); } // Save Folder With Optional @@ -803,7 +803,7 @@ TEST(test_layer, load_1_2_0_preset_and_setting_type) { EXPECT_EQ(SETTING_VIEW_ADVANCED, setting_meta->view); EXPECT_EQ(PLATFORM_WINDOWS_BIT | PLATFORM_LINUX_BIT, setting_meta->platform_flags); - EXPECT_STREQ("./test", setting_meta->default_value.c_str()); + EXPECT_STREQ(setting_meta->default_value.RelativePath().c_str(), Path("./test").RelativePath().c_str()); } // Int Required Only diff --git a/vkconfig_core/test/test_layer_built_in.cpp b/vkconfig_core/test/test_layer_built_in.cpp index 4724241d53..3d93f2d3e1 100644 --- a/vkconfig_core/test/test_layer_built_in.cpp +++ b/vkconfig_core/test/test_layer_built_in.cpp @@ -236,7 +236,7 @@ TEST(test_layer_built_in, layer_162_screenshot) { TEST(test_layer_built_in, layer_170_validation) { Layer layer; - EXPECT_TRUE(layer.Load(std::vector(), ":/layers/170/VK_LAYER_KHRONOS_validation.json", LAYER_TYPE_EXPLICIT)); + EXPECT_TRUE(layer.Load(":/layers/170/VK_LAYER_KHRONOS_validation.json", LAYER_TYPE_EXPLICIT)); EXPECT_EQ(12, CountSettings(layer.settings)); EXPECT_EQ(6, layer.presets.size()); EXPECT_TRUE(static_cast(FindSetting(layer.presets[0].settings, "enables"))->value.empty()); @@ -246,7 +246,7 @@ TEST(test_layer_built_in, layer_170_validation) { TEST(test_layer_built_in, layer_170_synchronization2) { Layer layer; - EXPECT_TRUE(layer.Load(std::vector(), ":/layers/170/VK_LAYER_KHRONOS_synchronization2.json", LAYER_TYPE_EXPLICIT)); + EXPECT_TRUE(layer.Load(":/layers/170/VK_LAYER_KHRONOS_synchronization2.json", LAYER_TYPE_EXPLICIT)); EXPECT_EQ(1, CountSettings(layer.settings)); EXPECT_EQ(0, layer.presets.size()); } diff --git a/vkconfig_core/test/test_layer_manager.cpp b/vkconfig_core/test/test_layer_manager.cpp index e80ff8c35a..b81e10f6c0 100644 --- a/vkconfig_core/test/test_layer_manager.cpp +++ b/vkconfig_core/test/test_layer_manager.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,17 +22,77 @@ #include -static const std::vector SUPPORTED_CONFIG_FILES = {"_1_0_0"}; +TEST(test_layer_manager, clear) { + LayerManager layer_manager; + layer_manager.Clear(); -TEST(test_layer_manager, load_only_layer_json) { - PathManager paths("", SUPPORTED_CONFIG_FILES); - Environment environment(paths); - environment.Reset(Environment::DEFAULT); + EXPECT_TRUE(layer_manager.Empty()); + EXPECT_TRUE(layer_manager.Size() == 0); +} + +TEST(test_layer_manager, load_all) { + std::vector user_defined_paths; + user_defined_paths.push_back(":/layers"); + + LayerManager layer_manager(user_defined_paths); + + EXPECT_TRUE(layer_manager.Size() >= 10); + EXPECT_TRUE(!layer_manager.Empty()); + + layer_manager.Clear(); + EXPECT_TRUE(layer_manager.Empty()); +} + +TEST(test_layer_manager, load_dir) { + LayerManager layer_manager; + layer_manager.Clear(); + EXPECT_TRUE(layer_manager.Empty()); + + layer_manager.LoadLayersFromPath(":/layers"); + + EXPECT_TRUE(!layer_manager.Empty()); + EXPECT_EQ(10, layer_manager.Size()); + + EXPECT_TRUE(layer_manager.Find("VK_LAYER_LUNARG_reference_1_1_0") != nullptr); + + layer_manager.Clear(); + EXPECT_TRUE(layer_manager.Empty()); +} + +TEST(test_layer_manager, load_file) { + LayerManager layer_manager; + layer_manager.Clear(); + EXPECT_TRUE(layer_manager.Empty()); + + layer_manager.LoadLayersFromPath(":/layers/VK_LAYER_LUNARG_reference_1_1_0.json"); + + EXPECT_TRUE(!layer_manager.Empty()); + EXPECT_EQ(1, layer_manager.Size()); + + EXPECT_TRUE(layer_manager.Find("VK_LAYER_LUNARG_reference_1_1_0") != nullptr); + + layer_manager.Clear(); + EXPECT_TRUE(layer_manager.Empty()); +} + +TEST(test_layer_manager, find) { + std::vector user_defined_paths; + user_defined_paths.push_back(":/layers"); + + LayerManager layer_manager(user_defined_paths); + + EXPECT_TRUE(layer_manager.Find("VK_LAYER_LUNARG_reference_1_1_0") != nullptr); + EXPECT_TRUE(layer_manager.Find("VK_LAYER_LUNARG_test_03") != nullptr); +} - LayerManager layer_manager(environment); - layer_manager.LoadLayersFromPath(":/"); +TEST(test_layer_manager, avoid_duplicate) { + LayerManager layer_manager; + layer_manager.Clear(); + EXPECT_TRUE(layer_manager.Empty()); - EXPECT_EQ(10, layer_manager.selected_layers.size()); + layer_manager.LoadLayersFromPath(":/layers"); + EXPECT_EQ(10, layer_manager.Size()); - environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit + layer_manager.LoadLayersFromPath(":/layers"); + EXPECT_EQ(10, layer_manager.Size()); } diff --git a/vkconfig_core/test/test_override.cpp b/vkconfig_core/test/test_override.cpp index 7f14f7cc38..3437ddf83e 100644 --- a/vkconfig_core/test/test_override.cpp +++ b/vkconfig_core/test/test_override.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022 Valve Corporation - * Copyright (c) 2020-2022 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,11 @@ * - Christophe Riccio */ -#include "../override.h" +#include "../configurator.h" #include "../environment.h" #include "../layer.h" #include "../layer_manager.h" + #include #include @@ -30,44 +31,83 @@ #include -static const std::vector SUPPORTED_CONFIG_FILES = {"_2_2_3", "_2_2_2", "_2_2_1"}; +/* +TEST(test_override, write_erase_global) { + const std::string LOADER_SETTINGS("/test/loader_settings.json"); + const std::string LAYERS_SETTINGS("/test/layers_settings.txt"); -extern bool WriteLayersOverride(const Environment& environment, const std::vector& available_layers, - const Configuration& configuration, const std::string& layers_path); + Configurator& configurator = Configurator::Get(); + configurator.environment.Reset(Environment::DEFAULT); + configurator.layers.LoadLayersFromPath(":/layers"); -extern bool WriteLayersSettings(const std::vector& available_layers, const Configuration& configuration, - const std::string& settings_path); + Configuration configuration; + const bool load = configuration.Load(configurator.layers.selected_layers, ":/test/Configuration 3.0.0.json"); + EXPECT_TRUE(load); + EXPECT_TRUE(!configuration.parameters.empty()); -extern bool EraseLayersOverride(const std::string& layers_path); + EXPECT_EQ(true, configurator.Override()); -extern bool EraseSettingsOverride(const std::string& settings_path); + QFile file_layers_override_ref((":" + LOADER_SETTINGS).c_str()); + const bool result_layers_override_ref = file_layers_override_ref.open(QIODevice::ReadOnly | QIODevice::Text); + assert(result_layers_override_ref); + QString text_layers_override_ref = file_layers_override_ref.readAll(); + file_layers_override_ref.close(); -TEST(test_override, write_erase_2_2_2) { - const std::string LAYERS("/override_layers_2_2_2_schema_1_2_1.json"); - const std::string SETTINGS("/override_settings_2_2_2_schema_1_2_1.txt"); + QFile file_layers_override_gen(("." + LOADER_SETTINGS).c_str()); + const bool result_layers_override_gen = file_layers_override_gen.open(QIODevice::ReadOnly | QIODevice::Text); + assert(result_layers_override_gen); + QString text_layers_override_gen = file_layers_override_gen.readAll(); + file_layers_override_gen.close(); - PathManager paths("", SUPPORTED_CONFIG_FILES); - Environment env(paths, Version(1, 2, 170)); - env.Reset(Environment::DEFAULT); + EXPECT_STREQ(text_layers_override_ref.toStdString().c_str(), text_layers_override_gen.toStdString().c_str()); - LayerManager layer_manager(env); - layer_manager.LoadLayersFromPath(":/"); + QFile file_settings_override_ref((":" + LAYERS_SETTINGS).c_str()); + const bool result_settings_override_ref = file_settings_override_ref.open(QFile::ReadOnly); + assert(result_settings_override_ref); + QString text_settings_override_ref = file_settings_override_ref.readAll(); + file_settings_override_ref.close(); + + text_settings_override_ref.replace("\r\n", "\n"); // Using UNIX EOL + + QFile file_settings_override_gen(("." + LAYERS_SETTINGS).c_str()); + const bool result_settings_override_gen = file_settings_override_gen.open(QFile::ReadOnly); + assert(result_settings_override_gen); + QString text_settings_override_gen = file_settings_override_gen.readAll(); + file_settings_override_gen.close(); + + text_settings_override_gen.replace("\r\n", "\n"); // Using UNIX EOL + + EXPECT_EQ(text_settings_override_ref.size(), text_settings_override_gen.size()); + EXPECT_STREQ(text_settings_override_ref.toStdString().c_str(), text_settings_override_gen.toStdString().c_str()); + + EXPECT_EQ(true, configurator.Surrender()); + + configurator.environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit +} + +TEST(test_override, write_erase_per_application) { + const std::string LOADER_SETTINGS("/loader_settings.json"); + const std::string LAYERS_SETTINGS("/layers_settings.txt"); + + Configurator& configurator = Configurator::Get(); + configurator.environment.Reset(Environment::DEFAULT); + configurator.environment.SetPerApplicationConfig(true); + configurator.layers.LoadLayersFromPath(":/layers"); Configuration configuration; - const bool load = configuration.Load(layer_manager.selected_layers, ":/Configuration 2.2.2.json"); + const bool load = configuration.Load(configurator.layers.selected_layers, ":/test/Configuration 3.0.0.json"); EXPECT_TRUE(load); EXPECT_TRUE(!configuration.parameters.empty()); - EXPECT_EQ(true, WriteLayersOverride(env, layer_manager.selected_layers, configuration, "." + LAYERS)); - EXPECT_EQ(true, WriteLayersSettings(layer_manager.selected_layers, configuration, "." + SETTINGS)); + EXPECT_EQ(true, configurator.Override()); - QFile file_layers_override_ref((":" + LAYERS).c_str()); + QFile file_layers_override_ref((":" + LOADER_SETTINGS).c_str()); const bool result_layers_override_ref = file_layers_override_ref.open(QIODevice::ReadOnly | QIODevice::Text); assert(result_layers_override_ref); QString text_layers_override_ref = file_layers_override_ref.readAll(); file_layers_override_ref.close(); - QFile file_layers_override_gen(("." + LAYERS).c_str()); + QFile file_layers_override_gen(("." + LOADER_SETTINGS).c_str()); const bool result_layers_override_gen = file_layers_override_gen.open(QIODevice::ReadOnly | QIODevice::Text); assert(result_layers_override_gen); QString text_layers_override_gen = file_layers_override_gen.readAll(); @@ -75,7 +115,7 @@ TEST(test_override, write_erase_2_2_2) { EXPECT_STREQ(text_layers_override_ref.toStdString().c_str(), text_layers_override_gen.toStdString().c_str()); - QFile file_settings_override_ref((":" + SETTINGS).c_str()); + QFile file_settings_override_ref((":" + LAYERS_SETTINGS).c_str()); const bool result_settings_override_ref = file_settings_override_ref.open(QFile::ReadOnly); assert(result_settings_override_ref); QString text_settings_override_ref = file_settings_override_ref.readAll(); @@ -83,7 +123,7 @@ TEST(test_override, write_erase_2_2_2) { text_settings_override_ref.replace("\r\n", "\n"); // Using UNIX EOL - QFile file_settings_override_gen(("." + SETTINGS).c_str()); + QFile file_settings_override_gen(("." + LAYERS_SETTINGS).c_str()); const bool result_settings_override_gen = file_settings_override_gen.open(QFile::ReadOnly); assert(result_settings_override_gen); QString text_settings_override_gen = file_settings_override_gen.readAll(); @@ -94,28 +134,24 @@ TEST(test_override, write_erase_2_2_2) { EXPECT_EQ(text_settings_override_ref.size(), text_settings_override_gen.size()); EXPECT_STREQ(text_settings_override_ref.toStdString().c_str(), text_settings_override_gen.toStdString().c_str()); - EXPECT_EQ(true, EraseLayersOverride("." + LAYERS)); - EXPECT_EQ(true, EraseSettingsOverride("." + SETTINGS)); + EXPECT_EQ(true, configurator.Surrender()); - env.Reset(Environment::SYSTEM); // Don't change the system settings on exit + configurator.environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit } TEST(test_override, vk_layer_settings_txt) { const char* LAYER = "VK_LAYER_LUNARG_reference_1_2_1"; - PathManager paths("", SUPPORTED_CONFIG_FILES); - Environment env(paths, Version(1, 2, 162)); - env.Reset(Environment::DEFAULT); - - LayerManager layer_manager(env); - layer_manager.LoadLayersFromPath(":/"); + Configurator& configurator = Configurator::Get(); + configurator.environment.Reset(Environment::DEFAULT); + configurator.layers.LoadLayersFromPath(":/layers"); Configuration configuration; - const bool load = configuration.Load(layer_manager.selected_layers, ":/Configuration 2.2.2.json"); + const bool load = configuration.Load(configurator.layers.selected_layers, ":/test/Configuration 3.0.0.json"); EXPECT_TRUE(load); EXPECT_TRUE(!configuration.parameters.empty()); - EXPECT_EQ(true, OverrideConfiguration(env, layer_manager.selected_layers, configuration)); + EXPECT_EQ(true, configurator.Override()); VkuLayerSettingSet layerSettingSet = VK_NULL_HANDLE; vkuCreateLayerSettingSet(LAYER, nullptr, nullptr, nullptr, &layerSettingSet); @@ -248,31 +284,28 @@ TEST(test_override, vk_layer_settings_txt) { vkuGetLayerSettingValues(layerSettingSet, "list_empty", setting_list_empty); EXPECT_EQ(true, setting_list_empty.empty()); - EXPECT_EQ(true, SurrenderConfiguration(env)); + EXPECT_EQ(true, configurator.Surrender()); vkuDestroyLayerSettingSet(layerSettingSet, nullptr); - env.Reset(Environment::SYSTEM); // Don't change the system settings on exit + configurator.environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit } TEST(test_override, env_var) { const char* LAYER = "VK_LAYER_LUNARG_reference_1_2_1"; - PathManager paths("", SUPPORTED_CONFIG_FILES); - Environment env(paths, Version(1, 2, 162)); - env.Reset(Environment::DEFAULT); - - LayerManager layer_manager(env); - layer_manager.LoadLayersFromPath(":/"); + Configurator& configurator = Configurator::Get(); + configurator.environment.Reset(Environment::DEFAULT); + configurator.layers.LoadLayersFromPath(":/layers"); Configuration configuration; - const bool load = configuration.Load(layer_manager.selected_layers, ":/Configuration 2.2.2.json"); + const bool load = configuration.Load(configurator.layers.selected_layers, ":/test/Configuration 3.0.0.json"); EXPECT_TRUE(load); EXPECT_TRUE(!configuration.parameters.empty()); qputenv("VK_LAYER_SETTINGS_PATH", "./vk_layer_settings.txt"); - EXPECT_EQ(true, OverrideConfiguration(env, layer_manager.selected_layers, configuration)); + EXPECT_EQ(true, configurator.Override()); VkuLayerSettingSet layerSettingSet = VK_NULL_HANDLE; vkuCreateLayerSettingSet(LAYER, nullptr, nullptr, nullptr, &layerSettingSet); @@ -301,7 +334,8 @@ TEST(test_override, env_var) { vkuDestroyLayerSettingSet(layerSettingSet, nullptr); - EXPECT_EQ(true, SurrenderConfiguration(env)); + EXPECT_EQ(true, configurator.Surrender()); - env.Reset(Environment::SYSTEM); // Don't change the system settings on exit + configurator.environment.Reset(Environment::SYSTEM); // Don't change the system settings on exit } +*/ diff --git a/vkconfig_core/test/test_parameter.cpp b/vkconfig_core/test/test_parameter.cpp index 8a6be4c79d..00bbf7cf26 100644 --- a/vkconfig_core/test/test_parameter.cpp +++ b/vkconfig_core/test/test_parameter.cpp @@ -24,7 +24,7 @@ #include "../setting_string.h" #include - +/* inline SettingMetaString* InstantiateString(Layer& layer, const std::string& key) { return static_cast(layer.Instantiate(layer.settings, key, SETTING_STRING)); } @@ -45,84 +45,81 @@ static std::vector GenerateTestLayers() { static std::vector GenerateTestParametersExist() { std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer C1", LAYER_STATE_APPLICATION_CONTROLLED)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer C1", LAYER_CONTROL_AUTO)); return parameters; } static std::vector GenerateTestParametersMissing() { std::vector parameters; - parameters.push_back(Parameter("Layer E3", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer C1", LAYER_STATE_APPLICATION_CONTROLLED)); + parameters.push_back(Parameter("Layer E3", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer C1", LAYER_CONTROL_AUTO)); return parameters; } static std::vector GenerateTestParametersAll() { std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_APPLICATION_CONTROLLED)); - parameters.push_back(Parameter("Layer E3", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E4", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer E5", LAYER_STATE_APPLICATION_CONTROLLED)); - - parameters.push_back(Parameter("Layer I0", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer I1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer I2", LAYER_STATE_APPLICATION_CONTROLLED)); - parameters.push_back(Parameter("Layer I3", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer I4", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer I5", LAYER_STATE_APPLICATION_CONTROLLED)); - - parameters.push_back(Parameter("Layer C0", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer C1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer C2", LAYER_STATE_APPLICATION_CONTROLLED)); - parameters.push_back(Parameter("Layer C3", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer C4", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer C5", LAYER_STATE_APPLICATION_CONTROLLED)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_AUTO)); + parameters.push_back(Parameter("Layer E3", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E4", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer E5", LAYER_CONTROL_AUTO)); + + parameters.push_back(Parameter("Layer I0", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer I1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer I2", LAYER_CONTROL_AUTO)); + parameters.push_back(Parameter("Layer I3", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer I4", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer I5", LAYER_CONTROL_AUTO)); + + parameters.push_back(Parameter("Layer C0", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer C1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer C2", LAYER_CONTROL_AUTO)); + parameters.push_back(Parameter("Layer C3", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer C4", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer C5", LAYER_CONTROL_AUTO)); return parameters; } TEST(test_parameter, ordering_no_layers) { std::vector layers; - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer", LAYER_STATE_APPLICATION_CONTROLLED))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer", LAYER_STATE_EXCLUDED))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer", LAYER_CONTROL_AUTO))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer", LAYER_CONTROL_OFF))); } TEST(test_parameter, ordering_found_custom_layers) { const std::vector& layers = GenerateTestLayers(); - EXPECT_EQ(PARAMETER_RANK_EXPLICIT_AVAILABLE, - GetParameterOrdering(layers, Parameter("Layer C0", LAYER_STATE_APPLICATION_CONTROLLED))); - EXPECT_EQ(PARAMETER_RANK_EXPLICIT_OVERRIDDEN, GetParameterOrdering(layers, Parameter("Layer C1", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_EXCLUDED, GetParameterOrdering(layers, Parameter("Layer C1", LAYER_STATE_EXCLUDED))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer C3", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer C4", LAYER_STATE_EXCLUDED))); + EXPECT_EQ(PARAMETER_RANK_EXPLICIT_AVAILABLE, GetParameterOrdering(layers, Parameter("Layer C0", LAYER_CONTROL_AUTO))); + EXPECT_EQ(PARAMETER_RANK_EXPLICIT_OVERRIDDEN, GetParameterOrdering(layers, Parameter("Layer C1", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_EXCLUDED, GetParameterOrdering(layers, Parameter("Layer C1", LAYER_CONTROL_OFF))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer C3", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer C4", LAYER_CONTROL_OFF))); } TEST(test_parameter, ordering_found_explicit_layers) { const std::vector& layers = GenerateTestLayers(); - EXPECT_EQ(PARAMETER_RANK_EXPLICIT_AVAILABLE, - GetParameterOrdering(layers, Parameter("Layer E0", LAYER_STATE_APPLICATION_CONTROLLED))); - EXPECT_EQ(PARAMETER_RANK_EXPLICIT_OVERRIDDEN, GetParameterOrdering(layers, Parameter("Layer E1", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_EXCLUDED, GetParameterOrdering(layers, Parameter("Layer E1", LAYER_STATE_EXCLUDED))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer E3", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer E4", LAYER_STATE_EXCLUDED))); + EXPECT_EQ(PARAMETER_RANK_EXPLICIT_AVAILABLE, GetParameterOrdering(layers, Parameter("Layer E0", LAYER_CONTROL_AUTO))); + EXPECT_EQ(PARAMETER_RANK_EXPLICIT_OVERRIDDEN, GetParameterOrdering(layers, Parameter("Layer E1", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_EXCLUDED, GetParameterOrdering(layers, Parameter("Layer E1", LAYER_CONTROL_OFF))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer E3", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer E4", LAYER_CONTROL_OFF))); } TEST(test_parameter, ordering_found_implicit_layers) { const std::vector& layers = GenerateTestLayers(); - EXPECT_EQ(PARAMETER_RANK_IMPLICIT_AVAILABLE, - GetParameterOrdering(layers, Parameter("Layer I0", LAYER_STATE_APPLICATION_CONTROLLED))); - EXPECT_EQ(PARAMETER_RANK_IMPLICIT_OVERRIDDEN, GetParameterOrdering(layers, Parameter("Layer I1", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_EXCLUDED, GetParameterOrdering(layers, Parameter("Layer I1", LAYER_STATE_EXCLUDED))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer I3", LAYER_STATE_OVERRIDDEN))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer I4", LAYER_STATE_EXCLUDED))); + EXPECT_EQ(PARAMETER_RANK_IMPLICIT_AVAILABLE, GetParameterOrdering(layers, Parameter("Layer I0", LAYER_CONTROL_AUTO))); + EXPECT_EQ(PARAMETER_RANK_IMPLICIT_OVERRIDDEN, GetParameterOrdering(layers, Parameter("Layer I1", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_EXCLUDED, GetParameterOrdering(layers, Parameter("Layer I1", LAYER_CONTROL_OFF))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer I3", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layers, Parameter("Layer I4", LAYER_CONTROL_OFF))); } TEST(test_parameter, missing_layers) { @@ -142,15 +139,15 @@ TEST(test_parameter, missing_layers) { TEST(test_parameter, filter) { std::vector parameters_app_controlled = GenerateTestParametersExist(); - FilterParameters(parameters_app_controlled, LAYER_STATE_APPLICATION_CONTROLLED); + FilterParameters(parameters_app_controlled, LAYER_CONTROL_AUTO); EXPECT_EQ(2, parameters_app_controlled.size()); std::vector parameters_overridden = GenerateTestParametersExist(); - FilterParameters(parameters_overridden, LAYER_STATE_OVERRIDDEN); + FilterParameters(parameters_overridden, LAYER_CONTROL_ON); EXPECT_EQ(2, parameters_overridden.size()); std::vector parameters_excluded = GenerateTestParametersExist(); - FilterParameters(parameters_excluded, LAYER_STATE_EXCLUDED); + FilterParameters(parameters_excluded, LAYER_CONTROL_OFF); EXPECT_EQ(2, parameters_excluded.size()); } @@ -341,9 +338,9 @@ TEST(test_parameter, compute_min_api_version_exclude_middle) { layers.push_back(Layer("Layer E2", LAYER_TYPE_EXPLICIT, Version(1, 0, 0), Version(1, 2, 176), "1", "layer.json")); std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_APPLICATION_CONTROLLED)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_AUTO)); Version min_version_A = ComputeMinApiVersion(Version(1, 2, 170), parameters, layers); EXPECT_EQ(Version(1, 2, 148), min_version_A); @@ -359,9 +356,9 @@ TEST(test_parameter, compute_min_api_version_exclude_older) { layers.push_back(Layer("Layer E2", LAYER_TYPE_EXPLICIT, Version(1, 0, 0), Version(1, 2, 176), "1", "layer.json")); std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_APPLICATION_CONTROLLED)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_AUTO)); Version min_version_A = ComputeMinApiVersion(Version(1, 2, 170), parameters, layers); EXPECT_EQ(Version(1, 2, 162), min_version_A); @@ -377,9 +374,9 @@ TEST(test_parameter, compute_min_api_version_exclude_newer) { layers.push_back(Layer("Layer E2", LAYER_TYPE_EXPLICIT, Version(1, 0, 0), Version(1, 2, 176), "1", "layer.json")); std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_APPLICATION_CONTROLLED)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_EXCLUDED)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_AUTO)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_OFF)); Version min_version_A = ComputeMinApiVersion(Version(1, 2, 170), parameters, layers); EXPECT_EQ(Version(1, 2, 148), min_version_A); @@ -395,9 +392,9 @@ TEST(test_parameter, compute_min_api_version_exclude_all) { layers.push_back(Layer("Layer E2", LAYER_TYPE_EXPLICIT, Version(1, 0, 0), Version(1, 2, 176), "1", "layer.json")); std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_EXCLUDED)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_EXCLUDED)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_OFF)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_OFF)); Version min_version_A = ComputeMinApiVersion(Version(1, 2, 170), parameters, layers); EXPECT_EQ(Version(1, 2, 170), min_version_A); @@ -409,9 +406,9 @@ TEST(test_parameter, compute_min_api_version_missing_one) { layers.push_back(Layer("Layer E2", LAYER_TYPE_EXPLICIT, Version(1, 0, 0), Version(1, 2, 176), "1", "layer.json")); std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_APPLICATION_CONTROLLED)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_OVERRIDDEN)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_AUTO)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_ON)); Version min_version_A = ComputeMinApiVersion(Version(1, 2, 170), parameters, layers); EXPECT_EQ(Version(1, 2, 148), min_version_A); @@ -421,10 +418,11 @@ TEST(test_parameter, compute_min_api_version_missing_all) { std::vector layers; std::vector parameters; - parameters.push_back(Parameter("Layer E0", LAYER_STATE_APPLICATION_CONTROLLED)); - parameters.push_back(Parameter("Layer E1", LAYER_STATE_OVERRIDDEN)); - parameters.push_back(Parameter("Layer E2", LAYER_STATE_OVERRIDDEN)); + parameters.push_back(Parameter("Layer E0", LAYER_CONTROL_AUTO)); + parameters.push_back(Parameter("Layer E1", LAYER_CONTROL_ON)); + parameters.push_back(Parameter("Layer E2", LAYER_CONTROL_ON)); Version min_version_A = ComputeMinApiVersion(Version(1, 2, 170), parameters, layers); EXPECT_EQ(Version(1, 2, 170), min_version_A); } +*/ diff --git a/vkconfig_core/test/test_path.cpp b/vkconfig_core/test/test_path.cpp index 340be49f30..e18c85cb92 100644 --- a/vkconfig_core/test/test_path.cpp +++ b/vkconfig_core/test/test_path.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include "../path.h" #include "../util.h" -#include "../platform.h" +#include "../type_platform.h" #include @@ -28,52 +28,19 @@ #include -// Test that GetPath return the home directory when the stored path is empty -TEST(test_path, get_path) { EXPECT_STRNE(GetPath(BUILTIN_PATH_HOME).c_str(), ""); } - -TEST(test_path, replace_path_home) { - const std::string replaced_path = ReplaceBuiltInVariable("${HOME}/test.txt"); - - EXPECT_TRUE(replaced_path.find("${HOME}") > replaced_path.size()); -} - -TEST(test_path, replace_path_vk_local) { - const std::string replaced_path = ReplaceBuiltInVariable("${VK_LOCAL}/test.txt"); - - EXPECT_TRUE(replaced_path.find("${VK_LOCAL}") > replaced_path.size()); -} - -TEST(test_path, replace_path_vk_appdata) { - const std::string replaced_path = ReplaceBuiltInVariable("${VK_APPDATA}/test.txt"); - - EXPECT_TRUE(replaced_path.find("${VK_APPDATA}") > replaced_path.size()); -} - -TEST(test_path, replace_path_unknown) { - const std::string replaced_path = ReplaceBuiltInVariable("${UNKNOWN}/test.txt"); - - EXPECT_STREQ("${UNKNOWN}/test.txt", replaced_path.c_str()); -} - -TEST(test_path, convert_native_separator_empty) { - const std::string replaced_path = ReplaceBuiltInVariable(""); - - EXPECT_STREQ("", replaced_path.c_str()); -} - TEST(test_path, native_path) { static const char* table[] = { "/vkconfig/test\\path/format/", "/vkconfig/test\\path/format\\", "/vkconfig\\test/path/format/", "/vkconfig\\test/path\\format/", "/vkconfig\\test/path/format", "/vkconfig/test/path/format", "\\vkconfig\\test/path\\format", "/vkconfig/test/path/format/", "\\vkconfig\\test/path\\format\\"}; - for (std::size_t i = 0, n = countof(table); i < n; ++i) { + for (std::size_t i = 0, n = std::size(table); i < n; ++i) { const std::string test_case = table[i]; if (VKC_PLATFORM == VKC_PLATFORM_WINDOWS) { - EXPECT_STREQ("\\vkconfig\\test\\path\\format", ConvertNativeSeparators(test_case).c_str()); + EXPECT_STREQ("\\vkconfig\\test\\path\\format", Path(test_case).RelativePath().c_str()); } else { - EXPECT_STREQ("/vkconfig/test/path/format", ConvertNativeSeparators(test_case).c_str()); + EXPECT_STREQ("/vkconfig/test/path/format", Path(test_case).RelativePath().c_str()); } } } @@ -81,101 +48,279 @@ TEST(test_path, native_path) { TEST(test_path, native_path_with_file) { static const char* table[] = {"/vkconfig/test/path/format/file.txt", "\\vkconfig\\test/path\\format\\file.txt"}; - for (std::size_t i = 0, n = countof(table); i < n; ++i) { + for (std::size_t i = 0, n = std::size(table); i < n; ++i) { const std::string test_case = table[i]; if (VKC_PLATFORM == VKC_PLATFORM_WINDOWS) { - EXPECT_STREQ("\\vkconfig\\test\\path\\format\\file.txt", ConvertNativeSeparators(test_case).c_str()); + EXPECT_STREQ("\\vkconfig\\test\\path\\format\\file.txt", Path(test_case).RelativePath().c_str()); } else { - EXPECT_STREQ("/vkconfig/test/path/format/file.txt", ConvertNativeSeparators(test_case).c_str()); + EXPECT_STREQ("/vkconfig/test/path/format/file.txt", Path(test_case).RelativePath().c_str()); } } } -TEST(test_path, is_portable_filename_valid) { - EXPECT_TRUE(IsPortableFilename("VUlkanConfigurator2")); - EXPECT_TRUE(IsPortableFilename("VUlkanConfigurator2.json")); - EXPECT_TRUE(IsPortableFilename(".VUlkanConfigurator2.json")); +TEST(test_path, path_addition) { + Path pathR("testA/test"); + Path pathA = (Path("testA") += "/") + "test"; + Path pathB = Path("testA") + "/" + "test"; + Path pathC = Path("testA") += "/test"; + + EXPECT_TRUE(pathR == pathA); + EXPECT_TRUE(pathR == pathB); + EXPECT_TRUE(pathR == pathC); + EXPECT_STREQ(pathR.RelativePath().c_str(), pathA.RelativePath().c_str()); + EXPECT_STREQ(pathR.RelativePath().c_str(), pathB.RelativePath().c_str()); + EXPECT_STREQ(pathR.RelativePath().c_str(), pathC.RelativePath().c_str()); + EXPECT_STREQ(pathR.AbsolutePath().c_str(), pathA.AbsolutePath().c_str()); + EXPECT_STREQ(pathR.AbsolutePath().c_str(), pathB.AbsolutePath().c_str()); + EXPECT_STREQ(pathR.AbsolutePath().c_str(), pathC.AbsolutePath().c_str()); } -TEST(test_path, is_portable_filename_invalid) { - EXPECT_TRUE(!IsPortableFilename(".")); - EXPECT_TRUE(!IsPortableFilename("..")); - EXPECT_TRUE(!IsPortableFilename("../gni")); - EXPECT_TRUE(!IsPortableFilename("..gni.json")); - EXPECT_TRUE(!IsPortableFilename("VulkanConfigurator2\\.json")); - EXPECT_TRUE(!IsPortableFilename("VulkanConfigurator*")); - EXPECT_TRUE(!IsPortableFilename("Vulkan:Configurator")); +TEST(test_path, path_operation_clear) { + static const char* table[] = {"/vkconfig/test/path/format/file.txt", "\\vkconfig\\test/path\\format\\file.txt", + "/vkconfig\\test/path/format/", ""}; + + for (std::size_t i = 0, n = std::size(table); i < n; ++i) { + Path test_case = Path(table[i]); + test_case.Clear(); + + EXPECT_TRUE(test_case.Empty()); + } } -TEST(test_path, get_path_local) { - const QString value(::GetPath(BUILTIN_PATH_LOCAL).c_str()); +TEST(test_path, path_operations_valid) { + struct test_case { + std::string path; + bool is_file; + }; + + static const test_case CASES[] = {{"./fileA.pouet", true}, {"./testA/", false}}; + + for (std::size_t i = 0, n = std::size(CASES); i < n; ++i) { + Path test_case = Path(CASES[i].path.c_str()); + EXPECT_FALSE(test_case.Exists()); + EXPECT_TRUE(test_case.Create(CASES[i].is_file)); + EXPECT_TRUE(test_case.Exists()); + EXPECT_EQ(test_case.IsFile(), CASES[i].is_file); + EXPECT_TRUE(test_case.Create(CASES[i].is_file)); + EXPECT_TRUE(test_case.Exists()); + EXPECT_TRUE(test_case.Remove()); + EXPECT_FALSE(test_case.Exists()); + EXPECT_FALSE(test_case.Remove()); + EXPECT_FALSE(test_case.Exists()); + + test_case.Clear(); + EXPECT_TRUE(test_case.Empty()); + } +} + +TEST(test_path, path_operations_invalid) { + Path test_case(""); + EXPECT_TRUE(test_case.Empty()); + EXPECT_FALSE(test_case.Exists()); + EXPECT_FALSE(test_case.Create(true)); + EXPECT_FALSE(test_case.Create(false)); + EXPECT_FALSE(test_case.IsFile()); + EXPECT_FALSE(test_case.IsDir()); + EXPECT_FALSE(test_case.Remove()); +}; + +// Test that GetPath return the home directory when the stored path is empty +TEST(test_path, get_path) { EXPECT_STRNE(Get(Path::HOME).RelativePath().c_str(), ""); } - EXPECT_TRUE(value.endsWith("VulkanSDK")); +TEST(test_path, replace_path_vk_home) { + const std::string replaced_path = Path("${VK_HOME}/test.txt").AbsolutePath(); + + EXPECT_TRUE(replaced_path.find("${VK_HOME}") > replaced_path.size()); +} + +TEST(test_path, replace_path_vk_appdata) { + const std::string replaced_path = Path("${VK_APPDATA}/test.txt").AbsolutePath(); + + EXPECT_TRUE(replaced_path.find("${VK_APPDATA}") > replaced_path.size()); +} + +TEST(test_path, replace_path_unknown) { + const std::string replaced_path = Path("${UNKNOWN}/test.txt").AbsolutePath(); + + // unknown variables are not replaced or modified + EXPECT_TRUE(replaced_path.find("${UNKNOWN}") == 0); +} + +TEST(test_path, convert_to_variable) { + const std::string replaced_path = ::Get(Path::SDK).AbsolutePath(); + + Path recovered_path(replaced_path, true); + + EXPECT_EQ(::Get(Path::SDK), recovered_path); +} + +TEST(test_path, convert_to_variable_postfix) { + const Path base_path(::Get(Path::SDK).AbsolutePath(), true); + const Path reference_path = base_path + "/TestA"; + + const std::string replaced_path = reference_path.AbsolutePath(); + Path recovered_path(replaced_path, true); + + EXPECT_EQ(reference_path, recovered_path); +} + +TEST(test_path, convert_native_separator_empty) { + const std::string replaced_path = Path("").AbsolutePath(); + + EXPECT_STREQ("", replaced_path.c_str()); +} + +TEST(test_path, get_path_home) { + const std::string value_default(AbsolutePath(Path::HOME).c_str()); + + EXPECT_TRUE(EndsWith(value_default, "VulkanSDK")); + + qputenv("VK_HOME", ":/MyVulkanSDKLocalDir"); + + const std::string value_env(AbsolutePath(Path::HOME).c_str()); + + EXPECT_STREQ(Path(":/MyVulkanSDKLocalDir").RelativePath().c_str(), value_env.c_str()); } TEST(test_path, get_path_appdata) { - const QString value(::GetPath(BUILTIN_PATH_APPDATA).c_str()); + const std::string data(AbsolutePath(Path::APPDATA).c_str()); + const std::string home(Path(QDir().homePath().toStdString()).AbsolutePath()); + + EXPECT_TRUE(data.find(home.c_str()) == 0); +} + +TEST(test_path, get_path_init) { + const std::string init(AbsolutePath(Path::INIT).c_str()); + const std::string data(AbsolutePath(Path::APPDATA).c_str()); - EXPECT_TRUE(value.startsWith(::GetPath(BUILTIN_PATH_HOME).c_str())); + EXPECT_TRUE(init.find(data.c_str()) != std::string::npos); + EXPECT_TRUE(init.find("vkconfig.json") != std::string::npos); } TEST(test_path, get_path_config) { - const QString value(::GetPath(BUILTIN_PATH_CONFIG_REF).c_str()); + const QString value(AbsolutePath(Path::CONFIGS).c_str()); - EXPECT_TRUE(value.startsWith(::GetPath(BUILTIN_PATH_APPDATA).c_str())); + EXPECT_TRUE(value.startsWith(AbsolutePath(Path::CONFIGS).c_str())); EXPECT_TRUE(value.endsWith("configurations")); } +TEST(test_path, get_path_layers_settings) { + const std::string value(AbsolutePath(Path::LAYERS_SETTINGS).c_str()); + + EXPECT_TRUE(value.find("vk_layer_settings.txt") != std::string::npos); + EXPECT_TRUE(value.find(AbsolutePath(Path::APPDATA).c_str()) != std::string::npos); +} + +TEST(test_path, get_path_loader_settings) { + const std::string value(AbsolutePath(Path::LOADER_SETTINGS).c_str()); + + EXPECT_TRUE(value.find("vk_loader_settings.json") != std::string::npos); + EXPECT_TRUE(value.find(AbsolutePath(Path::APPDATA).c_str()) != std::string::npos); +} + TEST(test_path, get_path_override_settings) { { - const QString value(::GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS).c_str()); + const QString value(AbsolutePath(Path::LAYERS_SETTINGS).c_str()); EXPECT_TRUE(value.endsWith("vk_layer_settings.txt")); } { qputenv("VK_LAYER_SETTINGS_PATH", "~/VulkanSDK/vk_layer_settings.txt"); - const std::string value = ::GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - EXPECT_STREQ(ConvertNativeSeparators("~/VulkanSDK/vk_layer_settings.txt").c_str(), value.c_str()); + const std::string value = AbsolutePath(Path::LAYERS_SETTINGS).c_str(); + EXPECT_STREQ(Path("~/VulkanSDK/vk_layer_settings.txt").AbsolutePath().c_str(), value.c_str()); } { qputenv("VK_LAYER_SETTINGS_PATH", "~/VulkanSDK"); - const std::string value = ::GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); - EXPECT_STREQ(ConvertNativeSeparators("~/VulkanSDK/vk_layer_settings.txt").c_str(), value.c_str()); + const std::string value = AbsolutePath(Path::LAYERS_SETTINGS).c_str(); + EXPECT_STREQ(Path("~/VulkanSDK/vk_layer_settings.txt").AbsolutePath().c_str(), value.c_str()); } } TEST(test_path, get_path_override_layers) { - const QString value(::GetPath(BUILTIN_PATH_OVERRIDE_LAYERS).c_str()); + const QString value(AbsolutePath(Path::LOADER_SETTINGS).c_str()); - EXPECT_TRUE(value.endsWith("VkLayer_override.json")); + EXPECT_TRUE(value.endsWith("vk_loader_settings.json")); } TEST(test_path, get_path_vulkan_sdk) { - { - qputenv("VULKAN_SDK", ""); - const std::string value = ::GetPath(BUILTIN_PATH_VULKAN_SDK); - EXPECT_TRUE(!value.empty()); - } - { #ifdef __APPLE__ qputenv("VULKAN_SDK", "~/VulkanSDK"); - const std::string value = ::GetPath(BUILTIN_PATH_VULKAN_SDK); - EXPECT_STREQ(ConvertNativeSeparators("~/VulkanSDK/share/vulkan").c_str(), value.c_str()); + const std::string value = AbsolutePath(Path::SDK); + EXPECT_STREQ(Path("~/VulkanSDK/share/vulkan").AbsolutePath().c_str(), value.c_str()); #else qputenv("VULKAN_SDK", "~/VulkanSDK"); - const std::string value = ::GetPath(BUILTIN_PATH_VULKAN_SDK); - EXPECT_STREQ(ConvertNativeSeparators("~/VulkanSDK").c_str(), value.c_str()); + const std::string value = AbsolutePath(Path::SDK); + EXPECT_STREQ(Path("~/VulkanSDK").AbsolutePath().c_str(), value.c_str()); #endif } } TEST(test_path, get_path_vulkan_content) { - const QString value(::GetPath(BUILTIN_PATH_VULKAN_CONTENT).c_str()); + const QString value(AbsolutePath(Path::CONTENT).c_str()); EXPECT_TRUE(!value.isEmpty()); - EXPECT_TRUE(value.startsWith(::GetPath(BUILTIN_PATH_VULKAN_SDK).c_str())); + EXPECT_TRUE(value.startsWith(AbsolutePath(Path::SDK).c_str())); EXPECT_TRUE(value.toLower().endsWith("config")); } + +TEST(test_path, collect_file_paths_success_set1) { + const std::vector& paths = CollectFilePaths(":/configurations/"); + + EXPECT_EQ(paths.size(), 5); + EXPECT_STREQ(Path(":/configurations/API dump.json").AbsolutePath().c_str(), paths[0].AbsolutePath().c_str()); +} + +TEST(test_path, collect_file_paths_success_set2) { + const std::vector& paths = CollectFilePaths(":/layers/"); + + EXPECT_EQ(paths.size(), 10); + EXPECT_STREQ(Path(":/layers/VK_LAYER_LUNARG_reference_1_1_0.json").AbsolutePath().c_str(), paths[0].AbsolutePath().c_str()); +} + +TEST(test_path, collect_file_paths_success_set3) { + const std::vector& paths = CollectFilePaths(":/profiles/"); + + EXPECT_EQ(paths.size(), 4); + EXPECT_STREQ(Path(":/profiles/VP_KHR_roadmap.json").AbsolutePath().c_str(), paths[0].AbsolutePath().c_str()); +} + +TEST(test_path, collect_file_paths_not_found) { + const std::vector& result = CollectFilePaths(":/configurations_not_found/"); + + EXPECT_EQ(result.empty(), true); +} + +TEST(test_path, collect_profiles_from_file) { + const std::vector& result = CollectProfileNamesFromFile(":/profiles/VP_KHR_roadmap.json"); + + EXPECT_EQ(result.size(), 2); + EXPECT_STREQ("VP_KHR_roadmap_2022", result[0].c_str()); + EXPECT_STREQ("VP_KHR_roadmap_2024", result[1].c_str()); +} + +TEST(test_path, collect_profiles_from_dir) { + const std::vector& result = CollectProfileNamesFromDir(":/profiles/"); + + EXPECT_EQ(result.size(), 9); + EXPECT_STREQ("VP_KHR_roadmap_2022", result[0].c_str()); + EXPECT_STREQ("VP_KHR_roadmap_2024", result[1].c_str()); +} + +TEST(test_path, is_portable_filename_valid) { + EXPECT_TRUE(IsPortableFilename("VUlkanConfigurator2")); + EXPECT_TRUE(IsPortableFilename("VUlkanConfigurator2.json")); + EXPECT_TRUE(IsPortableFilename(".VUlkanConfigurator2.json")); +} + +TEST(test_path, is_portable_filename_invalid) { + EXPECT_TRUE(!IsPortableFilename(".")); + EXPECT_TRUE(!IsPortableFilename("..")); + EXPECT_TRUE(!IsPortableFilename("../gni")); + EXPECT_TRUE(!IsPortableFilename("..gni.json")); + EXPECT_TRUE(!IsPortableFilename("VulkanConfigurator2\\.json")); + EXPECT_TRUE(!IsPortableFilename("VulkanConfigurator*")); + EXPECT_TRUE(!IsPortableFilename("Vulkan:Configurator")); +} diff --git a/vkconfig_core/test/test_path_manager.cpp b/vkconfig_core/test/test_path_manager.cpp deleted file mode 100644 index 533b6484bf..0000000000 --- a/vkconfig_core/test/test_path_manager.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: - * - Christophe Riccio - */ - -#include "../path_manager.h" -#include "../util.h" -#include "../platform.h" - -#include -#include - -#include - -static void Init(PathManager& paths, const std::string& path_value) { - for (int i = 0, n = PATH_COUNT; i < n; ++i) { - const PathType path = static_cast(i); - paths.SetPath(path, path_value); - } -} - -static std::string InitPath(const char* tail) { - const QDir dir(QString("vkconfig/test_path_manager/") + tail); - const std::string native_path(ConvertNativeSeparators(dir.absolutePath().toStdString())); - return native_path; -} - -TEST(test_path_manager, init_first) { - const std::string path_value = InitPath("init_first"); - PathManager paths("", std::vector()); - Init(paths, path_value); - - EXPECT_STREQ(path_value.c_str(), paths.GetPath(PATH_FIRST).c_str()); -} - -TEST(test_path_manager, init_last) { - const std::string path_value = InitPath("init_last"); - PathManager paths("", std::vector()); - Init(paths, path_value); - - EXPECT_STREQ(path_value.c_str(), paths.GetPath(PATH_LAST).c_str()); -} - -TEST(test_path_manager, init_all) { - PathManager paths("", std::vector()); - paths.Clear(); - - for (int i = PATH_FIRST, n = PATH_LAST; i <= n; ++i) { - const PathType path = static_cast(i); - - std::string init_path = InitPath("init_all_%d"); - std::string path_string = format(init_path.c_str(), i); - - paths.SetPath(path, path_string.c_str()); - - EXPECT_STREQ(path_string.c_str(), paths.GetPath(path).c_str()); - } -} - -TEST(test_path_manager, path_format) { - static const char* table[] = { - "/vkconfig/test\\path/format/", "/vkconfig/test\\path/format\\", "/vkconfig\\test/path/format/", - "/vkconfig\\test/path\\format/", "/vkconfig\\test/path/format", "/vkconfig/test/path/format", - "\\vkconfig\\test/path\\format", "/vkconfig/test/path/format/", "\\vkconfig\\test/path\\format\\"}; - - for (std::size_t i = 0, n = countof(table); i < n; ++i) { - PathManager paths("", std::vector()); - paths.Clear(); - paths.SetPath(PATH_EXPORT_CONFIGURATION, QDir::homePath().toStdString() + table[i]); - - const std::string path(paths.GetPath(PATH_EXPORT_CONFIGURATION).c_str()); - const std::string home_path(GetPath(BUILTIN_PATH_HOME).c_str()); - - if (VKC_PLATFORM == VKC_PLATFORM_WINDOWS) { - EXPECT_STREQ((home_path + "\\vkconfig\\test\\path\\format").c_str(), path.c_str()); - } else { - EXPECT_STREQ((home_path + "/vkconfig/test/path/format").c_str(), path.c_str()); - } - } -} - -// Test that export path is used as an alternative to import path when import path is empty -TEST(test_path_manager, empty_import) { - PathManager paths("", std::vector()); - paths.Clear(); - paths.SetPath(PATH_EXPORT_CONFIGURATION, InitPath("empty_import")); - - EXPECT_STRNE(paths.GetPath(PATH_IMPORT_CONFIGURATION).c_str(), GetPath(BUILTIN_PATH_HOME).c_str()); - EXPECT_STREQ(paths.GetPath(PATH_EXPORT_CONFIGURATION).c_str(), paths.GetPath(PATH_IMPORT_CONFIGURATION).c_str()); -} - -// Test that import path is used as an alternative to export path when export path is empty -TEST(test_path_manager, empty_export) { - PathManager paths("", std::vector()); - paths.Clear(); - paths.SetPath(PATH_IMPORT_CONFIGURATION, InitPath("empty_export")); - - EXPECT_STRNE(paths.GetPath(PATH_EXPORT_CONFIGURATION).c_str(), GetPath(BUILTIN_PATH_HOME).c_str()); - EXPECT_STREQ(paths.GetPath(PATH_IMPORT_CONFIGURATION).c_str(), paths.GetPath(PATH_EXPORT_CONFIGURATION).c_str()); - - paths.Load(); -} - -TEST(test_path_manager, check_missing_dir) { - PathManager paths("", std::vector()); - paths.Clear(); - paths.SetPath(PATH_EXPORT_CONFIGURATION, InitPath("check_missing_dir")); - - EXPECT_TRUE(strstr(paths.GetPath(PATH_EXPORT_CONFIGURATION).c_str(), "check_missing_dir") != nullptr); - - paths.Load(); -} - -TEST(test_path_manager, check_default_suffix) { - PathManager paths("", std::vector()); - paths.Clear(); - - const QString string = paths.GetFullPath(PATH_EXPORT_CONFIGURATION, "my_configuration").c_str(); - - EXPECT_TRUE(string.endsWith("my_configuration.json")); - - paths.Load(); -} - -TEST(test_path_manager, check_with_suffix) { - PathManager paths("", std::vector()); - paths.Clear(); - - const QString string = paths.GetFullPath(PATH_EXPORT_CONFIGURATION, "my_configuration.json").c_str(); - - EXPECT_TRUE(string.endsWith("my_configuration.json")); - - paths.Load(); -} diff --git a/vkconfig_core/test/test_setting_type_file_load.cpp b/vkconfig_core/test/test_setting_type_file_load.cpp index 4be7b57005..38b1bf5f9c 100644 --- a/vkconfig_core/test/test_setting_type_file_load.cpp +++ b/vkconfig_core/test/test_setting_type_file_load.cpp @@ -69,6 +69,6 @@ TEST(test_setting_type_file_load, value) { SettingDataFileLoad* data = Instantiate(meta); data->value = "${VULKAN_CONTENT}/value"; - EXPECT_STREQ("${VULKAN_CONTENT}/value", data->Export(EXPORT_MODE_DOC).c_str()); - EXPECT_STRNE("${VULKAN_CONTENT}/value", data->Export(EXPORT_MODE_OVERRIDE).c_str()); + EXPECT_STREQ(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), data->Export(EXPORT_MODE_DOC).c_str()); + EXPECT_STRNE(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), data->Export(EXPORT_MODE_OVERRIDE).c_str()); } diff --git a/vkconfig_core/test/test_setting_type_file_save.cpp b/vkconfig_core/test/test_setting_type_file_save.cpp index 0a489df4a8..417edd34a2 100644 --- a/vkconfig_core/test/test_setting_type_file_save.cpp +++ b/vkconfig_core/test/test_setting_type_file_save.cpp @@ -69,6 +69,6 @@ TEST(test_setting_type_file_save, value) { SettingDataFileSave* data = Instantiate(meta); data->value = "${VULKAN_CONTENT}/value"; - EXPECT_STREQ("${VULKAN_CONTENT}/value", data->Export(EXPORT_MODE_DOC).c_str()); - EXPECT_STRNE("${VULKAN_CONTENT}/value", data->Export(EXPORT_MODE_OVERRIDE).c_str()); + EXPECT_STREQ(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), data->Export(EXPORT_MODE_DOC).c_str()); + EXPECT_STRNE(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), data->Export(EXPORT_MODE_OVERRIDE).c_str()); } diff --git a/vkconfig_core/test/test_setting_type_folder_save.cpp b/vkconfig_core/test/test_setting_type_folder_save.cpp index a37c2c2f8c..3d0d9b6fcb 100644 --- a/vkconfig_core/test/test_setting_type_folder_save.cpp +++ b/vkconfig_core/test/test_setting_type_folder_save.cpp @@ -67,10 +67,10 @@ TEST(test_setting_type_folder_save, value) { SettingMetaFolderSave* meta = InstantiateFolderSave(layer, "key"); meta->default_value = "${VULKAN_CONTENT}/value"; - EXPECT_STREQ("${VULKAN_CONTENT}/value", meta->Export(EXPORT_MODE_DOC).c_str()); - EXPECT_STRNE("${VULKAN_CONTENT}/value", meta->Export(EXPORT_MODE_OVERRIDE).c_str()); + EXPECT_STREQ(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), meta->Export(EXPORT_MODE_DOC).c_str()); + EXPECT_STRNE(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), meta->Export(EXPORT_MODE_OVERRIDE).c_str()); SettingDataFolderSave* data = Instantiate(meta); - EXPECT_STREQ("${VULKAN_CONTENT}/value", data->Export(EXPORT_MODE_DOC).c_str()); - EXPECT_STRNE("${VULKAN_CONTENT}/value", data->Export(EXPORT_MODE_OVERRIDE).c_str()); + EXPECT_STREQ(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), data->Export(EXPORT_MODE_DOC).c_str()); + EXPECT_STRNE(Path("${VULKAN_CONTENT}/value").RelativePath().c_str(), data->Export(EXPORT_MODE_OVERRIDE).c_str()); } diff --git a/vkconfig_core/test/test_setting_type_list.cpp b/vkconfig_core/test/test_setting_type_list.cpp index 72de85b121..2087db2149 100644 --- a/vkconfig_core/test/test_setting_type_list.cpp +++ b/vkconfig_core/test/test_setting_type_list.cpp @@ -101,3 +101,12 @@ TEST(test_setting_type_list, validation_list) { EXPECT_TRUE(!list.empty()); } + +TEST(test_setting_type_list, validation_list_no_sdk) { + qunsetenv("VULKAN_SDK"); + + std::vector list; + LoadVUIDs(list); + + EXPECT_TRUE(!list.empty()); +} diff --git a/vkconfig_core/test/test_type_hide_message.cpp b/vkconfig_core/test/test_type_hide_message.cpp new file mode 100644 index 0000000000..86714af8be --- /dev/null +++ b/vkconfig_core/test/test_type_hide_message.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "../type_hide_message.h" + +#include + +static const HideMessageBit HIDE_MESSAGE_NEED_APPLICATION_RESTART_BIT = + static_cast(1 << (HIDE_MESSAGE_NEED_APPLICATION_RESTART - HIDE_MESSAGE_FIRST)); +static const HideMessageBit HIDE_MESSAGE_USE_SYSTEM_TRAY_BIT = + static_cast(1 << (HIDE_MESSAGE_USE_SYSTEM_TRAY - HIDE_MESSAGE_FIRST)); +static const HideMessageBit HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE_BIT = + static_cast(1 << (HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE - HIDE_MESSAGE_FIRST)); + +TEST(test_type_hide_message, convert_specific_values) { + EXPECT_EQ(HIDE_MESSAGE_NEED_APPLICATION_RESTART_BIT, GetBit(HIDE_MESSAGE_NEED_APPLICATION_RESTART)); + EXPECT_EQ(HIDE_MESSAGE_NEED_APPLICATION_RESTART, GetValue(HIDE_MESSAGE_NEED_APPLICATION_RESTART_BIT)); + + EXPECT_EQ(HIDE_MESSAGE_USE_SYSTEM_TRAY_BIT, GetBit(HIDE_MESSAGE_USE_SYSTEM_TRAY)); + EXPECT_EQ(HIDE_MESSAGE_USE_SYSTEM_TRAY, GetValue(HIDE_MESSAGE_USE_SYSTEM_TRAY_BIT)); + + EXPECT_EQ(HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE_BIT, GetBit(HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE)); + EXPECT_EQ(HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE, GetValue(HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE_BIT)); +} + +TEST(test_type_hide_message, convert_invalid_value) { + EXPECT_EQ(0, GetBit(HIDE_MESSAGE_INVALID)); + EXPECT_EQ(HIDE_MESSAGE_INVALID, GetHideMessageType("UNKNOWN_VALUE")); + EXPECT_EQ(nullptr, GetToken(HIDE_MESSAGE_INVALID)); +} + +TEST(test_type_hide_message, convert_type_to_token) { + for (int i = HIDE_MESSAGE_FIRST, n = HIDE_MESSAGE_COUNT; i < n; ++i) { + const HideMessageType value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetHideMessageType(string)); + } +} + +TEST(test_type_hide_message, convert_bit_to_token) { + for (int i = HIDE_MESSAGE_FIRST, n = HIDE_MESSAGE_COUNT; i < n; ++i) { + const HideMessageBit bit = static_cast(1 << (i - HIDE_MESSAGE_FIRST)); + const char* string = GetToken(bit); + EXPECT_EQ(bit, GetHideMessageBit(string)); + } +} + +TEST(test_type_hide_message, convert_type_to_bit) { + for (int i = HIDE_MESSAGE_FIRST, n = HIDE_MESSAGE_COUNT; i < n; ++i) { + const HideMessageType type = static_cast(i); + const HideMessageBit bit = GetBit(type); + const HideMessageType back = GetValue(bit); + EXPECT_EQ(back, type); + } +} + +TEST(test_type_hide_message, convert_specific_flags) { + const std::vector TOKENS = {"NEED_APPLICATION_RESTART", "WARN_CORE_SHADER_IGNORE"}; + + HideMessageFlags flags = GetHideMessageFlags(TOKENS); + const std::vector& back = GetHideMessageTokens(flags); + + EXPECT_STREQ(TOKENS[0].c_str(), back[0].c_str()); + EXPECT_STREQ(TOKENS[1].c_str(), back[1].c_str()); +} + +TEST(test_type_hide_message, convert_all_flags_split) { + HideMessageFlags flags = 0; + for (int i = HIDE_MESSAGE_FIRST, l = HIDE_MESSAGE_LAST; i <= l; ++i) { + HideMessageType value = static_cast(i); + flags |= GetBit(value); + } + + const std::vector& tokens = GetHideMessageTokens(flags); + EXPECT_EQ(flags, GetHideMessageFlags(tokens)); +} + +TEST(test_type_hide_message, convert_all_flags_merge) { + HideMessageFlags flags = 0; + for (int i = HIDE_MESSAGE_FIRST, l = HIDE_MESSAGE_LAST; i <= l; ++i) { + HideMessageType value = static_cast(i); + flags |= GetBit(value); + } + + const std::string& string = GetHideMessageString(flags); + EXPECT_EQ(flags, GetHideMessageFlags(string)); +} + +TEST(test_type_hide_message, convert_specific_flags_merge) { + const std::string cases[] = {"NEED_APPLICATION_RESTART", "NEED_APPLICATION_RESTART,"}; + + for (std::size_t i = 0, n = std::size(cases); i < n; ++i) { + HideMessageFlags flags = GetHideMessageFlags(cases[i]); + EXPECT_EQ(flags, GetBit(HIDE_MESSAGE_NEED_APPLICATION_RESTART)); + } +} + +TEST(test_type_hide_message, convert_invalid_flags) { + const std::vector TOKENS = {"NEED_APPLICATION_RESTART", "UNKNOWN_VALUE", "WARN_CORE_SHADER_IGNORE"}; + + HideMessageFlags flags = GetHideMessageFlags(TOKENS); + const std::vector& back = GetHideMessageTokens(flags); + + EXPECT_STREQ(TOKENS[0].c_str(), back[0].c_str()); + EXPECT_STREQ(TOKENS[2].c_str(), back[1].c_str()); +} diff --git a/vkconfig_core/test/test_type_layer_control.cpp b/vkconfig_core/test/test_type_layer_control.cpp new file mode 100644 index 0000000000..fa4d930293 --- /dev/null +++ b/vkconfig_core/test/test_type_layer_control.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "../type_layer_control.h" + +#include + +TEST(test_layer_control, convert_all) { + for (int i = LAYER_CONTROL_FIRST, n = LAYER_CONTROL_COUNT; i < n; ++i) { + const LayerControl value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetLayerControl(string)); + } +} diff --git a/vkconfig_core/test/test_type_layer_type.cpp b/vkconfig_core/test/test_type_layer_type.cpp new file mode 100644 index 0000000000..67260367a0 --- /dev/null +++ b/vkconfig_core/test/test_type_layer_type.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "../type_layer_type.h" + +#include + +TEST(test_type_layer_type, convert_all) { + for (int i = LAYER_TYPE_FIRST, n = LAYER_TYPE_COUNT; i < n; ++i) { + const LayerType value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetLayerType(string)); + } +} diff --git a/vkconfig_core/test/test_type_layers_mode.cpp b/vkconfig_core/test/test_type_layers_mode.cpp new file mode 100644 index 0000000000..00e55507f3 --- /dev/null +++ b/vkconfig_core/test/test_type_layers_mode.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "../type_layers_mode.h" + +#include + +TEST(test_type_layers_mode, convert_all) { + for (int i = LAYERS_MODE_FIRST, n = LAYERS_MODE_COUNT; i < n; ++i) { + const LayersMode value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetLayersMode(string)); + } +} diff --git a/vkconfig_core/test/test_type_log.cpp b/vkconfig_core/test/test_type_log.cpp new file mode 100644 index 0000000000..f0204d17f9 --- /dev/null +++ b/vkconfig_core/test/test_type_log.cpp @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "../type_log.h" + +#include + +static const LogBit LOG_ERROR_BIT = static_cast(1 << (LOG_ERROR - LOG_FIRST)); +static const LogBit LOG_WARN_BIT = static_cast(1 << (LOG_WARN - LOG_FIRST)); +static const LogBit LOG_LAYER_BIT = static_cast(1 << (LOG_LAYER - LOG_FIRST)); + +TEST(test_type_log, convert_specific_values) { + EXPECT_EQ(LOG_ERROR_BIT, GetBit(LOG_ERROR)); + EXPECT_EQ(LOG_ERROR, GetValue(LOG_ERROR_BIT)); + + EXPECT_EQ(LOG_WARN_BIT, GetBit(LOG_WARN)); + EXPECT_EQ(LOG_WARN, GetValue(LOG_WARN_BIT)); + + EXPECT_EQ(LOG_LAYER_BIT, GetBit(LOG_LAYER)); + EXPECT_EQ(LOG_LAYER, GetValue(LOG_LAYER_BIT)); +} + +TEST(test_type_log, convert_invalid_value) { + EXPECT_EQ(0, GetBit(LOG_MESSAGE_INVALID)); + EXPECT_EQ(LOG_MESSAGE_INVALID, GetLogType("unknown")); + EXPECT_EQ(nullptr, GetToken(LOG_MESSAGE_INVALID)); +} + +TEST(test_type_log, convert_type_to_token) { + for (int i = LOG_FIRST, n = LOG_COUNT; i < n; ++i) { + const LogType value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetLogType(string)); + } +} + +TEST(test_type_log, convert_bit_to_token) { + for (int i = LOG_FIRST, n = LOG_COUNT; i < n; ++i) { + const LogBit bit = GetBit(static_cast(i)); + const char* string = GetToken(bit); + const LogBit back = GetLogBit(string); + EXPECT_EQ(bit, back); + } +} + +TEST(test_type_log, convert_type_to_bit) { + for (int i = LOG_FIRST, n = LOG_COUNT; i < n; ++i) { + const LogType type = static_cast(i); + const LogBit bit = GetBit(type); + const LogType back = GetValue(bit); + EXPECT_EQ(back, type); + } +} + +TEST(test_type_log, convert_specific_flags) { + const std::vector TOKENS = {"error", "layer"}; + + LogFlags flags = GetLogFlags(TOKENS); + const std::vector& back = GetLogTokens(flags); + + EXPECT_STREQ(TOKENS[0].c_str(), back[0].c_str()); + EXPECT_STREQ(TOKENS[1].c_str(), back[1].c_str()); +} + +TEST(test_type_log, convert_all_flags_split) { + LogFlags flags = 0; + for (int i = LOG_FIRST, l = LOG_LAST; i <= l; ++i) { + LogType value = static_cast(i); + flags |= GetBit(value); + } + + const std::vector& tokens = GetLogTokens(flags); + EXPECT_EQ(flags, GetLogFlags(tokens)); +} + +TEST(test_type_log, convert_all_flags_merge) { + LogFlags flags = 0; + for (int i = LOG_FIRST, l = LOG_LAST; i <= l; ++i) { + LogType value = static_cast(i); + flags |= GetBit(value); + } + + const std::string& string = GetLogString(flags); + EXPECT_EQ(flags, GetLogFlags(string)); +} + +TEST(test_type_log, convert_specific_flags_merge) { + const std::string cases[] = {"warn", "warn,"}; + + for (std::size_t i = 0, n = std::size(cases); i < n; ++i) { + LogFlags flags = GetLogFlags(cases[i]); + EXPECT_EQ(flags, GetBit(LOG_WARN)); + } +} + +TEST(test_type_log, convert_invalid_flags) { + const std::vector TOKENS = {"error", "unknown", "layer"}; + + LogFlags flags = GetLogFlags(TOKENS); + const std::vector& back = GetLogTokens(flags); + + EXPECT_STREQ(TOKENS[0].c_str(), back[0].c_str()); + EXPECT_STREQ(TOKENS[2].c_str(), back[1].c_str()); +} diff --git a/vkconfig_core/test/test_platform.cpp b/vkconfig_core/test/test_type_platform.cpp similarity index 93% rename from vkconfig_core/test/test_platform.cpp rename to vkconfig_core/test/test_type_platform.cpp index d0090ae7a6..01a893b7d3 100644 --- a/vkconfig_core/test/test_platform.cpp +++ b/vkconfig_core/test/test_type_platform.cpp @@ -18,7 +18,7 @@ * - Christophe Riccio */ -#include "../platform.h" +#include "../type_platform.h" #include @@ -74,8 +74,3 @@ TEST(test_platform, platform_type_android) { EXPECT_STREQ("ANDROID", GetToken(PLATFORM_ANDROID)); EXPECT_EQ(PLATFORM_ANDROID, GetPlatformType("ANDROID")); } - -TEST(test_platform, status_type) { - EXPECT_STREQ("STABLE", GetToken(STATUS_STABLE)); - EXPECT_EQ(STATUS_STABLE, GetStatusType("STABLE")); -} diff --git a/vkconfig_core/test/test_type_status.cpp b/vkconfig_core/test/test_type_status.cpp new file mode 100644 index 0000000000..06b38ad9df --- /dev/null +++ b/vkconfig_core/test/test_type_status.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "../type_status.h" + +#include + +TEST(test_type_status, convert_all) { + for (int i = STATUS_FIRST, n = STATUS_COUNT; i < n; ++i) { + const StatusType value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetStatusType(string)); + } +} diff --git a/vkconfig_core/test/test_layer_state.cpp b/vkconfig_core/test/test_type_tab.cpp similarity index 64% rename from vkconfig_core/test/test_layer_state.cpp rename to vkconfig_core/test/test_type_tab.cpp index 71788bf359..ef12714b1e 100644 --- a/vkconfig_core/test/test_layer_state.cpp +++ b/vkconfig_core/test/test_type_tab.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,14 @@ * - Christophe Riccio */ -#include "../layer_state.h" +#include "../type_tab.h" #include -TEST(test_layer_state, layer_state) { - EXPECT_STREQ("OVERRIDDEN", GetToken(LAYER_STATE_OVERRIDDEN)); - EXPECT_EQ(LAYER_STATE_OVERRIDDEN, GetLayerState("OVERRIDDEN")); +TEST(test_type_tab_type, convert_all) { + for (int i = TAB_FIRST, n = TAB_COUNT; i < n; ++i) { + const TabType value = static_cast(i); + const char* string = GetToken(value); + EXPECT_EQ(value, GetTabType(string)); + } } diff --git a/vkconfig_core/test/test_util.cpp b/vkconfig_core/test/test_util.cpp index db983541fa..24e6133548 100644 --- a/vkconfig_core/test/test_util.cpp +++ b/vkconfig_core/test/test_util.cpp @@ -19,7 +19,7 @@ */ #include "../util.h" -#include "../platform.h" +#include "../type_platform.h" #include @@ -27,59 +27,6 @@ #include -TEST(test_util, countof_int_2) { - const int test_data[]{8, 9}; - static_assert(countof(test_data) == 2, "countof for 2 ints is broken"); - - EXPECT_EQ(2, countof(test_data)); -} - -TEST(test_util, countof_int_1) { - const int test_data[]{7}; - static_assert(countof(test_data) == 1, "countof for 1 int is broken"); - - EXPECT_EQ(1, countof(test_data)); -} - -TEST(test_util, countof_cstring_3) { - const char* test_data[]{"GNI", "GNA", "GNE"}; - static_assert(countof(test_data) == 3, "countof for cstring is broken"); - - EXPECT_EQ(3, countof(test_data)); -} - -TEST(test_util, countof_string_3) { - const std::string test_data[]{"GNI", "GNA", "GNE"}; - static_assert(countof(test_data) == 3, "countof for string is broken"); - - EXPECT_EQ(3, countof(test_data)); -} - -TEST(test_util, countof_array_2) { - const std::array test_data{6, 7}; - static_assert(countof(test_data) == 2, "countof for array is broken"); - - EXPECT_EQ(2, countof(test_data)); -} - -TEST(test_util, countof_array_3) { - const std::array test_data{"GNI", "GNA", "GNE"}; - - EXPECT_EQ(3, countof(test_data)); -} - -TEST(test_util, countof_vector_2) { - const std::vector test_data{6, 7}; - - EXPECT_EQ(2, countof(test_data)); -} - -TEST(test_util, countof_vector_3) { - const std::vector test_data{"GNI", "GNA", "GNE"}; - - EXPECT_EQ(3, countof(test_data)); -} - TEST(test_util, format_int_1) { EXPECT_EQ("Test 1", format("Test %d", 1)); } TEST(test_util, format_strings_list) { diff --git a/vkconfig_core/test/test_vulkan.cpp b/vkconfig_core/test/test_vulkan.cpp index 5fd5126cbc..1cec145661 100644 --- a/vkconfig_core/test/test_vulkan.cpp +++ b/vkconfig_core/test/test_vulkan.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,4 +18,19 @@ * - Christophe Riccio */ +#include "../vulkan_util.h" + #include + +#ifndef RUN_ON_GITHUB + +TEST(test_vulkan, system_info) { + const VulkanSystemInfo& vulkan_system_info = BuildVulkanSystemInfo(); + + EXPECT_TRUE(vulkan_system_info.loaderVersion != Version::VERSION_NULL); + EXPECT_TRUE(!vulkan_system_info.instanceLayerProperties.empty()); + EXPECT_TRUE(!vulkan_system_info.instanceExtensionPropertie.empty()); + EXPECT_TRUE(!vulkan_system_info.physicalDevices.empty()); +} + +#endif // RUN_ON_GITHUB diff --git a/vkconfig_core/type_hide_message.cpp b/vkconfig_core/type_hide_message.cpp new file mode 100644 index 0000000000..b1eb6153cb --- /dev/null +++ b/vkconfig_core/type_hide_message.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_hide_message.h" +#include "bitfield.h" +#include "util.h" + +#include +#include + +const char* GetToken(HideMessageType value) { + static const char* TOKENS[]{ + "NEED_APPLICATION_RESTART", // HIDE_MESSAGE_NEED_APPLICATION_RESTART + "USE_SYSTEM_TRAY", // HIDE_MESSAGE_USE_SYSTEM_TRAY + "WIDGET_SETTING_FLOAT", // HIDE_MESSAGE_WIDGET_SETTING_FLOAT + "WIDGET_SETTING_INT", // HIDE_MESSAGE_WIDGET_SETTING_INT + "WIDGET_SETTING_FRAMES", // HIDE_MESSAGE_WIDGET_SETTING_FRAMES + "WARN_MISSING_LAYERS_IGNORE", // HIDE_MESSAGE_WARN_MISSING_LAYERS_IGNORE + "WARN_CORE_SHADER_IGNORE", // HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE + }; + static_assert(std::size(TOKENS) == HIDE_MESSAGE_COUNT); + + if (value >= HIDE_MESSAGE_FIRST && value <= HIDE_MESSAGE_LAST) { + return TOKENS[value - HIDE_MESSAGE_FIRST]; + } else { + return nullptr; + } +} + +HideMessageType GetHideMessageType(const char* token) { + for (int i = HIDE_MESSAGE_FIRST, l = HIDE_MESSAGE_LAST; i <= l; ++i) { + const HideMessageType value = static_cast(i); + if (std::strcmp(::GetToken(value), token) == 0) { + return value; + } + } + + return HIDE_MESSAGE_INVALID; +} + +const char* GetToken(HideMessageBit bit) { return GetToken(GetValue(bit)); } + +HideMessageBit GetHideMessageBit(const char* token) { + const HideMessageType value = GetHideMessageType(token); + if (value >= HIDE_MESSAGE_FIRST && value <= HIDE_MESSAGE_LAST) { + return static_cast(1 << (value - HIDE_MESSAGE_FIRST)); + } else { + return static_cast(0); + } +} + +HideMessageBit GetBit(HideMessageType value) { + if (value >= HIDE_MESSAGE_FIRST && value <= HIDE_MESSAGE_LAST) { + const int bit = GetBit(value, HIDE_MESSAGE_FIRST); + return static_cast(bit); + } else { + return static_cast(0); + } +} + +HideMessageType GetValue(HideMessageBit bit) { + const HideMessageType value = GetValue(bit, HIDE_MESSAGE_FIRST); + if (value >= HIDE_MESSAGE_FIRST && value <= HIDE_MESSAGE_LAST) { + return value; + } else { + return HIDE_MESSAGE_INVALID; + } +} + +HideMessageFlags GetHideMessageFlags(const std::vector& tokens) { + HideMessageFlags flags = 0; + + for (std::size_t i = 0, n = tokens.size(); i < n; ++i) { + const HideMessageType value = GetHideMessageType(tokens[i].c_str()); + if (value == HIDE_MESSAGE_INVALID) { + continue; + } + flags |= GetBit(value); + } + + return flags; +} + +std::vector GetHideMessageTokens(HideMessageFlags flags) { + std::vector result; + + for (std::size_t i = HIDE_MESSAGE_FIRST, l = HIDE_MESSAGE_LAST; i <= l; ++i) { + HideMessageType value = static_cast(i); + if (flags & GetBit(value)) { + result.push_back(GetToken(value)); + } + } + + return result; +} + +HideMessageFlags GetHideMessageFlags(const std::string& string) { + std::vector tokens = Split(string, ","); + return GetHideMessageFlags(tokens); +} + +std::string GetHideMessageString(HideMessageFlags flags) { + std::vector tokens = GetHideMessageTokens(flags); + return Merge(tokens, ","); +} diff --git a/vkconfig_core/type_hide_message.h b/vkconfig_core/type_hide_message.h new file mode 100644 index 0000000000..da41682a4d --- /dev/null +++ b/vkconfig_core/type_hide_message.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#pragma once + +#include +#include + +enum HideMessageType { + HIDE_MESSAGE_NEED_APPLICATION_RESTART = 0, + HIDE_MESSAGE_USE_SYSTEM_TRAY, + HIDE_MESSAGE_WIDGET_SETTING_FLOAT, + HIDE_MESSAGE_WIDGET_SETTING_INT, + HIDE_MESSAGE_WIDGET_SETTING_FRAMES, + HIDE_MESSAGE_WARN_MISSING_LAYERS_IGNORE, + HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE, + + HIDE_MESSAGE_FIRST = HIDE_MESSAGE_NEED_APPLICATION_RESTART, + HIDE_MESSAGE_LAST = HIDE_MESSAGE_WARN_CORE_SHADER_IGNORE, + + HIDE_MESSAGE_INVALID = ~0, +}; +enum { HIDE_MESSAGE_COUNT = HIDE_MESSAGE_LAST - HIDE_MESSAGE_FIRST + 1 }; + +enum HideMessageBit {}; +typedef int HideMessageFlags; + +const char* GetToken(HideMessageType value); + +HideMessageType GetHideMessageType(const char* token); + +const char* GetToken(HideMessageBit bit); + +HideMessageBit GetHideMessageBit(const char* token); + +HideMessageBit GetBit(HideMessageType type); + +HideMessageType GetValue(HideMessageBit bit); + +HideMessageFlags GetHideMessageFlags(const std::vector& tokens); + +std::vector GetHideMessageTokens(HideMessageFlags flags); + +HideMessageFlags GetHideMessageFlags(const std::string& string); + +std::string GetHideMessageString(HideMessageFlags flags); diff --git a/vkconfig_core/type_layer_control.cpp b/vkconfig_core/type_layer_control.cpp new file mode 100644 index 0000000000..1753655894 --- /dev/null +++ b/vkconfig_core/type_layer_control.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_layer_control.h" + +#include +#include + +const char* GetToken(LayerControl control) { + static const char* TOKENS[] = { + "auto", // LAYER_CONTROL_AUTO + "on", // LAYER_CONTROL_ON + "off", // LAYER_CONTROL_OFF + "application_enabled_layers", // LAYER_CONTROL_APPLICATIONS + "unordered_layer_location" // LAYER_CONTROL_UNORDERED + }; + static_assert(std::size(TOKENS) == LAYER_CONTROL_COUNT); + + return TOKENS[control]; +} + +LayerControl GetLayerControl(const char* token) { + for (int i = LAYER_CONTROL_FIRST, l = LAYER_CONTROL_LAST; i <= l; ++i) { + const LayerControl type = static_cast(i); + if (std::strcmp(::GetToken(type), token) == 0) { + return type; + } + } + + return LAYER_CONTROL_AUTO; +} diff --git a/vkconfig_core/type_layer_control.h b/vkconfig_core/type_layer_control.h new file mode 100644 index 0000000000..891fcbcfc1 --- /dev/null +++ b/vkconfig_core/type_layer_control.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#pragma once + +enum LayerControl { + LAYER_CONTROL_AUTO = 0, + LAYER_CONTROL_ON, + LAYER_CONTROL_OFF, + LAYER_CONTROL_APPLICATIONS, + LAYER_CONTROL_UNORDERED, + + LAYER_CONTROL_FIRST = LAYER_CONTROL_AUTO, + LAYER_CONTROL_LAST = LAYER_CONTROL_UNORDERED +}; + +enum { LAYER_CONTROL_COUNT = LAYER_CONTROL_LAST - LAYER_CONTROL_FIRST + 1 }; + +const char* GetToken(LayerControl control); + +LayerControl GetLayerControl(const char* token); diff --git a/vkconfig_core/type_layer_type.cpp b/vkconfig_core/type_layer_type.cpp new file mode 100644 index 0000000000..9a34437a08 --- /dev/null +++ b/vkconfig_core/type_layer_type.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_layer_type.h" + +#include +#include + +const char* GetToken(LayerType type) { + static const char* TOKENS[] = { + "Explicit", // LAYER_TYPE_EXPLICIT + "Implicit", // LAYER_TYPE_IMPLICIT + }; + static_assert(std::size(TOKENS) == LAYER_TYPE_COUNT); + + return TOKENS[type]; +} + +LayerType GetLayerType(const char* token) { + for (int i = LAYER_TYPE_FIRST, l = LAYER_TYPE_LAST; i <= l; ++i) { + const LayerType type = static_cast(i); + if (std::strcmp(::GetToken(type), token) == 0) { + return type; + } + } + + return LAYER_TYPE_EXPLICIT; +} diff --git a/vkconfig_core/layer_type.h b/vkconfig_core/type_layer_type.h similarity index 72% rename from vkconfig_core/layer_type.h rename to vkconfig_core/type_layer_type.h index 9cc959cb8c..0fbf83d8c3 100644 --- a/vkconfig_core/layer_type.h +++ b/vkconfig_core/type_layer_type.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,14 +22,15 @@ #pragma once enum LayerType { // Enum value can't be changed - LAYER_TYPE_EXPLICIT = 0, - LAYER_TYPE_IMPLICIT = 1, - LAYER_TYPE_USER_DEFINED = 2, + LAYER_TYPE_IMPLICIT = 0, + LAYER_TYPE_EXPLICIT, - LAYER_TYPE_FIRST = LAYER_TYPE_EXPLICIT, - LAYER_TYPE_LAST = LAYER_TYPE_USER_DEFINED + LAYER_TYPE_FIRST = LAYER_TYPE_IMPLICIT, + LAYER_TYPE_LAST = LAYER_TYPE_EXPLICIT }; enum { LAYER_TYPE_COUNT = LAYER_TYPE_LAST - LAYER_TYPE_FIRST + 1 }; -const char* GetLayerTypeLabel(LayerType type); +const char* GetToken(LayerType type); + +LayerType GetLayerType(const char* token); diff --git a/vkconfig_core/type_layers_mode.cpp b/vkconfig_core/type_layers_mode.cpp new file mode 100644 index 0000000000..591971a1d7 --- /dev/null +++ b/vkconfig_core/type_layers_mode.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_layers_mode.h" + +#include +#include + +const char* GetToken(LayersMode mode) { + static const char* TOKENS[] = { + "CONTROLLED_BY_APPLICATIONS", // LAYERS_MODE_BY_APPLICATIONS + "CONTROLLED_BY_CONFIGURATOR", // LAYERS_MODE_BY_CONFIGURATOR_RUNNING + "DISABLED_BY_CONFIGURATOR" // LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED + }; + static_assert(std::size(TOKENS) == LAYERS_MODE_COUNT, "The tranlation table size doesn't match the enum number of elements"); + + return TOKENS[mode]; +} + +LayersMode GetLayersMode(const char* token) { + for (int i = LAYERS_MODE_FIRST, l = LAYERS_MODE_LAST; i <= l; ++i) { + const LayersMode type = static_cast(i); + if (std::strcmp(GetToken(type), token) == 0) { + return type; + } + } + + return LAYERS_CONTROLLED_BY_APPLICATIONS; +} diff --git a/vkconfig/dialog_about.h b/vkconfig_core/type_layers_mode.h similarity index 56% rename from vkconfig/dialog_about.h rename to vkconfig_core/type_layers_mode.h index 1cf7a6e1a5..e49d39758e 100644 --- a/vkconfig/dialog_about.h +++ b/vkconfig_core/type_layers_mode.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,28 +15,22 @@ * limitations under the License. * * Authors: - * - Richard S. Wright Jr. * - Christophe Riccio */ #pragma once -#include "ui_dialog_about.h" +enum LayersMode { + LAYERS_CONTROLLED_BY_APPLICATIONS = 0, + LAYERS_CONTROLLED_BY_CONFIGURATOR, + LAYERS_DISABLED_BY_CONFIGURATOR, -#include - -class AboutDialog : public QDialog { - Q_OBJECT - - public Q_SLOTS: - void aboutQt(); + LAYERS_MODE_FIRST = LAYERS_CONTROLLED_BY_APPLICATIONS, + LAYERS_MODE_LAST = LAYERS_DISABLED_BY_CONFIGURATOR +}; - public: - explicit AboutDialog(QWidget *parent = nullptr); +enum { LAYERS_MODE_COUNT = LAYERS_MODE_LAST - LAYERS_MODE_FIRST + 1 }; - private: - AboutDialog(const AboutDialog &) = delete; - AboutDialog &operator=(const AboutDialog &) = delete; +const char* GetToken(LayersMode mode); - std::unique_ptr ui; -}; +LayersMode GetLayersMode(const char* token); diff --git a/vkconfig_core/type_log.cpp b/vkconfig_core/type_log.cpp new file mode 100644 index 0000000000..99020c10e7 --- /dev/null +++ b/vkconfig_core/type_log.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_log.h" +#include "bitfield.h" +#include "util.h" + +#include +#include + +const char* GetToken(LogType value) { + static const char* TOKENS[] = { + "error", // LOG_ERROR + "warn", // LOG_WARN + "info", // LOG_INFO + "debug", // LOG_DEBUG + "perf", // LOG_PERF + "layer", // LOG_LAYER + "implem", // LOG_IMPLEM + }; + static_assert(std::size(TOKENS) == LOG_COUNT); + + if (value >= LOG_FIRST && value <= LOG_LAST) { + return TOKENS[value - LOG_FIRST]; + } else { + return nullptr; + } +} + +LogType GetLogType(const char* token) { + for (int i = LOG_FIRST, l = LOG_LAST; i <= l; ++i) { + const LogType value = static_cast(i); + if (std::strcmp(::GetToken(value), token) == 0) { + return value; + } + } + + return LOG_MESSAGE_INVALID; +} + +const char* GetToken(LogBit bit) { return GetToken(GetValue(bit)); } + +LogBit GetLogBit(const char* token) { + const LogType value = GetLogType(token); + if (value >= LOG_FIRST && value <= LOG_LAST) { + return static_cast(1 << (value - LOG_FIRST)); + } else { + return static_cast(0); + } +} + +LogBit GetBit(LogType value) { + if (value >= LOG_FIRST && value <= LOG_LAST) { + const int bit = GetBit(value, LOG_FIRST); + return static_cast(bit); + } else { + return static_cast(0); + } +} + +LogType GetValue(LogBit bit) { + const LogType value = GetValue(bit, LOG_FIRST); + if (value >= LOG_FIRST && value <= LOG_LAST) { + return value; + } else { + return LOG_MESSAGE_INVALID; + } +} + +LogFlags GetLogFlags(const std::vector& tokens) { + LogFlags flags = 0; + + for (std::size_t i = 0, n = tokens.size(); i < n; ++i) { + LogType value = GetLogType(tokens[i].c_str()); + if (value == LOG_MESSAGE_INVALID) { + continue; + } + flags |= GetBit(value); + } + + return flags; +} + +std::vector GetLogTokens(LogFlags flags) { + std::vector result; + + for (int i = LOG_FIRST, l = LOG_LAST; i <= l; ++i) { + LogType value = static_cast(i); + if (flags & GetBit(value)) { + result.push_back(GetToken(value)); + } + } + + return result; +} + +LogFlags GetLogFlags(const std::string& string) { + const std::vector& tokens = Split(string, ","); + return GetLogFlags(tokens); +} + +std::string GetLogString(LogFlags flags) { + const std::vector& tokens = GetLogTokens(flags); + return Merge(tokens, ","); +} diff --git a/vkconfig_core/type_log.h b/vkconfig_core/type_log.h new file mode 100644 index 0000000000..ec413d0d6e --- /dev/null +++ b/vkconfig_core/type_log.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#pragma once + +#include +#include + +enum LogType { + LOG_NONE = 0, + LOG_ERROR, + LOG_WARN, + LOG_INFO, + LOG_DEBUG, + LOG_PERF, + LOG_LAYER, + LOG_IMPLEM, + + LOG_FIRST = LOG_ERROR, + LOG_LAST = LOG_IMPLEM, + + LOG_MESSAGE_INVALID = ~0, +}; +enum { LOG_COUNT = LOG_LAST - LOG_FIRST + 1 }; + +enum LogBit {}; +typedef int LogFlags; + +const char* GetToken(LogType value); + +LogType GetLogType(const char* token); + +const char* GetToken(LogBit bit); + +LogBit GetLogBit(const char* token); + +LogBit GetBit(LogType type); + +LogType GetValue(LogBit bit); + +LogFlags GetLogFlags(const std::vector& tokens); + +std::vector GetLogTokens(LogFlags flags); + +LogFlags GetLogFlags(const std::string& string); + +std::string GetLogString(LogFlags flags); diff --git a/vkconfig_core/platform.cpp b/vkconfig_core/type_platform.cpp similarity index 68% rename from vkconfig_core/platform.cpp rename to vkconfig_core/type_platform.cpp index 571b7480a7..fb49df030f 100644 --- a/vkconfig_core/platform.cpp +++ b/vkconfig_core/type_platform.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,11 @@ * - Christophe Riccio */ -#include "platform.h" #include "path.h" #include "util.h" +#include "type_platform.h" +#include #include #include #include @@ -58,7 +59,7 @@ const char* GetToken(PlatformType type) { "MACOS", // PLATFORM_MACOS "ANDROID", // PLATFORM_ANDROID }; - static_assert(countof(table) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); + static_assert(std::size(table) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); return table[type]; } @@ -73,26 +74,4 @@ PlatformType GetPlatformType(const char* token) { return static_cast(-1); } -const char* GetToken(StatusType type) { - static const char* table[] = { - "STABLE", // STATUS_STABLE - "BETA", // STATUS_BETA - "ALPHA", // STATUS_ALPHA - "DEPRECATED" // STATUS_ALPHA - }; - static_assert(countof(table) == STATUS_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - return table[type]; -} - -StatusType GetStatusType(const char* token) { - for (std::size_t i = 0, n = STATUS_COUNT; i < n; ++i) { - const StatusType status_type = static_cast(i); - if (std::strcmp(GetToken(status_type), token) == 0) return status_type; - } - - assert(0); - return static_cast(-1); -} - bool IsPlatformSupported(int platform_flags) { return platform_flags & (1 << VKC_PLATFORM); } diff --git a/vkconfig_core/platform.h b/vkconfig_core/type_platform.h similarity index 85% rename from vkconfig_core/platform.h rename to vkconfig_core/type_platform.h index 39aebec4c7..6d0ec0105e 100644 --- a/vkconfig_core/platform.h +++ b/vkconfig_core/type_platform.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,21 +69,6 @@ std::vector GetPlatformTokens(int platform_flags); PlatformType GetPlatformType(const char* token); const char* GetToken(PlatformType type); -enum StatusType { - STATUS_STABLE = 0, - STATUS_BETA, - STATUS_ALPHA, - STATUS_DEPRECATED, - - STATUS_FIRST = STATUS_STABLE, - STATUS_LAST = STATUS_DEPRECATED -}; - -enum { STATUS_COUNT = STATUS_LAST - STATUS_FIRST + 1 }; - -const char* GetToken(StatusType type); -StatusType GetStatusType(const char* token); - #ifdef _WIN32 #define VKC_PLATFORM VKC_PLATFORM_WINDOWS #define VKC_ENV VKC_ENV_WIN32 diff --git a/vkconfig_core/type_status.cpp b/vkconfig_core/type_status.cpp new file mode 100644 index 0000000000..dd2ac45823 --- /dev/null +++ b/vkconfig_core/type_status.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_status.h" + +#include +#include + +const char* GetToken(StatusType value) { + static const char* TOKENS[] = { + "STABLE", // STATUS_STABLE + "BETA", // STATUS_BETA + "ALPHA", // STATUS_ALPHA + "DEPRECATED" // STATUS_ALPHA + }; + static_assert(std::size(TOKENS) == STATUS_COUNT, "The tranlation table size doesn't match the enum number of elements"); + + if (value >= STATUS_FIRST && value <= STATUS_LAST) { + return TOKENS[value - STATUS_FIRST]; + } else { + return nullptr; + } +} + +StatusType GetStatusType(const char* token) { + for (std::size_t i = 0, n = STATUS_COUNT; i < n; ++i) { + const StatusType value = static_cast(i); + if (std::strcmp(::GetToken(value), token) == 0) { + return value; + } + } + + return STATUS_INVALID; +} diff --git a/vkconfig3/vulkan_util.h b/vkconfig_core/type_status.h similarity index 60% rename from vkconfig3/vulkan_util.h rename to vkconfig_core/type_status.h index aefd6f68aa..f614d2b3fe 100644 --- a/vkconfig3/vulkan_util.h +++ b/vkconfig_core/type_status.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,15 +20,20 @@ #pragma once -#include "../vkconfig_core/version.h" +enum StatusType { + STATUS_STABLE = 0, + STATUS_BETA, + STATUS_ALPHA, + STATUS_DEPRECATED, -#include + STATUS_FIRST = STATUS_STABLE, + STATUS_LAST = STATUS_DEPRECATED, -#include + STATUS_INVALID +}; -#include +enum { STATUS_COUNT = STATUS_LAST - STATUS_FIRST + 1 }; -Version GetVulkanLoaderVersion(); -std::string GenerateVulkanStatus(); -const char *GetVulkanLibrary(); -VkResult CreateInstance(QLibrary &library, VkInstance &instance, bool enumerate_portability); +const char* GetToken(StatusType type); + +StatusType GetStatusType(const char* token); diff --git a/vkconfig_core/type_tab.cpp b/vkconfig_core/type_tab.cpp new file mode 100644 index 0000000000..82df19a0a1 --- /dev/null +++ b/vkconfig_core/type_tab.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "type_tab.h" + +#include +#include + +const char* GetToken(TabType type) { + static const char* TOKENS[]{ + "DIAGNOSTIC", // TAB_DIAGNOSTIC + "APPLICATIONS", // TAB_APPLICATIONS + "LAYERS", // TAB_LAYERS + "CONFIGURATIONS", // TAB_CONFIGURATIONS + "PREFERENCES", // TAB_PREFERENCES + "HELP" // TAB_HELP + }; + + static_assert(std::size(TOKENS) == TAB_COUNT, "The tranlation table size doesn't match the enum number of elements"); + + return TOKENS[type - TAB_FIRST]; +} + +TabType GetTabType(const char* token) { + for (int i = TAB_FIRST, n = TAB_LAST; i <= n; ++i) { + const TabType type = static_cast(i); + if (std::strcmp(::GetToken(type), token) == 0) { + return type; + } + } + + return TAB_DIAGNOSTIC; +} diff --git a/vkconfig3/combo_box.h b/vkconfig_core/type_tab.h similarity index 61% rename from vkconfig3/combo_box.h rename to vkconfig_core/type_tab.h index 828ae3d671..b1bb250674 100644 --- a/vkconfig3/combo_box.h +++ b/vkconfig_core/type_tab.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,15 +20,20 @@ #pragma once -#include -#include +enum TabType { + TAB_DIAGNOSTIC = 0, + TAB_APPLICATIONS, + TAB_LAYERS, + TAB_CONFIGURATIONS, + TAB_PREFERENCES, + TAB_HELP, -class ComboBox : public QComboBox { - public: - ComboBox(QWidget* widget) : QComboBox(widget) {} - - void wheelEvent(QWheelEvent* e) override { - (void)e; - return; - } + TAB_FIRST = TAB_DIAGNOSTIC, + TAB_LAST = TAB_HELP }; + +enum { TAB_COUNT = TAB_LAST - TAB_FIRST + 1 }; + +const char* GetToken(TabType type); + +TabType GetTabType(const char* token); diff --git a/vkconfig_core/test/test_layer_type.cpp b/vkconfig_core/type_update.cpp similarity index 84% rename from vkconfig_core/test/test_layer_type.cpp rename to vkconfig_core/type_update.cpp index 0fe0b03d6c..572d5cf9c9 100644 --- a/vkconfig_core/test/test_layer_type.cpp +++ b/vkconfig_core/type_update.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,3 +17,5 @@ * Authors: * - Christophe Riccio */ + +#include "type_update.h" diff --git a/vkconfig/vulkan_util.h b/vkconfig_core/type_update.h similarity index 70% rename from vkconfig/vulkan_util.h rename to vkconfig_core/type_update.h index f2a58e593a..8fc9f6ce7f 100644 --- a/vkconfig/vulkan_util.h +++ b/vkconfig_core/type_update.h @@ -20,15 +20,9 @@ #pragma once -#include "../vkconfig_core/version.h" - -#include - -#include - -#include - -Version GetVulkanLoaderVersion(); -std::string GenerateVulkanStatus(); -const char *GetVulkanLibrary(); -VkResult CreateInstance(QLibrary &library, VkInstance &instance, bool enumerate_portability); +enum UpdateBits { + UPDATE_NONE = 0, + UPDATE_LOADER_SETTINGS_BIT = (1 << 0), + UPDATE_LAYERS_SETTINGS_BIT = (1 << 1), + UPDATE_ALL = UPDATE_LOADER_SETTINGS_BIT | UPDATE_LAYERS_SETTINGS_BIT +}; diff --git a/vkconfig_core/util.cpp b/vkconfig_core/util.cpp index d0f2d45e07..6679392b77 100644 --- a/vkconfig_core/util.cpp +++ b/vkconfig_core/util.cpp @@ -20,7 +20,10 @@ */ #include "util.h" -#include "platform.h" +#include "type_platform.h" + +#include +#include #include #include @@ -28,9 +31,6 @@ #include #include -#include -#include - #include #include diff --git a/vkconfig_core/util.h b/vkconfig_core/util.h index c08763a85e..5e94840cd5 100644 --- a/vkconfig_core/util.h +++ b/vkconfig_core/util.h @@ -35,23 +35,6 @@ #include #include -// Based on https://www.g-truc.net/post-0708.html#menu -template -inline constexpr std::size_t countof(T const (&)[N]) noexcept { - return N; -} - -template -inline constexpr std::size_t countof(std::array const& data) noexcept { - return data.size(); -} - -// For C++ container -template class C> -inline constexpr std::size_t countof(C const& data) noexcept { - return data.size(); -} - std::string format(const char* message, ...); bool IsFrames(const std::string& s); @@ -165,3 +148,10 @@ bool IsValueFound(const std::vector& list, const NumberOr QStringList ConvertValues(const std::vector& values); std::string GetLayerSettingPrefix(const std::string& key); + +template +std::vector GetVector(const T& value) { + std::vector result; + result.push_back(value); + return result; +} diff --git a/vkconfig_core/version.cpp b/vkconfig_core/version.cpp index d2ccb8d1f3..9326cfd176 100644 --- a/vkconfig_core/version.cpp +++ b/vkconfig_core/version.cpp @@ -28,9 +28,7 @@ #include #include -const Version Version::VKCONFIG(2, 6, 1); -const Version Version::VKCONFIG3(3, 0, 0); -const Version Version::LAYER_CONFIG(2, 2, 3); +const Version Version::VKCONFIG(3, 0, 0); const Version Version::VKHEADER(VK_HEADER_VERSION_COMPLETE); const Version Version::VERSION_NULL(0u); diff --git a/vkconfig_core/version.h b/vkconfig_core/version.h index b0e739349f..9fe42287a2 100644 --- a/vkconfig_core/version.h +++ b/vkconfig_core/version.h @@ -25,18 +25,14 @@ #include #include -#define SUPPORT_LAYER_CONFIG_2_2_0 1 - extern const char *VKCONFIG_NAME; extern const char *VKCONFIG_SHORT_NAME; class Version { public: static const Version VKCONFIG; - static const Version VKCONFIG3; static const Version VKHEADER; static const Version VERSION_NULL; - static const Version LAYER_CONFIG; explicit Version() : _major(0), _minor(0), _patch(0) {} explicit Version(uint32_t version_complete); diff --git a/vkconfig/vulkan_util.cpp b/vkconfig_core/vulkan_info.cpp similarity index 60% rename from vkconfig/vulkan_util.cpp rename to vkconfig_core/vulkan_info.cpp index 6347727a6c..97f11feb64 100644 --- a/vkconfig/vulkan_util.cpp +++ b/vkconfig_core/vulkan_info.cpp @@ -18,135 +18,23 @@ * - Christophe Riccio */ -#include "vulkan_util.h" -#include "configurator.h" - -#include "../vkconfig_core/alert.h" -#include "../vkconfig_core/util.h" -#include "../vkconfig_core/platform.h" -#include "../vkconfig_core/override.h" - -#include - -#include -#include - -#include - -const char *GetVulkanLibrary() { - static const char *TABLE[] = { - "vulkan-1.dll", // PLATFORM_WINDOWS - "libvulkan", // PLATFORM_LINUX - "/usr/local/lib/libvulkan", // PLATFORM_MACOS - "N/A", // PLATFORM_ANDROID - }; - static_assert(countof(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); - - return TABLE[VKC_PLATFORM]; -} - -std::string GetUUIDString(const uint8_t deviceUUID[VK_UUID_SIZE]) { - std::string result; - - for (std::size_t i = 0, n = VK_UUID_SIZE; i < n; ++i) { - result += format("%02X", deviceUUID[i]); - } - - return result; -} - -Version GetVulkanLoaderVersion() { - // Check loader version - QLibrary library(GetVulkanLibrary()); - - if (!library.load()) return Version::VERSION_NULL; - - PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion; - vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion)library.resolve("vkEnumerateInstanceVersion"); - assert(vkEnumerateInstanceVersion); - - uint32_t version = 0; - const VkResult result = vkEnumerateInstanceVersion(&version); - assert(result == VK_SUCCESS); - - return Version(version); -} - +#include "vulkan_info.h" +/* static std::string GetUserDefinedLayersPathsLog(const char *label, UserDefinedLayersPaths custom_layer_path) { std::string log; - const std::vector &user_defined_layer_paths = + const std::vector &user_defined_layer_paths = Configurator::Get().environment.GetUserDefinedLayersPaths(custom_layer_path); if (!user_defined_layer_paths.empty()) { log += format(" - %s:\n", label); for (std::size_t i = 0, n = user_defined_layer_paths.size(); i < n; ++i) - log += format(" - %s\n", user_defined_layer_paths[i].c_str()); + log += format(" - %s\n", user_defined_layer_paths[i].AbsolutePath().c_str()); } else log += format(" - %s: None\n", label); return log; } -VkResult CreateInstance(QLibrary &library, VkInstance &instance, bool enumerate_portability) { - PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties = - (PFN_vkEnumerateInstanceExtensionProperties)library.resolve("vkEnumerateInstanceExtensionProperties"); - assert(vkEnumerateInstanceExtensionProperties); - - uint32_t property_count = 0; - VkResult err = vkEnumerateInstanceExtensionProperties(nullptr, &property_count, nullptr); - assert(err == VK_SUCCESS); - - std::vector instance_properties(property_count); - err = vkEnumerateInstanceExtensionProperties(nullptr, &property_count, &instance_properties[0]); - assert(err == VK_SUCCESS); - - // Handle Portability Enumeration requirements - std::vector instance_extensions; - - for (std::size_t i = 0, n = instance_properties.size(); i < n; ++i) { - if (instance_properties[i].extensionName == std::string(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) { - instance_extensions.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); - } -#if VK_KHR_portability_enumeration - if (enumerate_portability) { - if (instance_properties[i].extensionName == std::string(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME)) { - instance_extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); - } - } -#endif - } - - // Check Vulkan Devices - - VkApplicationInfo app = {}; - app.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; - app.pNext = nullptr; - app.pApplicationName = VKCONFIG_SHORT_NAME; - app.applicationVersion = 0; - app.pEngineName = VKCONFIG_SHORT_NAME; - app.engineVersion = 0; - app.apiVersion = VK_API_VERSION_1_1; - - VkInstanceCreateInfo inst_info = {}; - inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; -#if VK_KHR_portability_enumeration - if (enumerate_portability) { - inst_info.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; - } -#endif - inst_info.pNext = nullptr; - inst_info.pApplicationInfo = &app; - inst_info.enabledLayerCount = 0; - inst_info.ppEnabledLayerNames = nullptr; - inst_info.enabledExtensionCount = static_cast(instance_extensions.size()); - inst_info.ppEnabledExtensionNames = instance_extensions.empty() ? nullptr : &instance_extensions[0]; - - PFN_vkCreateInstance vkCreateInstance = (PFN_vkCreateInstance)library.resolve("vkCreateInstance"); - assert(vkCreateInstance); - - return vkCreateInstance(&inst_info, nullptr, &instance); -} - std::string GenerateVulkanStatus() { std::string log; @@ -155,10 +43,10 @@ std::string GenerateVulkanStatus() { // Layers override configuration switch (configurator.environment.GetMode()) { default: - case LAYERS_MODE_BY_APPLICATIONS: + case LAYERS_CONTROLLED_BY_APPLICATIONS: log += "- Vulkan Layers Controlled by Vulkan Applications\n"; break; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: + case LAYERS_CONTROLLED_BY_CONFIGURATOR: if (configurator.configurations.HasActiveConfiguration(configurator.layers.selected_layers)) { log += format("- Vulkan Layers Controlled by \"%s\" configuration\n", configurator.environment.GetSelectedConfiguration().c_str()); @@ -167,7 +55,7 @@ std::string GenerateVulkanStatus() { configurator.environment.GetSelectedConfiguration().c_str()); } break; - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: + case LAYERS_DISABLED_BY_CONFIGURATOR: log += "- Vulkan Layers Disabled by Vulkan Configurator\n"; break; } @@ -175,16 +63,14 @@ std::string GenerateVulkanStatus() { log += "- Environment variables:\n"; // Check Vulkan SDK path - const std::string vk_sdk_path(qgetenv("VULKAN_SDK")); - if (!vk_sdk_path.empty()) - log += format(" - VULKAN_SDK: %s\n", vk_sdk_path.c_str()); + if (Get(Path::SDK).Empty()) + log += " - ${VULKAN_SDK} not set\n"; else - log += " - VULKAN_SDK not set\n"; + log += format(" - ${VULKAN_SDK}: %s\n", AbsolutePath(Path::SDK).c_str()); - // Check VK_LOCAL path - const std::string vk_local_path(GetPath(BUILTIN_PATH_LOCAL)); - if (!vk_local_path.empty()) { - log += format(" - VK_LOCAL: %s\n", vk_local_path.c_str()); + // Check VK_HOME path + if (!Get(Path::HOME).Empty()) { + log += format(" - ${VK_HOME}: %s\n", AbsolutePath(Path::HOME).c_str()); } const Version loader_version = GetVulkanLoaderVersion(); @@ -196,39 +82,43 @@ std::string GenerateVulkanStatus() { return log; } else { log += format("- Vulkan Loader version: %s\n", loader_version.str().c_str()); - const int loader_message_types = configurator.environment.GetLoaderMessageTypes(); - if (loader_message_types != LOADER_MESSAGE_NONE) { - log += format(" - VK_LOADER_DEBUG=%s\n", GetLoaderMessageTokens(loader_message_types).c_str()); + const LogFlags log_flags = configurator.environment.GetLoaderMessageFlags(); + if (log_flags != 0) { + log += format(" - ${VK_LOADER_DEBUG}=%s\n", GetLogString(log_flags).c_str()); } } log += "- User-Defined Layers locations:\n"; - log += GetUserDefinedLayersPathsLog("VK_LAYER_PATH variable", USER_DEFINED_LAYERS_PATHS_ENV_SET); + log += GetUserDefinedLayersPathsLog("${VK_LAYER_PATH} variable", USER_DEFINED_LAYERS_PATHS_ENV_SET); log += GetUserDefinedLayersPathsLog("Per-configuration paths", USER_DEFINED_LAYERS_PATHS_GUI); - log += GetUserDefinedLayersPathsLog("VK_ADD_LAYER_PATH variable", USER_DEFINED_LAYERS_PATHS_ENV_ADD); + log += GetUserDefinedLayersPathsLog("${VK_ADD_LAYER_PATH} variable", USER_DEFINED_LAYERS_PATHS_ENV_ADD); - const std::string layer_settings_path(qgetenv("VK_LAYER_SETTINGS_PATH")); - if (!layer_settings_path.empty()) { + // vk_layer_settings.txt + const Path layer_settings_path(qgetenv("VK_LAYER_SETTINGS_PATH").toStdString()); + if (!layer_settings_path.Empty()) { log += "- `vk_layer_settings.txt` location overridden by VK_LAYER_SETTINGS_PATH:\n"; - if (layer_settings_path.find("vk_layer_settings.txt") == std::string::npos) { - log += format(" %s\n", layer_settings_path.c_str()); + if (layer_settings_path.RelativePath().find("vk_layer_settings.txt") == std::string::npos) { + log += format(" %s\n", layer_settings_path.RelativePath().c_str()); } else { - log += format(" %s\n", ExtractAbsoluteDir(layer_settings_path).c_str()); + log += format(" %s\n", layer_settings_path.AbsoluteDir().c_str()); } } else { - const std::string path = GetPath(BUILTIN_PATH_OVERRIDE_SETTINGS); log += "- `vk_layer_settings.txt` uses the default platform path:\n"; - log += format(" %s\n", ExtractAbsoluteDir(path).c_str()); + log += format(" %s\n", AbsolutePath(Path::LAYERS_SETTINGS).c_str()); } + // vk_loader_settings.json + log += "- `vk_loader_settings.json` uses the default platform path:\n"; + log += format(" %s\n", AbsolutePath(Path::LOADER_SETTINGS).c_str()); + // If there is no Vulkan loader installed, we can't call any Vulkan API. if (loader_version == Version::VERSION_NULL) { return log; } LayersMode saved_mode = configurator.environment.GetMode(); - configurator.environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.environment.SetMode(LAYERS_CONTROLLED_BY_APPLICATIONS); + configurator.Configure(configurator.layers.selected_layers); QLibrary library(GetVulkanLibrary()); PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties = @@ -367,7 +257,8 @@ std::string GenerateVulkanStatus() { vkDestroyInstance(inst, NULL); configurator.environment.SetMode(saved_mode); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.Configure(configurator.layers.selected_layers); return log; } +*/ diff --git a/vkconfig_core/vulkan_info.h b/vkconfig_core/vulkan_info.h new file mode 100644 index 0000000000..8578e795c5 --- /dev/null +++ b/vkconfig_core/vulkan_info.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#pragma once + +#include "version.h" + +#include + +#include + +struct VulkanPhysicalDeviceInfo { + std::string deviceName; + std::string deviceUUID; + std::string driverUUID; + Version apiVersion; +}; + +struct VulkanSystemInfo { + Version loaderVersion; + std::vector instanceLayerProperties; + std::vector instanceExtensionPropertie; + std::vector physicalDevices; +}; diff --git a/vkconfig_core/vulkan_util.cpp b/vkconfig_core/vulkan_util.cpp new file mode 100644 index 0000000000..e9309e6573 --- /dev/null +++ b/vkconfig_core/vulkan_util.cpp @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authors: + * - Christophe Riccio + */ + +#include "vulkan_util.h" + +#include "../vkconfig_core/version.h" +#include "../vkconfig_core/type_platform.h" +#include "../vkconfig_core/util.h" + +#include + +#include + +static std::string GetUUIDString(const uint8_t deviceUUID[VK_UUID_SIZE]) { + std::string result; + + for (std::size_t i = 0, n = VK_UUID_SIZE; i < n; ++i) { + result += format("%02X", deviceUUID[i]); + } + + return result; +} + +struct VulkanFunctions { + VulkanFunctions(); + bool Validate() const; + + PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion; + PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties; + PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; + PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; + PFN_vkCreateInstance CreateInstance; + PFN_vkDestroyInstance DestroyInstance; + PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2; +}; + +static const char *GetVulkanLibrary() { + static const char *TABLE[] = { + "vulkan-1.dll", // PLATFORM_WINDOWS + "libvulkan", // PLATFORM_LINUX + "/usr/local/lib/libvulkan", // PLATFORM_MACOS + "N/A", // PLATFORM_ANDROID + }; + static_assert(std::size(TABLE) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); + + return TABLE[VKC_PLATFORM]; +} + +VulkanFunctions::VulkanFunctions() { + QLibrary library(GetVulkanLibrary()); + if (!library.load()) { + return; + } + + this->EnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion)library.resolve("vkEnumerateInstanceVersion"); + this->EnumerateInstanceLayerProperties = + (PFN_vkEnumerateInstanceLayerProperties)library.resolve("vkEnumerateInstanceLayerProperties"); + this->EnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices)library.resolve("vkEnumeratePhysicalDevices"); + this->EnumerateInstanceExtensionProperties = + (PFN_vkEnumerateInstanceExtensionProperties)library.resolve("vkEnumerateInstanceExtensionProperties"); + this->CreateInstance = (PFN_vkCreateInstance)library.resolve("vkCreateInstance"); + this->DestroyInstance = (PFN_vkDestroyInstance)library.resolve("vkDestroyInstance"); + this->GetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2)library.resolve("vkGetPhysicalDeviceProperties2"); +} + +bool VulkanFunctions::Validate() const { + return this->EnumerateInstanceVersion != nullptr && this->EnumerateInstanceLayerProperties != nullptr && + this->EnumeratePhysicalDevices != nullptr && this->EnumerateInstanceExtensionProperties != nullptr && + this->CreateInstance != nullptr && this->DestroyInstance != nullptr && this->GetPhysicalDeviceProperties2 != nullptr; +} + +VulkanSystemInfo BuildVulkanSystemInfo() { + VulkanSystemInfo vulkan_system_info; + + VulkanFunctions vk; + if (!vk.Validate()) { + return vulkan_system_info; + } + + uint32_t api_version = 0; + VkResult result = vk.EnumerateInstanceVersion(&api_version); + vulkan_system_info.loaderVersion = Version(api_version); + assert(result == VK_SUCCESS); + + std::uint32_t instance_layer_count = 0; + result = vk.EnumerateInstanceLayerProperties(&instance_layer_count, nullptr); + assert(result == VK_SUCCESS); + vulkan_system_info.instanceLayerProperties.resize(instance_layer_count); + result = vk.EnumerateInstanceLayerProperties(&instance_layer_count, vulkan_system_info.instanceLayerProperties.data()); + assert(result == VK_SUCCESS); + + uint32_t instance_extension_count = 0; + result = vk.EnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, nullptr); + assert(result == VK_SUCCESS); + vulkan_system_info.instanceExtensionPropertie.resize(instance_extension_count); + result = vk.EnumerateInstanceExtensionProperties(nullptr, &instance_extension_count, + vulkan_system_info.instanceExtensionPropertie.data()); + assert(result == VK_SUCCESS); + + // Handle Portability Enumeration requirements + std::vector instance_extensions; +#if VK_KHR_portability_enumeration + for (std::size_t i = 0, n = vulkan_system_info.instanceExtensionPropertie.size(); i < n; ++i) { + if (vulkan_system_info.instanceExtensionPropertie[i].extensionName == + std::string(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME)) { + instance_extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); + } + } +#endif + + VkApplicationInfo app = {}; + app.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; + app.pNext = nullptr; + app.pApplicationName = VKCONFIG_SHORT_NAME; + app.applicationVersion = 0; + app.pEngineName = VKCONFIG_SHORT_NAME; + app.engineVersion = 0; + app.apiVersion = VK_API_VERSION_1_1; + + VkInstanceCreateInfo inst_info = {}; + inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; +#if VK_KHR_portability_enumeration + if (!instance_extensions.empty()) { + inst_info.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; + } +#endif + inst_info.pNext = nullptr; + inst_info.pApplicationInfo = &app; + inst_info.enabledLayerCount = 0; + inst_info.ppEnabledLayerNames = nullptr; + inst_info.enabledExtensionCount = static_cast(instance_extensions.size()); + inst_info.ppEnabledExtensionNames = instance_extensions.empty() ? nullptr : &instance_extensions[0]; + + VkInstance instance = VK_NULL_HANDLE; + vk.CreateInstance(&inst_info, nullptr, &instance); + + uint32_t physical_device_count = 0; + result = vk.EnumeratePhysicalDevices(instance, &physical_device_count, nullptr); + + // This can fail on a new Linux setup. Check and fail gracefully rather than crash. + if (result != VK_SUCCESS) { + vk.DestroyInstance(instance, NULL); + return vulkan_system_info; + } + + std::vector devices; + devices.resize(physical_device_count); + result = vk.EnumeratePhysicalDevices(instance, &physical_device_count, devices.data()); + assert(result == VK_SUCCESS); + + vulkan_system_info.physicalDevices.resize(devices.size()); + + for (std::size_t i = 0, n = devices.size(); i < n; ++i) { + VulkanPhysicalDeviceInfo &device_info = vulkan_system_info.physicalDevices[i]; + + VkPhysicalDeviceIDPropertiesKHR properties_deviceid{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR, nullptr}; + VkPhysicalDeviceProperties2 properties2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, &properties_deviceid}; + + vk.GetPhysicalDeviceProperties2(devices[i], &properties2); + + device_info.deviceName = properties2.properties.deviceName; + device_info.apiVersion = Version(properties2.properties.apiVersion); + device_info.deviceUUID = GetUUIDString(properties_deviceid.deviceUUID); + device_info.driverUUID = GetUUIDString(properties_deviceid.driverUUID); + } + + vk.DestroyInstance(instance, NULL); + + return vulkan_system_info; +} diff --git a/vkconfig/main_layers.h b/vkconfig_core/vulkan_util.h similarity index 78% rename from vkconfig/main_layers.h rename to vkconfig_core/vulkan_util.h index a4528437b6..f4f34cbfd3 100644 --- a/vkconfig/main_layers.h +++ b/vkconfig_core/vulkan_util.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,6 @@ #pragma once -#include "../vkconfig_core/command_line.h" +#include "../vkconfig_core/vulkan_info.h" -int run_layers(const CommandLine& command_line); +VulkanSystemInfo BuildVulkanSystemInfo(); diff --git a/vkconfig/CHANGELOG.md b/vkconfig_gui/CHANGELOG.md similarity index 96% rename from vkconfig/CHANGELOG.md rename to vkconfig_gui/CHANGELOG.md index 46df0731e1..1fa6cd1eb7 100644 --- a/vkconfig/CHANGELOG.md +++ b/vkconfig_gui/CHANGELOG.md @@ -1,6 +1,6 @@

      LunarG

      -

      Copyright � 2015-2024 LunarG, Inc.

      +

      Copyright � 2015-2022 LunarG, Inc.

      [![Creative Commons][3]][4] @@ -11,13 +11,18 @@ # Release notes -## [Vulkan Configurator 2.6.1](https://github.com/LunarG/VulkanTools/tree/main) - July 2024 +## [Vulkan Configurator 3.0.0](https://github.com/LunarG/VulkanTools/tree/main) - ??? 2024 ### Features: -- Add Crash Diagnostic layer built-in configuration - -### Fixes: -- Fix system configuration not being update when toggling layers configuration modes #2046 +- Redesign main window UI around tabs +- Per-Application layers configurations +- Full ordering of Vulkan layers +- Split GUI and command line tool + +### Deprecation: +- Requires Vulkan Loader 1.3.261 or newer on Linux and macOS +- Requires Vulkan Loader 1.3.284 or newer on Windows. +- Highly recommand Validation layer 1.3.250 or newer. ## [Vulkan Configurator 2.6.0](https://github.com/LunarG/VulkanTools/tree/vulkan-sdk-1.3.283.0) - May 2024 diff --git a/vkconfig3/CMakeLists.txt b/vkconfig_gui/CMakeLists.txt similarity index 81% rename from vkconfig3/CMakeLists.txt rename to vkconfig_gui/CMakeLists.txt index 6ccefe12d8..8c4777808e 100644 --- a/vkconfig3/CMakeLists.txt +++ b/vkconfig_gui/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -6,9 +6,9 @@ set(CMAKE_AUTOUIC ON) find_package(Qt5 COMPONENTS Core Gui Widgets Network QUIET) if(NOT Qt5_FOUND) - message("WARNING: vkconfig3 will be excluded because Qt5 was not found. Please add Qt5 into the PATH environment variable") + message("WARNING: vkconfig will be excluded because Qt5 was not found. Please add Qt5 into the PATH environment variable") elseif(Qt5_VERSION VERSION_LESS 5.5) - message("WARNING: vkconfig3 will be excluded because the found Qt version is too old. vkconfig requires version 5.5.") + message("WARNING: vkconfig will be excluded because the found Qt version is too old. vkconfig requires version 5.5.") else() file(GLOB FILES_UI ./*.ui) @@ -36,7 +36,7 @@ else() add_executable(vkconfig-gui ${FILES_ALL} ${FILES_UI}) endif() - target_link_libraries(vkconfig-gui Vulkan::Headers vkconfig_core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) + target_link_libraries(vkconfig-gui Vulkan::Headers vkconfig-core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) target_compile_definitions(vkconfig-gui PRIVATE QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT) set_target_properties(vkconfig-gui PROPERTIES FOLDER "vkconfig") @@ -47,8 +47,8 @@ else() get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY) find_program(WINDEPLOYQT_EXE windeployqt HINTS "${QT_BIN_DIR}") - message("Will run ${WINDEPLOYQT_EXE} at ${CMAKE_INSTALL_FULL_BINDIR}/vkconfig3.exe") - install(CODE "execute_process(COMMAND ${WINDEPLOYQT_EXE} ${CMAKE_INSTALL_FULL_BINDIR}/vkconfig3.exe)") + message("Will run ${WINDEPLOYQT_EXE} at ${CMAKE_INSTALL_FULL_BINDIR}/vkconfig-gui.exe") + install(CODE "execute_process(COMMAND ${WINDEPLOYQT_EXE} ${CMAKE_INSTALL_FULL_BINDIR}/vkconfig-gui.exe)") endif() else() include(macOS/vkconfig.cmake) diff --git a/vkconfig/CONTRIBUTING.md b/vkconfig_gui/CONTRIBUTING.md similarity index 100% rename from vkconfig/CONTRIBUTING.md rename to vkconfig_gui/CONTRIBUTING.md diff --git a/vkconfig3/README.md b/vkconfig_gui/README.md similarity index 100% rename from vkconfig3/README.md rename to vkconfig_gui/README.md diff --git a/vkconfig/combo_box.h b/vkconfig_gui/combo_box.h similarity index 100% rename from vkconfig/combo_box.h rename to vkconfig_gui/combo_box.h diff --git a/vkconfig3/dialog_vulkan_analysis.cpp b/vkconfig_gui/dialog_vulkan_analysis.cpp similarity index 98% rename from vkconfig3/dialog_vulkan_analysis.cpp rename to vkconfig_gui/dialog_vulkan_analysis.cpp index a5b54c9aba..585af580f2 100644 --- a/vkconfig3/dialog_vulkan_analysis.cpp +++ b/vkconfig_gui/dialog_vulkan_analysis.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include "dialog_vulkan_analysis.h" -#include "../vkconfig_core/platform.h" +#include "../vkconfig_core/type_platform.h" #include #include diff --git a/vkconfig/dialog_vulkan_analysis.h b/vkconfig_gui/dialog_vulkan_analysis.h similarity index 100% rename from vkconfig/dialog_vulkan_analysis.h rename to vkconfig_gui/dialog_vulkan_analysis.h diff --git a/vkconfig/dialog_vulkan_analysis.ui b/vkconfig_gui/dialog_vulkan_analysis.ui similarity index 100% rename from vkconfig/dialog_vulkan_analysis.ui rename to vkconfig_gui/dialog_vulkan_analysis.ui diff --git a/vkconfig/dialog_vulkan_info.cpp b/vkconfig_gui/dialog_vulkan_info.cpp similarity index 98% rename from vkconfig/dialog_vulkan_info.cpp rename to vkconfig_gui/dialog_vulkan_info.cpp index 1277cd80b4..a6698be1b8 100644 --- a/vkconfig/dialog_vulkan_info.cpp +++ b/vkconfig_gui/dialog_vulkan_info.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ #include "dialog_vulkan_info.h" #include "../vkconfig_core/util.h" -#include "../vkconfig_core/platform.h" +#include "../vkconfig_core/type_platform.h" #include #include @@ -54,7 +54,7 @@ void VulkanInfoDialog::Run() { "/usr/local/bin/vulkaninfo", // PLATFORM_MACOS "N/A", // PLATFORM_ANDROID }; - static_assert(countof(VULKAN_INFO_PATH) == PLATFORM_COUNT, + static_assert(std::size(VULKAN_INFO_PATH) == PLATFORM_COUNT, "The tranlation table size doesn't match the enum number of elements"); ui->treeWidget->clear(); diff --git a/vkconfig/dialog_vulkan_info.h b/vkconfig_gui/dialog_vulkan_info.h similarity index 100% rename from vkconfig/dialog_vulkan_info.h rename to vkconfig_gui/dialog_vulkan_info.h diff --git a/vkconfig/dialog_vulkan_info.ui b/vkconfig_gui/dialog_vulkan_info.ui similarity index 100% rename from vkconfig/dialog_vulkan_info.ui rename to vkconfig_gui/dialog_vulkan_info.ui diff --git a/vkconfig/images/NewLunarGLogoBlack.png b/vkconfig_gui/images/NewLunarGLogoBlack.png similarity index 100% rename from vkconfig/images/NewLunarGLogoBlack.png rename to vkconfig_gui/images/NewLunarGLogoBlack.png diff --git a/vkconfig/images/presentation.gif b/vkconfig_gui/images/presentation.gif similarity index 100% rename from vkconfig/images/presentation.gif rename to vkconfig_gui/images/presentation.gif diff --git a/vkconfig/images/vkconfig_applications_collapsed.png b/vkconfig_gui/images/vkconfig_applications_collapsed.png similarity index 100% rename from vkconfig/images/vkconfig_applications_collapsed.png rename to vkconfig_gui/images/vkconfig_applications_collapsed.png diff --git a/vkconfig/images/vkconfig_applications_dialog.png b/vkconfig_gui/images/vkconfig_applications_dialog.png similarity index 100% rename from vkconfig/images/vkconfig_applications_dialog.png rename to vkconfig_gui/images/vkconfig_applications_dialog.png diff --git a/vkconfig/images/vkconfig_applications_expanded.png b/vkconfig_gui/images/vkconfig_applications_expanded.png similarity index 100% rename from vkconfig/images/vkconfig_applications_expanded.png rename to vkconfig_gui/images/vkconfig_applications_expanded.png diff --git a/vkconfig/images/vulkan_configurator.png b/vkconfig_gui/images/vulkan_configurator.png similarity index 100% rename from vkconfig/images/vulkan_configurator.png rename to vkconfig_gui/images/vulkan_configurator.png diff --git a/vkconfig/images/vulkan_layers_order.png b/vkconfig_gui/images/vulkan_layers_order.png similarity index 100% rename from vkconfig/images/vulkan_layers_order.png rename to vkconfig_gui/images/vulkan_layers_order.png diff --git a/vkconfig/images/vulkan_layers_order_small.png b/vkconfig_gui/images/vulkan_layers_order_small.png similarity index 100% rename from vkconfig/images/vulkan_layers_order_small.png rename to vkconfig_gui/images/vulkan_layers_order_small.png diff --git a/vkconfig/images/vulkan_loader.png b/vkconfig_gui/images/vulkan_loader.png similarity index 100% rename from vkconfig/images/vulkan_loader.png rename to vkconfig_gui/images/vulkan_loader.png diff --git a/vkconfig/images/vulkan_loader_640px.png b/vkconfig_gui/images/vulkan_loader_640px.png similarity index 100% rename from vkconfig/images/vulkan_loader_640px.png rename to vkconfig_gui/images/vulkan_loader_640px.png diff --git a/vkconfig3/macOS/Info.plist b/vkconfig_gui/macOS/Info.plist similarity index 100% rename from vkconfig3/macOS/Info.plist rename to vkconfig_gui/macOS/Info.plist diff --git a/vkconfig3/macOS/Resources/VulkanIcon.icns b/vkconfig_gui/macOS/Resources/VulkanIcon.icns similarity index 100% rename from vkconfig3/macOS/Resources/VulkanIcon.icns rename to vkconfig_gui/macOS/Resources/VulkanIcon.icns diff --git a/vkconfig/macOS/vkconfig.cmake b/vkconfig_gui/macOS/vkconfig.cmake similarity index 59% rename from vkconfig/macOS/vkconfig.cmake rename to vkconfig_gui/macOS/vkconfig.cmake index e64ce1eb80..b4afce4deb 100644 --- a/vkconfig/macOS/vkconfig.cmake +++ b/vkconfig_gui/macOS/vkconfig.cmake @@ -1,6 +1,6 @@ # ~~~ -# Copyright (c) 2018-2019 Valve Corporation -# Copyright (c) 2018-2019 LunarG, Inc. +# Copyright (c) 2018-2024 Valve Corporation +# Copyright (c) 2018-2024 LunarG, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ -add_executable(vkconfig +add_executable(vkconfig-gui MACOSX_BUNDLE ${FILES_ALL} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/VulkanIcon.icns @@ -28,31 +28,31 @@ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/VulkanIc PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") -target_link_libraries(vkconfig vkconfig_core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) -target_link_libraries(vkconfig "-framework Cocoa -framework QuartzCore") +target_link_libraries(vkconfig-gui vkconfig-core Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network) +target_link_libraries(vkconfig-gui "-framework Cocoa -framework QuartzCore") get_target_property(QMAKE_EXE Qt5::qmake IMPORTED_LOCATION) get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY) find_program(MACDEPLOYQT_EXE macdeployqt HINTS "${QT_BIN_DIR}") -add_custom_command(TARGET vkconfig POST_BUILD +add_custom_command(TARGET vkconfig-gui POST_BUILD COMMAND "${MACDEPLOYQT_EXE}" - "${CMAKE_CURRENT_BINARY_DIR}/vkconfig.app/" + "${CMAKE_CURRENT_BINARY_DIR}/vkconfig-gui.app/" -always-overwrite - -executable="${CMAKE_CURRENT_BINARY_DIR}/vkconfig.app/Contents/MacOS/vkconfig" + -executable="${CMAKE_CURRENT_BINARY_DIR}/vkconfig-gui.app/Contents/MacOS/vkconfig-gui" -verbose=1 COMMENT "Running macdeployqt..." ) -add_custom_command(TARGET vkconfig POST_BUILD +add_custom_command(TARGET vkconfig-gui POST_BUILD COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist" - "${CMAKE_CURRENT_BINARY_DIR}/vkconfig.app/Contents/" - COMMENT "Copying Info.plist to vkconfig.app..." + "${CMAKE_CURRENT_BINARY_DIR}/vkconfig-gui.app/Contents/" + COMMENT "Copying Info.plist to vkconfig-gui.app..." ) -set_target_properties(vkconfig PROPERTIES SKIP_BUILD_RPATH FALSE) -set_target_properties(vkconfig PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) -set_target_properties(vkconfig PROPERTIES INSTALL_RPATH "") -set_target_properties(vkconfig PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) -install(TARGETS vkconfig BUNDLE DESTINATION "bin") +set_target_properties(vkconfig-gui PROPERTIES SKIP_BUILD_RPATH FALSE) +set_target_properties(vkconfig-gui PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) +set_target_properties(vkconfig-gui PROPERTIES INSTALL_RPATH "") +set_target_properties(vkconfig-gui PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) +install(TARGETS vkconfig-gui BUNDLE DESTINATION "bin") diff --git a/vkconfig3/main_gui.cpp b/vkconfig_gui/main.cpp similarity index 55% rename from vkconfig3/main_gui.cpp rename to vkconfig_gui/main.cpp index f614f40584..1333595342 100644 --- a/vkconfig3/main_gui.cpp +++ b/vkconfig_gui/main.cpp @@ -18,18 +18,30 @@ * - Christophe Riccio */ -#include "main_gui.h" - #include "mainwindow.h" +#include "../vkconfig_core/vulkan_util.h" +#include "../vkconfig_core/vulkan_util.h" #include "../vkconfig_core/alert.h" -#include "../vkconfig_core/version.h" #include "../vkconfig_core/application_singleton.h" +#include "../vkconfig_core/configurator.h" +#include "../vkconfig_core/configurator_signal.h" #include -#include -int run_gui(int argc, char* argv[], const CommandLine& command_line) { +#include + +// TODO, until Loader 284 release... +#if true || VKC_ENV == VKC_ENV_UNIX +static const Version REQUIRED_LOADER_VERSION(1, 3, 261); +#elif VKC_ENV == VKC_ENV_WIN32 +static const Version REQUIRED_LOADER_VERSION(1, 3, 284); +#else +#endif + +int main(int argc, char* argv[]) { + InitSignals(); + QCoreApplication::setOrganizationName("LunarG"); QCoreApplication::setOrganizationDomain("lunarg.com"); @@ -40,35 +52,45 @@ int run_gui(int argc, char* argv[], const CommandLine& command_line) { // settings from the previous version (assuming that's ever an issue) QCoreApplication::setApplicationName(VKCONFIG_SHORT_NAME); - // Older Qt versions do not have this. Dynamically check the version - // of Qt since it's just an enumerant. Versions 5.6.0 and later have - // high dpi support. We really don't need to check the 5, but for - // the sake of completeness and mabye compatibility with qt 6. - // Also ignoring the trailing point releases - const char* version = qVersion(); - int version_major, version_minor; - sscanf(version, "%d.%d", &version_major, &version_minor); - if (version_major >= 5 && version_minor >= 6) { - // Qt::AA_EnableHighDpiScaling = 20 from qnamespace.h in Qt 5.6 or later - QCoreApplication::setAttribute((Qt::ApplicationAttribute)20); - } + // Qt::AA_EnableHighDpiScaling = 20 from qnamespace.h in Qt 5.6 or later + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); // This has to go after the construction of QApplication in // order to use a QMessageBox and avoid some QThread warnings. ApplicationSingleton singleton("vkconfig_single_instance"); - while (!singleton.IsFirstInstance()) { - if (Alert::ConfiguratorSingleton() == QMessageBox::Cancel) { + if (Alert::StartSingleton() == QMessageBox::Cancel) { return -1; } } - // We simply cannot run without any layers - Configurator& configurator = Configurator::Get(command_line.command_vulkan_sdk); + Configurator& configurator = Configurator::Get(); + + // Make sure layers configuration is deleted otherwise BuildVulkanSystemInfo() will crash... (unexplained) + configurator.Surrender(); + + const VulkanSystemInfo& vulkan_info = BuildVulkanSystemInfo(); - if (!configurator.Init()) return -1; + if (vulkan_info.loaderVersion == Version::VERSION_NULL) { + Alert::StartLoaderFailure(); + return -1; + } + + if (vulkan_info.loaderVersion < REQUIRED_LOADER_VERSION) { + Alert::StartLoaderIncompatibleVersions(vulkan_info.loaderVersion, REQUIRED_LOADER_VERSION); + return -1; + } + + if (vulkan_info.physicalDevices.empty()) { + Alert::StartPhysicalDeviceFailure(); + return -1; + } + + if (!configurator.Init()) { + return -1; + } // The main GUI is driven here MainWindow main_window; diff --git a/vkconfig3/mainwindow.cpp b/vkconfig_gui/mainwindow.cpp similarity index 82% rename from vkconfig3/mainwindow.cpp rename to vkconfig_gui/mainwindow.cpp index f7b6d9c519..d7bf1995a6 100644 --- a/vkconfig3/mainwindow.cpp +++ b/vkconfig_gui/mainwindow.cpp @@ -23,18 +23,17 @@ #include "dialog_vulkan_analysis.h" #include "dialog_vulkan_info.h" -#include "dialog_applications.h" - -#include "configurator.h" -#include "vulkan_util.h" +#include "../vkconfig_core/configurator.h" #include "../vkconfig_core/alert.h" #include "../vkconfig_core/util.h" #include "../vkconfig_core/version.h" -#include "../vkconfig_core/platform.h" #include "../vkconfig_core/help.h" #include "../vkconfig_core/doc.h" #include "../vkconfig_core/date.h" +#include "../vkconfig_core/type_platform.h" +#include "../vkconfig_core/type_log.h" +#include "../vkconfig_core/type_hide_message.h" #include #include @@ -44,7 +43,6 @@ #include #include #include -#include #include #include @@ -52,8 +50,6 @@ static const char *TEXT_EXECUTE_CLOSER_APPLICATION = "Execute Closer to the Vulkan Application"; static const char *TEXT_EXECUTE_CLOSER_DRIVER = "Execute Closer to the Vulkan Driver"; -enum Tab { TAB_DIAGNOSTIC = 0, TAB_APPLICATIONS, TAB_LAYERS, TAB_CONFIGURATIONS, TAB_PREFERENCES, TAB_HELP }; - #if VKC_PLATFORM == VKC_PLATFORM_LINUX || VKC_PLATFORM == VKC_PLATFORM_MACOS #include @@ -126,6 +122,94 @@ static const int LAUNCH_ROW_HEIGHT = 26; static const int LAUNCH_ROW_HEIGHT = 28; #endif +/* TODO + +Path PathManager::SelectPathImpl(QWidget* parent, PathType path, const Path& suggested_path) { + assert(parent); + assert(path >= PATH_FIRST && path <= PATH_LAST); + assert(!suggested_path.Empty()); + + switch (path) { + case PATH_LAUNCHER_LOG_FILE: { + const std::string selected_path = + QFileDialog::getSaveFileName(parent, "Set Log File To...", suggested_path.AbsolutePath().c_str(), "Log text(*.txt)") + .toStdString(); + if (selected_path.empty()) // The user cancelled + return Path(""); + + SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); + return GetFullPath(path, QFileInfo(selected_path.c_str()).baseName().toStdString()); + } break; + case PATH_EXECUTABLE: { + static const char* TABLE[] = { + "Applications (*.exe)", // PLATFORM_WINDOWS + "Applications (*)", // PLATFORM_LINUX + "Applications (*.app, *)", // PLATFORM_MACOS + "N/A" // PLATFORM_ANDROID + }; + static_assert(std::size(TABLE) == PLATFORM_COUNT, + "The tranlation table size doesn't match the enum number of elements"); + + const std::string filter = TABLE[VKC_PLATFORM]; + const std::string selected_path = QFileDialog::getOpenFileName(parent, "Select a Vulkan Executable...", + suggested_path.AbsolutePath().c_str(), filter.c_str()) + .toStdString(); + if (selected_path.empty()) // The user cancelled + return Path(""); + + SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); + return GetFullPath(path, QFileInfo(selected_path.c_str()).fileName().toStdString()); + } + case PATH_WORKING_DIR: { + const std::string selected_path = + QFileDialog::getExistingDirectory(parent, "Set Working Folder To...", suggested_path.AbsolutePath().c_str()) + .toStdString(); + if (selected_path.empty()) // The user cancelled + return Path(""); + + SetPath(path, selected_path); + return Path(GetPath(path)); + } + case PATH_USER_DEFINED_LAYERS_GUI: { + const std::string selected_path = + QFileDialog::getExistingDirectory(parent, "Add User-Defined Layers Folder...", + suggested_path.AbsolutePath().c_str(), QFileDialog::DontUseNativeDialog) + .toStdString(); + if (selected_path.empty()) // The user cancelled + return Path(""); + + SetPath(path, selected_path); + return Path(GetPath(path)); + } + case PATH_IMPORT_CONFIGURATION: { + const std::string selected_path = + QFileDialog::getOpenFileName(parent, "Import Layers Configuration File", suggested_path.AbsolutePath().c_str(), + "JSON configuration(*.json)") + .toStdString(); + if (selected_path.empty()) // The user cancelled + return Path(""); + + SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); + return Path(selected_path); + } + case PATH_EXPORT_CONFIGURATION: { + const std::string selected_path = + QFileDialog::getSaveFileName(parent, "Export Layers Configuration File", suggested_path.AbsolutePath().c_str(), + "JSON configuration(*.json)") + .toStdString(); + if (selected_path.empty()) // The user cancelled + return Path(""); + + SetPath(path, QFileInfo(selected_path.c_str()).absolutePath().toStdString()); + return Path(selected_path); + } + default: + assert(0); + return Path(""); + } +} +*/ + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), _launch_application(nullptr), @@ -146,8 +230,7 @@ MainWindow::MainWindow(QWidget *parent) _tray_layers_controlled_by_configurator(nullptr), _tray_layers_disabled_by_configurator(nullptr), _tray_quit_action(nullptr), - ui(new Ui::MainWindow), - been_warned_about_old_loader(false) { + ui(new Ui::MainWindow) { ui->setupUi(this); ui->launcher_tree->installEventFilter(this); ui->configurations_tree->installEventFilter(this); @@ -205,14 +288,29 @@ MainWindow::MainWindow(QWidget *parent) // ui->splitter_configurations->restoreState(environment.Get(VKCONFIG3_LAYOUT_MAIN_SPLITTER2)); // ui->splitter_settings->restoreState(environment.Get(VKCONFIG3_LAYOUT_MAIN_SPLITTER3)); - // Update launcher - const Application &application = configurator.environment.GetApplication(0); - ui->edit_executable->setText(application.executable_path.c_str()); - ui->edit_dir->setText(application.working_folder.c_str()); - ui->edit_arguments->setText(application.arguments.c_str()); - ui->edit_env->setText(application.env.c_str()); - ui->edit_log->setText(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); + // Update configuration application area + + if (!environment.GetApplications().empty()) { + ui->combo_box_applications->blockSignals(true); + ui->combo_box_applications->clear(); + for (std::size_t i = 0, n = environment.GetApplications().size(); i < n; ++i) { + const Application &application = environment.GetApplications()[i]; + + ui->combo_box_applications->addItem(application.executable_path.RelativePath().c_str()); + } + ui->combo_box_applications->blockSignals(false); + } + this->on_check_box_per_application_toggled(environment.GetPerApplicationConfig()); + this->on_combo_box_applications_currentIndexChanged(environment.GetActiveApplicationIndex()); + ui->combo_box_applications->setCurrentIndex(environment.GetActiveApplicationIndex()); + // ui->edit_executable->setText(application.executable_path.c_str()); + /* + ui->edit_dir->setText(application.working_folder.c_str()); + ui->edit_arguments->setText(application.arguments.c_str()); + ui->edit_env->setText(application.env.c_str()); + ui->edit_log->setText(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); + */ ui->execute_closer_application_label->setVisible(true); ui->execute_closer_driver_label->setVisible(true); @@ -228,8 +326,6 @@ MainWindow::MainWindow(QWidget *parent) ui->log_browser->document()->setMaximumBlockCount(2048); // ui->configuration_tree->scrollToItem(ui->configuration_tree->topLevelItem(0), QAbstractItemView::PositionAtTop); - ui->check_box_per_application->setChecked(configurator.environment.GetPerApplicationConfig()); - this->InitTray(); this->UpdateTray(); this->UpdateUI(); @@ -286,22 +382,22 @@ void MainWindow::UpdateTray() { const Environment &environment = configurator.environment; - const bool use_override = environment.GetMode() != LAYERS_MODE_BY_APPLICATIONS; - const bool active = configurator.configurations.HasActiveConfiguration(configurator.layers.selected_layers) && use_override; + const bool use_override = environment.global_configuration.GetMode() != LAYERS_CONTROLLED_BY_APPLICATIONS; + const bool active = configurator.HasActiveConfiguration() && use_override; - switch (environment.GetMode()) { + switch (environment.global_configuration.GetMode()) { default: - case LAYERS_MODE_BY_APPLICATIONS: + case LAYERS_CONTROLLED_BY_APPLICATIONS: this->_tray_layers_controlled_by_applications->setChecked(true); this->_tray_layers_controlled_by_configurator->setChecked(false); this->_tray_layers_disabled_by_configurator->setChecked(false); break; - case LAYERS_MODE_BY_CONFIGURATOR_RUNNING: + case LAYERS_CONTROLLED_BY_CONFIGURATOR: this->_tray_layers_controlled_by_applications->setChecked(false); this->_tray_layers_controlled_by_configurator->setChecked(true); this->_tray_layers_disabled_by_configurator->setChecked(false); break; - case LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED: + case LAYERS_DISABLED_BY_CONFIGURATOR: this->_tray_layers_controlled_by_applications->setChecked(false); this->_tray_layers_controlled_by_configurator->setChecked(false); this->_tray_layers_disabled_by_configurator->setChecked(true); @@ -361,8 +457,13 @@ void MainWindow::trayActionRestore() { void MainWindow::trayActionControlledByApplications(bool checked) { if (checked) { Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - configurator.configurations.Configure(configurator.layers.selected_layers); + + if (configurator.environment.GetPerApplicationConfig()) { + configurator.environment.GetActiveApplication().configuration.SetMode(LAYERS_CONTROLLED_BY_APPLICATIONS); + } else { + configurator.environment.global_configuration.SetMode(LAYERS_CONTROLLED_BY_APPLICATIONS); + } + configurator.Override(); this->UpdateUI(); this->UpdateTray(); @@ -372,8 +473,12 @@ void MainWindow::trayActionControlledByApplications(bool checked) { void MainWindow::trayActionControlledByConfigurator(bool checked) { if (checked) { Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(LAYERS_MODE_BY_CONFIGURATOR_RUNNING); - configurator.configurations.Configure(configurator.layers.selected_layers); + + if (configurator.environment.GetPerApplicationConfig()) { + configurator.environment.GetActiveApplication().configuration.SetMode(LAYERS_CONTROLLED_BY_CONFIGURATOR); + } else { + configurator.environment.global_configuration.SetMode(LAYERS_CONTROLLED_BY_CONFIGURATOR); + } this->UpdateUI(); this->UpdateTray(); @@ -383,8 +488,14 @@ void MainWindow::trayActionControlledByConfigurator(bool checked) { void MainWindow::trayActionDisabledByApplications(bool checked) { if (checked) { Configurator &configurator = Configurator::Get(); - configurator.environment.SetMode(LAYERS_MODE_BY_CONFIGURATOR_ALL_DISABLED); - configurator.configurations.Configure(configurator.layers.selected_layers); + + if (configurator.environment.GetPerApplicationConfig()) { + configurator.environment.GetActiveApplication().configuration.SetMode(LAYERS_DISABLED_BY_CONFIGURATOR); + } else { + configurator.environment.global_configuration.SetMode(LAYERS_DISABLED_BY_CONFIGURATOR); + } + + configurator.Override(); this->UpdateUI(); this->UpdateTray(); @@ -393,19 +504,22 @@ void MainWindow::trayActionDisabledByApplications(bool checked) { static std::string GetMainWindowTitle(bool active) { #if VKCONFIG_DATE - std::string title = format("%s %s-%s", VKCONFIG_NAME, Version::VKCONFIG3.str().c_str(), GetBuildDate().c_str()); + std::string title = format("%s %s-%s", VKCONFIG_NAME, Version::VKCONFIG.str().c_str(), GetBuildDate().c_str()); #else - std::string title = format("%s %s", VKCONFIG_NAME, Version::VKCONFIG3.str().c_str()); + std::string title = format("%s %s", VKCONFIG_NAME, Version::VKCONFIG.str().c_str()); #endif if (active) title += " "; return title; } void MainWindow::InitUI() { - Configurator &configurator = Configurator::Get(); - const Environment &environment = configurator.environment; + const Environment &environment = Configurator::Get().environment; - ui->combo_box_mode->setCurrentIndex(environment.GetMode()); + if (environment.GetPerApplicationConfig()) { + ui->combo_box_mode->setCurrentIndex(environment.GetActiveApplication().configuration.GetMode()); + } else { + ui->combo_box_mode->setCurrentIndex(environment.global_configuration.GetMode()); + } } void MainWindow::AddLayerPathItem(const std::string &layer_path) { @@ -438,15 +552,17 @@ void MainWindow::AddLayerItem(const Parameter ¶meter) { decorated_name += format(" (%s)", GetToken(layer->status)); } - if (IsDLL32Bit(layer->manifest_path)) { + if (IsDLL32Bit(layer->manifest_path.AbsolutePath())) { decorated_name += " (32-bit)"; } } else { // A layers configuration may have excluded layer that are misssing because they are not available on this platform // We simply hide these layers to avoid confusing the Vulkan developers - if (parameter.state == LAYER_STATE_EXCLUDED) return; + if (parameter.control == LAYER_CONTROL_OFF) { + return; + } - if (parameter.control != LAYER_STATE_APPLICATION_CONTROLLED && parameter.control != LAYER_CONTROL_UNORDERED) { + if (parameter.control != LAYER_CONTROL_APPLICATIONS && parameter.control != LAYER_CONTROL_UNORDERED) { decorated_name += " (Missing)"; } } @@ -512,21 +628,24 @@ void MainWindow::UpdateUI() { Configurator &configurator = Configurator::Get(); const Environment &environment = Configurator::Get().environment; - const std::string &selected_contiguration_name = environment.GetSelectedConfiguration(); + const std::string &selected_contiguration_name = environment.GetActiveConfigurationInfo().GetName(); const bool has_selected_configuration = !selected_contiguration_name.empty(); this->blockSignals(true); ui->configurations_tree->blockSignals(true); // Add applications + ui->combo_box_applications->blockSignals(true); + ui->combo_box_applications->clear(); ui->combo_box_applications->setEnabled(ui->check_box_per_application->isChecked()); const std::vector &applications = environment.GetApplications(); for (std::size_t i = 0, n = applications.size(); i < n; ++i) { - ui->combo_box_applications->addItem(ReplaceBuiltInVariable(applications[i].executable_path.c_str()).c_str()); + ui->combo_box_applications->addItem(applications[i].executable_path.AbsolutePath().c_str()); } ui->combo_box_applications->setCurrentIndex(environment.GetActiveApplicationIndex()); + ui->combo_box_applications->blockSignals(false); - const bool has_active_configuration = configurator.configurations.HasActiveConfiguration(configurator.layers.selected_layers); + const bool has_active_configuration = configurator.HasActiveConfiguration(); // Mode states this->UpdateTray(); @@ -606,18 +725,16 @@ void MainWindow::UpdateUI() { ui->push_button_settings->setEnabled(has_selected_configuration); ui->push_button_export->setEnabled(has_selected_configuration); - // Load Layers paths - std::vector layer_paths = configurator.layers.BuildPathList(); - // ui->tree_layers_paths->setEnabled(enable_layer_ui); ui->tree_layers_paths->clear(); + /* + std::vector layer_paths = configurator.layers.BuildPathList(); + for (std::size_t path_index = 0, count = layer_paths.size(); path_index < count; ++path_index) { + const std::string user_defined_path(layer_paths[path_index].RelativePath().c_str()); - for (std::size_t path_index = 0, count = layer_paths.size(); path_index < count; ++path_index) { - const std::string user_defined_path(ConvertNativeSeparators(layer_paths[path_index])); - - AddLayerPathItem(user_defined_path); - } - + AddLayerPathItem(user_defined_path); + } + */ ui->tree_layers_paths->update(); // Load Layers items @@ -676,7 +793,7 @@ void MainWindow::UpdateUI() { */ _launcher_apps_combo->blockSignals(true); _launcher_apps_combo->clear(); - + /* if (applications.empty()) { _launcher_executable->setText(""); _launcher_arguments->setText(""); @@ -694,7 +811,7 @@ void MainWindow::UpdateUI() { _launcher_working->setText(application.working_folder.c_str()); _launcher_log_file_edit->setText(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); } - + */ _launcher_apps_combo->blockSignals(false); // Handle persistent states @@ -740,7 +857,7 @@ void MainWindow::UpdateUI() { _launcher_log_file_edit->setEnabled(has_application_list); } - ui->settings_tree->setEnabled(environment.GetMode() == LAYERS_MODE_BY_CONFIGURATOR_RUNNING && has_selected_configuration); + // ui->settings_tree->setEnabled(environment.GetMode() == LAYERS_MODE_CONTROLLED_BY_CONFIGURATOR && has_selected_configuration); if (has_selected_configuration) { this->_settings_tree_manager.CreateGUI(ui->settings_tree); } else { @@ -913,15 +1030,10 @@ void MainWindow::on_check_box_apply_list_clicked() { void MainWindow::on_combo_box_mode_currentIndexChanged(int index) { Configurator &configurator = Configurator::Get(); - if (configurator.environment.GetPerApplicationConfig()) { - Application &application = configurator.environment.GetApplication(configurator.environment.GetActiveApplicationIndex()); - application.layers_mode = static_cast(index); - } else { - configurator.environment.SetMode(static_cast(index)); - configurator.ActivateConfiguration(configurator.environment.GetSelectedConfiguration()); - } + configurator.environment.GetActiveConfigurationInfo().SetMode(static_cast(index)); + configurator.Override(); - const bool enabled_ui = index == LAYERS_MODE_BY_CONFIGURATOR_RUNNING; + const bool enabled_ui = index == LAYERS_CONTROLLED_BY_CONFIGURATOR; ui->group_box_configurations->setEnabled(enabled_ui); ui->group_box_settings->setEnabled(enabled_ui); @@ -932,9 +1044,9 @@ void MainWindow::on_combo_box_applications_currentIndexChanged(int index) { Configurator &configurator = Configurator::Get(); configurator.environment.SelectActiveApplication(index); - Application &application = configurator.environment.GetApplication(configurator.environment.GetActiveApplicationIndex()); - ui->combo_box_applications->setToolTip(ReplaceBuiltInVariable(application.executable_path.c_str()).c_str()); - ui->combo_box_mode->setCurrentIndex(application.layers_mode); + Application &application = configurator.environment.GetApplication(index); + ui->combo_box_applications->setToolTip(application.executable_path.AbsolutePath().c_str()); + ui->combo_box_mode->setCurrentIndex(application.configuration.GetMode()); } void MainWindow::on_check_box_per_application_toggled(bool checked) { @@ -942,12 +1054,7 @@ void MainWindow::on_check_box_per_application_toggled(bool checked) { configurator.environment.SetPerApplicationConfig(checked); ui->combo_box_applications->setEnabled(configurator.environment.GetPerApplicationConfig()); - if (checked) { - Application &application = configurator.environment.GetApplication(configurator.environment.GetActiveApplicationIndex()); - ui->combo_box_mode->setCurrentIndex(application.layers_mode); - } else { - ui->combo_box_mode->setCurrentIndex(configurator.environment.GetMode()); - } + ui->combo_box_mode->setCurrentIndex(configurator.environment.GetActiveConfigurationInfo().GetMode()); } void MainWindow::on_check_box_clear_on_launch_clicked() { @@ -982,7 +1089,9 @@ void MainWindow::OnConfigurationItemClicked(bool checked) { // to ensure the new item is "selected" // ui->tree_configurations->setCurrentItem(item); - Configurator::Get().ActivateConfiguration(configuration_item->configuration_name); + Configurator &configurator = Configurator::Get(); + configurator.environment.GetActiveConfigurationInfo().SetName(configuration_item->configuration_name); + configurator.Override(); UpdateUI(); } @@ -990,9 +1099,12 @@ void MainWindow::OnConfigurationItemClicked(bool checked) { void MainWindow::OnConfigurationTreeClicked(QTreeWidgetItem *item, int column) { (void)column; + Configurator &configurator = Configurator::Get(); + ConfigurationListItem *configuration_item = dynamic_cast(item); if (configuration_item != nullptr) { - Configurator::Get().ActivateConfiguration(configuration_item->configuration_name); + configurator.environment.GetActiveConfigurationInfo().SetName(configuration_item->configuration_name); + configurator.Override(); } UpdateUI(); @@ -1044,8 +1156,7 @@ void MainWindow::OnConfigurationItemChanged(QTreeWidgetItem *item, int column) { configurator.configurations.RemoveConfigurationFile(old_name); configuration->key = configuration_item->configuration_name = new_name; configurator.configurations.SaveAllConfigurations(configurator.layers.selected_layers); - - configurator.ActivateConfiguration(new_name); + configurator.environment.GetActiveConfigurationInfo().SetName(new_name); LoadConfigurationList(); } else { @@ -1055,9 +1166,11 @@ void MainWindow::OnConfigurationItemChanged(QTreeWidgetItem *item, int column) { item->setText(1, old_name.c_str()); ui->configurations_tree->blockSignals(false); - configurator.ActivateConfiguration(old_name); + configurator.environment.GetActiveConfigurationInfo().SetName(old_name); } + configurator.Override(); + this->UpdateUI(); } } @@ -1077,8 +1190,10 @@ void MainWindow::OnConfigurationTreeChanged(QTreeWidgetItem *current, QTreeWidge configuration_item->radio_button->setChecked(true); Configurator &configurator = Configurator::Get(); - if (configurator.environment.GetSelectedConfiguration() != configuration_item->configuration_name) { - configurator.ActivateConfiguration(configuration_item->configuration_name); + if (configurator.environment.GetActiveConfigurationInfo().GetName() != configuration_item->configuration_name) { + configurator.environment.GetActiveConfigurationInfo().SetName(configuration_item->configuration_name); + + configurator.Override(); this->UpdateUI(); } } @@ -1086,9 +1201,7 @@ void MainWindow::OnConfigurationTreeChanged(QTreeWidgetItem *current, QTreeWidge void MainWindow::StartTool(Tool tool) { Configurator &configurator = Configurator::Get(); - LayersMode saved_mode = configurator.environment.GetMode(); - configurator.environment.SetMode(LAYERS_MODE_BY_APPLICATIONS); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.Surrender(); switch (tool) { case TOOL_VULKAN_INFO: @@ -1099,8 +1212,7 @@ void MainWindow::StartTool(Tool tool) { break; } - configurator.environment.SetMode(saved_mode); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.Override(); } /// Create the VulkanInfo dialog if it doesn't already exits & show it. @@ -1161,11 +1273,10 @@ void MainWindow::closeEvent(QCloseEvent *event) { // Alert the user to the current state of the vulkan configurator and // give them the option to not shutdown. if (environment.GetUseSystemTray()) { - QSettings settings; - if (!settings.value("vkconfig_system_tray", false).toBool()) { + if (environment.hide_message_boxes_flags & GetBit(HIDE_MESSAGE_USE_SYSTEM_TRAY)) { std::string shut_down_state; - if (environment.GetMode() == LAYERS_MODE_BY_CONFIGURATOR_RUNNING) { + if (environment.GetActiveConfigurationInfo().GetMode() == LAYERS_CONTROLLED_BY_CONFIGURATOR) { shut_down_state = "Vulkan Layers override will remain in effect while Vulkan Configurator remain active in the system tray."; } else { @@ -1182,7 +1293,9 @@ void MainWindow::closeEvent(QCloseEvent *event) { alert.setInformativeText("Are you still ready to move Vulkan Configurator in the system tray?"); int ret_val = alert.exec(); - settings.setValue("vkconfig_system_tray", alert.checkBox()->isChecked()); + if (alert.checkBox()->isChecked()) { + environment.hide_message_boxes_flags |= GetBit(HIDE_MESSAGE_USE_SYSTEM_TRAY); + } if (ret_val == QMessageBox::No) { event->ignore(); @@ -1229,11 +1342,11 @@ void MainWindow::showEvent(QShowEvent *event) { /// Edit the list of apps that can be filtered. void MainWindow::on_push_button_applications_clicked() { - ApplicationsDialog dlg(this); - dlg.exec(); + // ApplicationsDialog dlg(this); + // dlg.exec(); Configurator &configurator = Configurator::Get(); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.Override(); UpdateUI(); } @@ -1250,21 +1363,25 @@ void MainWindow::on_push_button_rename_clicked() { } void MainWindow::on_push_button_remove_clicked() { - Configurator &configurator = Configurator::Get(); + ConfigurationListItem *configuration_item = GetCheckedItem(); + if (configuration_item == nullptr) { + return; + } - this->RemoveConfiguration(configurator.environment.GetSelectedConfiguration()); + this->RemoveConfiguration(configuration_item->configuration_name); } void MainWindow::on_push_button_duplicate_clicked() { Configurator &configurator = Configurator::Get(); - Configuration *configutation = configurator.configurations.FindActiveConfiguration(); + const Configuration *configutation = configurator.GetActiveConfiguration(); assert(configutation != nullptr); const Configuration &duplicated_configuration = configurator.configurations.CreateConfiguration(configurator.layers.selected_layers, configutation->key, true); - configurator.ActivateConfiguration(duplicated_configuration.key); + configurator.environment.GetActiveConfigurationInfo().SetName(duplicated_configuration.key); + configurator.Override(); LoadConfigurationList(); @@ -1277,7 +1394,8 @@ void MainWindow::NewClicked() { Configuration &new_configuration = configurator.configurations.CreateConfiguration(configurator.layers.selected_layers, "New Configuration"); - configurator.ActivateConfiguration(new_configuration.key); + configurator.environment.GetActiveConfigurationInfo().SetName(new_configuration.key); + configurator.Override(); LoadConfigurationList(); } @@ -1299,7 +1417,7 @@ void MainWindow::RemoveConfiguration(const std::string &configuration_name) { Configurator &configurator = Configurator::Get(); configurator.configurations.RemoveConfiguration(configurator.layers.selected_layers, configuration_name); - configurator.environment.SetSelectedConfiguration(""); + configurator.environment.GetActiveConfigurationInfo().SetName(""); LoadConfigurationList(); @@ -1341,7 +1459,7 @@ void MainWindow::ResetClicked(ConfigurationListItem *item) { alert.setIcon(QMessageBox::Warning); if (alert.exec() == QMessageBox::No) return; - configuration->Reset(configurator.layers.selected_layers, configurator.path); + configuration->Reset(configurator.layers.selected_layers); LoadConfigurationList(); } @@ -1362,7 +1480,8 @@ void MainWindow::DuplicateClicked(ConfigurationListItem *item) { item->configuration_name = duplicated_configuration.key; - configurator.ActivateConfiguration(duplicated_configuration.key); + configurator.environment.GetActiveConfigurationInfo().SetName(duplicated_configuration.key); + configurator.Override(); LoadConfigurationList(); @@ -1387,10 +1506,15 @@ void MainWindow::ImportClicked(ConfigurationListItem *item) { Configurator &configurator = Configurator::Get(); - const std::string full_import_path = configurator.path.SelectPath(this, PATH_IMPORT_CONFIGURATION); - if (full_import_path.empty()) return; + const Path &path_import = configurator.environment.path_import; + /* + const Path full_import_path = configurator.path.SelectPath(this, PATH_IMPORT_CONFIGURATION); + if (full_import_path.Empty()) { + return; + } configurator.configurations.ImportConfiguration(configurator.layers.selected_layers, full_import_path); + */ LoadConfigurationList(); } @@ -1399,25 +1523,16 @@ void MainWindow::ExportClicked(ConfigurationListItem *item) { Configurator &configurator = Configurator::Get(); - const std::string full_suggested_path = configurator.path.GetFullPath(PATH_EXPORT_CONFIGURATION, item->configuration_name); - const std::string full_export_path = configurator.path.SelectPath(this, PATH_EXPORT_CONFIGURATION, full_suggested_path); - if (full_export_path.empty()) return; + const Path &path_export = configurator.environment.path_export; + /* TODO + const Path full_export_path = configurator.path.SelectPath(this, PATH_EXPORT_CONFIGURATION, full_suggested_path); + if (full_export_path.Empty()) { + return; + } configurator.configurations.ExportConfiguration(configurator.layers.selected_layers, full_export_path, item->configuration_name); -} - -void MainWindow::ReloadDefaultClicked(ConfigurationListItem *item) { - (void)item; - - if (Alert::ConfiguratorReloadDefault() == QMessageBox::Yes) { - _settings_tree_manager.CleanupGUI(); - - Configurator &configurator = Configurator::Get(); - configurator.configurations.ReloadDefaultsConfigurations(configurator.layers.selected_layers); - - LoadConfigurationList(); - } + */ } void MainWindow::editorExpanded(QTreeWidgetItem *item) { @@ -1436,7 +1551,8 @@ void MainWindow::OnSettingsTreeClicked(QTreeWidgetItem *item, int column) { (void)item; Configurator &configurator = Configurator::Get(); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.environment.GetActiveConfigurationInfo().ForceUpdate(UPDATE_LAYERS_SETTINGS_BIT); + configurator.Override(); } void MainWindow::SetupLauncherTree() { @@ -1570,7 +1686,7 @@ void MainWindow::OnLauncherLoaderMessageChanged(int level) { Configurator &configurator = Configurator::Get(); // configurator.environment.SetLoaderMessage(static_cast(level)); - configurator.environment.SetLoaderMessageTypes(GetLoaderMessageFlags(static_cast(level))); + // configurator.environment.SetLoaderMessageFlags(GetBit(static_cast(level))); if (ui->check_box_clear_on_launch->isChecked()) { this->UpdateUI(); @@ -1583,13 +1699,17 @@ void MainWindow::launchSetExecutable() { Configurator &configurator = Configurator::Get(); Application &application = configurator.environment.GetApplication(current_application_index); - const std::string exe = configurator.path.SelectPath(this, PATH_EXECUTABLE, application.executable_path.c_str()); + /* TODO + const Path exe = configurator.path.SelectPath(this, PATH_EXECUTABLE, application.executable_path); // The user has cancel the operation - if (exe.empty()) return; + if (exe.Empty()) { + return; + } application.executable_path = exe; - _launcher_executable->setText(exe.c_str()); + */ + _launcher_executable->setText(application.executable_path.RelativePath().c_str()); } void MainWindow::launchSetLogFile() { @@ -1598,13 +1718,18 @@ void MainWindow::launchSetLogFile() { Configurator &configurator = Configurator::Get(); Application &application = configurator.environment.GetApplication(current_application_index); - const std::string path = configurator.path.SelectPath(this, PATH_LAUNCHER_LOG_FILE, application.log_file.c_str()); + ApplicationOptions &options = application.GetActiveOptions(); + /* TODO + const Path &path = configurator.path.SelectPath(this, PATH_LAUNCHER_LOG_FILE, options.log_file); // The user has cancel the operation - if (path.empty()) return; + if (path.Empty()) { + return; + } - application.log_file = path; - _launcher_log_file_edit->setText(path.c_str()); + options.log_file = path; + */ + _launcher_log_file_edit->setText(options.log_file.RelativePath().c_str()); } void MainWindow::launchSetWorkingFolder() { @@ -1613,13 +1738,19 @@ void MainWindow::launchSetWorkingFolder() { Configurator &configurator = Configurator::Get(); Application &application = configurator.environment.GetApplication(current_application_index); - const std::string path = configurator.path.SelectPath(this, PATH_WORKING_DIR, application.working_folder.c_str()); + ApplicationOptions &options = application.GetActiveOptions(); + + /* TODO + const Path path = configurator.path.SelectPath(this, PATH_WORKING_DIR, options.working_folder); // The user has cancel the operation - if (path.empty()) return; + if (path.Empty()) { + return; + } - application.working_folder = path; - _launcher_working->setText(path.c_str()); + options.working_folder = path; + */ + _launcher_working->setText(options.working_folder.RelativePath().c_str()); } // Log file path edited manually. @@ -1628,7 +1759,8 @@ void MainWindow::launchChangeLogFile(const QString &log_file) { assert(current_application_index >= 0); Application &application = Configurator::Get().environment.GetApplication(current_application_index); - application.log_file = log_file.toStdString(); + ApplicationOptions &options = application.GetActiveOptions(); + options.log_file = log_file.toStdString(); } void MainWindow::launchChangeExecutable(const QString &exe) { @@ -1644,7 +1776,8 @@ void MainWindow::launchChangeWorkingFolder(const QString &working_folder) { assert(current_application_index >= 0); Application &application = Configurator::Get().environment.GetApplication(current_application_index); - application.working_folder = working_folder.toStdString(); + ApplicationOptions &options = application.GetActiveOptions(); + options.working_folder = working_folder.toStdString(); } // Launch app change @@ -1656,10 +1789,12 @@ void MainWindow::launchItemChanged(int application_index) { environment.SelectActiveApplication(application_index); Application &application = environment.GetApplication(application_index); - _launcher_executable->setText(application.executable_path.c_str()); - _launcher_working->setText(application.working_folder.c_str()); - _launcher_arguments->setText(application.arguments.c_str()); - _launcher_log_file_edit->setText(ReplaceBuiltInVariable(application.log_file.c_str()).c_str()); + ApplicationOptions &options = application.GetActiveOptions(); + + _launcher_executable->setText(application.executable_path.RelativePath().c_str()); + _launcher_working->setText(options.working_folder.RelativePath().c_str()); + _launcher_arguments->setText(Merge(options.arguments, " ").c_str()); + _launcher_log_file_edit->setText(options.log_file.RelativePath().c_str()); } /// New command line arguments. Update them. @@ -1668,7 +1803,8 @@ void MainWindow::launchArgsEdited(const QString &arguments) { if (application_index < 0) return; Application &application = Configurator::Get().environment.GetApplication(application_index); - application.arguments = arguments.toStdString(); + ApplicationOptions &options = application.GetActiveOptions(); + options.arguments = SplitSpace(arguments.toStdString()); } // Clear the browser window @@ -1791,11 +1927,11 @@ bool MainWindow::eventFilter(QObject *target, QEvent *event) { } else if (action == visit_layer_website_action) { QDesktopServices::openUrl(QUrl(layer->url.c_str())); } else if (action == export_html_action) { - const std::string path = format("%s/%s.html", GetPath(BUILTIN_PATH_APPDATA).c_str(), layer->key.c_str()); + const std::string path = format("%s/%s.html", AbsolutePath(Path::APPDATA).c_str(), layer->key.c_str()); ExportHtmlDoc(*layer, path); QDesktopServices::openUrl(QUrl(("file:///" + path).c_str())); } else if (action == export_markdown_action) { - const std::string path = format("%s/%s.md", GetPath(BUILTIN_PATH_APPDATA).c_str(), layer->key.c_str()); + const std::string path = format("%s/%s.md", AbsolutePath(Path::APPDATA).c_str(), layer->key.c_str()); ExportMarkdownDoc(*layer, path); QDesktopServices::openUrl(QUrl(("file:///" + path).c_str())); } @@ -1820,7 +1956,7 @@ QStringList MainWindow::BuildEnvVariables() const { Configurator &configurator = Configurator::Get(); QStringList env = QProcess::systemEnvironment(); - env << (QString("VK_LOADER_DEBUG=") + ::GetLoaderMessageTokens(configurator.environment.GetLoaderMessageTypes()).c_str()); + env << (QString("VK_LOADER_DEBUG=") + ::GetLogString(configurator.environment.GetLoaderMessageFlags()).c_str()); return env; } @@ -1854,37 +1990,37 @@ void MainWindow::on_push_button_launcher_clicked() { Configurator &configurator = Configurator::Get(); const Application &active_application = configurator.environment.GetActiveApplication(); - assert(!active_application.app_name.empty()); - launch_log += format("- Application: %s\n", active_application.app_name.c_str()); - assert(!active_application.executable_path.empty()); - - launch_log += format("- Executable: %s\n", ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str()); - if (!QFileInfo(ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str()).exists()) { - Alert::PathInvalid(ReplaceBuiltInVariable(_launcher_executable->text().toStdString()).c_str(), - format("The '%s' application will fail to launch.", active_application.app_name.c_str()).c_str()); + assert(!active_application.executable_path.Empty()); + launch_log += format("- Executable: %s\n", active_application.executable_path.AbsolutePath().c_str()); + if (!active_application.executable_path.Exists()) { + Alert::PathInvalid( + active_application.executable_path, + format("The '%s' application will fail to launch.", active_application.executable_path.AbsolutePath().c_str()).c_str()); } - launch_log += format("- Working Directory: %s\n", ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str()); - if (!QFileInfo(ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str()).exists()) { - Alert::PathInvalid(ReplaceBuiltInVariable(_launcher_working->text().toStdString()).c_str(), - format("The '%s' application will fail to launch.", active_application.app_name.c_str()).c_str()); + const ApplicationOptions &options = active_application.GetActiveOptions(); + + launch_log += format("- Working Directory: %s\n", options.working_folder.AbsolutePath().c_str()); + if (!options.working_folder.Exists()) { + Alert::PathInvalid( + options.working_folder, + format("The '%s' application will fail to launch.", active_application.executable_path.AbsolutePath().c_str()).c_str()); } if (!_launcher_arguments->text().isEmpty()) { launch_log += format("- Command-line Arguments: %s\n", _launcher_arguments->text().toStdString().c_str()); } - const std::string actual_log_file = ReplaceBuiltInVariable(active_application.log_file.c_str()); - if (!actual_log_file.empty()) { - launch_log += format("- Log file: %s\n", actual_log_file.c_str()); + if (!options.log_file.Empty()) { + launch_log += format("- Log file: %s\n", options.log_file.AbsolutePath().c_str()); } - if (!actual_log_file.empty()) { + if (!options.log_file.Empty()) { // Start logging // Make sure the log file is not already opened. This can occur if the // launched application is closed from the applicaiton. if (!_log_file.isOpen()) { - _log_file.setFileName(actual_log_file.c_str()); + _log_file.setFileName(options.log_file.AbsolutePath().c_str()); // Open and append, or open and truncate? QIODevice::OpenMode mode = QIODevice::WriteOnly | QIODevice::Text; @@ -1910,8 +2046,8 @@ void MainWindow::on_push_button_launcher_clicked() { _launch_application->setWorkingDirectory(ui->edit_dir->text()); _launch_application->setEnvironment(BuildEnvVariables() + ui->edit_env->text().split(",")); - if (!active_application.arguments.empty()) { - const QStringList args = ConvertString(SplitSpace(active_application.arguments)); + if (!options.arguments.empty()) { + const QStringList args = ConvertString(options.arguments); _launch_application->setArguments(args); } @@ -1924,7 +2060,8 @@ void MainWindow::on_push_button_launcher_clicked() { _launch_application->deleteLater(); _launch_application = nullptr; - const std::string failed_log = std::string("Failed to launch ") + active_application.executable_path.c_str() + "!\n"; + const std::string failed_log = + std::string("Failed to launch ") + active_application.executable_path.AbsolutePath().c_str() + "!\n"; Log(failed_log); } diff --git a/vkconfig3/mainwindow.h b/vkconfig_gui/mainwindow.h similarity index 96% rename from vkconfig3/mainwindow.h rename to vkconfig_gui/mainwindow.h index e6bad7ea9d..9299bafc5f 100644 --- a/vkconfig3/mainwindow.h +++ b/vkconfig_gui/mainwindow.h @@ -21,7 +21,6 @@ #pragma once -#include "configurator.h" #include "settings_tree.h" #include "ui_mainwindow.h" @@ -67,7 +66,7 @@ class LayerWidget : public QLabel { this->layer_version = new QComboBox(this); this->layer_version->addItem(layers.empty() ? "0.0.000" : layers[0]->api_version.str().c_str()); if (!layers.empty()) { - this->layer_version->setToolTip(layers[0]->manifest_path.c_str()); + this->layer_version->setToolTip(layers[0]->manifest_path.AbsolutePath().c_str()); } // this->layer_version->setEnabled(layers.size() > 1); this->layer_version->installEventFilter(this); @@ -77,7 +76,7 @@ class LayerWidget : public QLabel { this->layer_state->addItem("On"); this->layer_state->addItem("Off"); this->layer_state->setEnabled(!layers.empty()); - this->layer_state->setCurrentIndex(parameter.state); + this->layer_state->setCurrentIndex(parameter.control); this->layer_state->installEventFilter(this); } @@ -86,7 +85,9 @@ class LayerWidget : public QLabel { if (layers.empty()) { // A layers configuration may have excluded layer that are misssing because they are not available on this platform // We simply hide these layers to avoid confusing the Vulkan developers - if (parameter.state == LAYER_STATE_EXCLUDED) return; + if (parameter.control == LAYER_CONTROL_OFF) { + return; + } if (parameter.control != LAYER_CONTROL_APPLICATIONS && parameter.control != LAYER_CONTROL_UNORDERED) { decorated_name += " (Missing)"; @@ -245,7 +246,6 @@ class MainWindow : public QMainWindow { void DuplicateClicked(ConfigurationListItem *item); void ExportClicked(ConfigurationListItem *item); void ImportClicked(ConfigurationListItem *item); - void ReloadDefaultClicked(ConfigurationListItem *item); void AddLayerPathItem(const std::string &layer_path); void AddLayerItem(const Parameter ¶meter); @@ -286,7 +286,6 @@ class MainWindow : public QMainWindow { void on_push_button_launcher_clicked(); void on_push_button_clear_log_clicked(); - // void on_check_box_apply_list_clicked(); void on_check_box_clear_on_launch_clicked(); void on_push_button_applications_clicked(); void on_push_button_new_clicked(); @@ -323,7 +322,4 @@ class MainWindow : public QMainWindow { QStringList BuildEnvVariables() const; std::unique_ptr ui; - bool been_warned_about_old_loader; }; - -int run_gui(int argc, char *argv[]); diff --git a/vkconfig3/mainwindow.ui b/vkconfig_gui/mainwindow.ui similarity index 99% rename from vkconfig3/mainwindow.ui rename to vkconfig_gui/mainwindow.ui index 40a90ca474..219a8ae2d1 100644 --- a/vkconfig3/mainwindow.ui +++ b/vkconfig_gui/mainwindow.ui @@ -711,6 +711,9 @@ + + false + 1 @@ -923,6 +926,9 @@ + + false + 0 @@ -1069,6 +1075,9 @@ Qt::Vertical + + false + 0 diff --git a/vkconfig/resourcefiles/lunarg_logo.png b/vkconfig_gui/resourcefiles/lunarg_logo.png similarity index 100% rename from vkconfig/resourcefiles/lunarg_logo.png rename to vkconfig_gui/resourcefiles/lunarg_logo.png diff --git a/vkconfig/resourcefiles/qt_logo.png b/vkconfig_gui/resourcefiles/qt_logo.png similarity index 100% rename from vkconfig/resourcefiles/qt_logo.png rename to vkconfig_gui/resourcefiles/qt_logo.png diff --git a/vkconfig/resourcefiles/vkconfig-off.png b/vkconfig_gui/resourcefiles/vkconfig-off.png similarity index 100% rename from vkconfig/resourcefiles/vkconfig-off.png rename to vkconfig_gui/resourcefiles/vkconfig-off.png diff --git a/vkconfig/resourcefiles/vkconfig-on.png b/vkconfig_gui/resourcefiles/vkconfig-on.png similarity index 100% rename from vkconfig/resourcefiles/vkconfig-on.png rename to vkconfig_gui/resourcefiles/vkconfig-on.png diff --git a/vkconfig/resourcefiles/vkconfig.aps b/vkconfig_gui/resourcefiles/vkconfig.aps similarity index 100% rename from vkconfig/resourcefiles/vkconfig.aps rename to vkconfig_gui/resourcefiles/vkconfig.aps diff --git a/vkconfig/resourcefiles/vkconfig.rc b/vkconfig_gui/resourcefiles/vkconfig.rc similarity index 100% rename from vkconfig/resourcefiles/vkconfig.rc rename to vkconfig_gui/resourcefiles/vkconfig.rc diff --git a/vkconfig/resourcefiles/vulkan.ico b/vkconfig_gui/resourcefiles/vulkan.ico similarity index 100% rename from vkconfig/resourcefiles/vulkan.ico rename to vkconfig_gui/resourcefiles/vulkan.ico diff --git a/vkconfig3/images/vulkan_configurator.png b/vkconfig_gui/resourcefiles/vulkan_configurator.png similarity index 100% rename from vkconfig3/images/vulkan_configurator.png rename to vkconfig_gui/resourcefiles/vulkan_configurator.png diff --git a/vkconfig_gui/resources.qrc b/vkconfig_gui/resources.qrc new file mode 100644 index 0000000000..f76bcea6a2 --- /dev/null +++ b/vkconfig_gui/resources.qrc @@ -0,0 +1,22 @@ + + + resourcefiles/vulkan_configurator.png + resourcefiles/lunarg_logo.png + resourcefiles/qt_logo.png + resourcefiles/vkconfig-off.png + resourcefiles/vkconfig-on.png + + + + ../vkconfig_core/configurations/3.0.0/API dump.json + ../vkconfig_core/configurations/3.0.0/Frame Capture.json + ../vkconfig_core/configurations/3.0.0/Portability.json + ../vkconfig_core/configurations/3.0.0/Synchronization.json + ../vkconfig_core/configurations/3.0.0/Validation.json + + + + ../vkconfig_core/layers/layers_schema.json + ../vkconfig_core/layers/validusage.json + + diff --git a/vkconfig3/settings_tree.cpp b/vkconfig_gui/settings_tree.cpp similarity index 88% rename from vkconfig3/settings_tree.cpp rename to vkconfig_gui/settings_tree.cpp index 6c8149bdd5..7c0817998d 100644 --- a/vkconfig3/settings_tree.cpp +++ b/vkconfig_gui/settings_tree.cpp @@ -19,7 +19,6 @@ * - Christophe Riccio */ -#include "configurator.h" #include "settings_tree.h" #include "widget_setting.h" @@ -34,16 +33,17 @@ #include "widget_setting_list_element.h" #include "widget_setting_list.h" +#include "../vkconfig_core/configurator.h" #include "../vkconfig_core/alert.h" #include "../vkconfig_core/version.h" -#include "../vkconfig_core/platform.h" #include "../vkconfig_core/util.h" +#include "../vkconfig_core/type_platform.h" +#include "../vkconfig_core/type_hide_message.h" #include #include #include #include -#include #include @@ -62,7 +62,7 @@ void SettingsTreeManager::CreateGUI(QTreeWidget *build_tree) { this->tree = build_tree; - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); + Configuration *configuration = configurator.GetActiveConfiguration(); if (configuration == nullptr) { return; } @@ -88,10 +88,14 @@ void SettingsTreeManager::CreateGUI(QTreeWidget *build_tree) { // There will be one top level item for each layer for (std::size_t i = 0, n = configuration->parameters.size(); i < n; ++i) { Parameter ¶meter = configuration->parameters[i]; - if (!IsPlatformSupported(parameter.platform_flags)) continue; - - if (parameter.state != LAYER_STATE_OVERRIDDEN) continue; - + if (!IsPlatformSupported(parameter.platform_flags)) { + continue; + } + /* + if (parameter.control != LAYER_STATE_OVERRIDDEN) { + continue; + } + */ const std::vector &selected_layers = configurator.layers.selected_layers; const Layer *layer = FindByKey(selected_layers, parameter.key.c_str()); @@ -146,12 +150,14 @@ void SettingsTreeManager::CreateGUI(QTreeWidget *build_tree) { } void SettingsTreeManager::CleanupGUI() { - if (this->tree == nullptr) // Was not initialized + // Was not initialized + if (this->tree == nullptr) { return; + } Configurator &configurator = Configurator::Get(); - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); + Configuration *configuration = configurator.GetActiveConfiguration(); if (configuration != nullptr) { configuration->setting_tree_state.clear(); GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); @@ -164,39 +170,50 @@ void SettingsTreeManager::CleanupGUI() { void SettingsTreeManager::OnExpandedChanged(const QModelIndex &index) { (void)index; - if (this->tree == nullptr) // Was not initialized + // Was not initialized + if (this->tree == nullptr) { return; + } Configurator &configurator = Configurator::Get(); - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - configuration->setting_tree_state.clear(); - GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); - - return; + Configuration *configuration = configurator.GetActiveConfiguration(); + if (configuration != nullptr) { + configuration->setting_tree_state.clear(); + GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); + } } void SettingsTreeManager::OnCollapsedChanged(const QModelIndex &index) { (void)index; - if (this->tree == nullptr) // Was not initialized + // Was not initialized + if (this->tree == nullptr) { return; + } Configurator &configurator = Configurator::Get(); - Configuration *configuration = configurator.configurations.FindActiveConfiguration(); - configuration->setting_tree_state.clear(); - GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); - - return; + Configuration *configuration = configurator.GetActiveConfiguration(); + if (configuration != nullptr) { + configuration->setting_tree_state.clear(); + GetTreeState(configuration->setting_tree_state, this->tree->invisibleRootItem()); + } } void SettingsTreeManager::BuildTreeItem(QTreeWidgetItem *parent, Parameter ¶meter, const SettingMeta &meta_object) { - if (!IsPlatformSupported(meta_object.platform_flags)) return; - if (meta_object.view == SETTING_VIEW_HIDDEN) return; - if (meta_object.view == SETTING_VIEW_ADVANCED && - !Configurator::Get().configurations.FindActiveConfiguration()->view_advanced_settings) + if (!IsPlatformSupported(meta_object.platform_flags)) { return; + } + + if (meta_object.view == SETTING_VIEW_HIDDEN) { + return; + } + + Configurator &configurator = Configurator::Get(); + if (meta_object.view == SETTING_VIEW_ADVANCED && !configurator.GetActiveConfiguration()->view_advanced_settings) { + return; + } QTreeWidgetItem *item = new QTreeWidgetItem(); item->setSizeHint(0, QSize(0, ITEM_HEIGHT)); @@ -356,6 +373,8 @@ void SettingsTreeManager::OnPresetChanged() { this->Refresh(REFRESH_ENABLE_AND_S void SettingsTreeManager::OnSettingChanged() { this->Refresh(REFRESH_ENABLE_ONLY); } void SettingsTreeManager::Refresh(RefreshAreas refresh_areas) { + Configurator &configurator = Configurator::Get(); + this->tree->blockSignals(true); QTreeWidgetItem *root_item = this->tree->invisibleRootItem(); @@ -366,17 +385,15 @@ void SettingsTreeManager::Refresh(RefreshAreas refresh_areas) { this->tree->blockSignals(false); if (this->launched_application) { - QSettings settings; - if (!settings.value(VKCONFIG_KEY_MESSAGE_NEED_APPLICATION_RESTART, false).toBool()) { - settings.setValue(VKCONFIG_KEY_MESSAGE_NEED_APPLICATION_RESTART, true); + if (!(configurator.environment.hide_message_boxes_flags & GetBit(HIDE_MESSAGE_NEED_APPLICATION_RESTART))) { + configurator.environment.hide_message_boxes_flags |= GetBit(HIDE_MESSAGE_NEED_APPLICATION_RESTART); Alert::ConfiguratorRestart(); } } // Refresh layer configuration - Configurator &configurator = Configurator::Get(); - configurator.configurations.Configure(configurator.layers.selected_layers); + configurator.Override(); } void SettingsTreeManager::RefreshItem(RefreshAreas refresh_areas, QTreeWidgetItem *parent) { diff --git a/vkconfig3/settings_tree.h b/vkconfig_gui/settings_tree.h similarity index 100% rename from vkconfig3/settings_tree.h rename to vkconfig_gui/settings_tree.h diff --git a/vkconfig/vkconfig.entitlements b/vkconfig_gui/vkconfig.entitlements similarity index 100% rename from vkconfig/vkconfig.entitlements rename to vkconfig_gui/vkconfig.entitlements diff --git a/vkconfig3/vkconfig.pro b/vkconfig_gui/vkconfig.pro similarity index 79% rename from vkconfig3/vkconfig.pro rename to vkconfig_gui/vkconfig.pro index 9d07202c31..21c48e7ec7 100644 --- a/vkconfig3/vkconfig.pro +++ b/vkconfig_gui/vkconfig.pro @@ -2,7 +2,7 @@ QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets network -CONFIG += c++11 +CONFIG += c++17 CONFIG += sdk_no_version_check INCLUDEPATH += ../external/Vulkan-Headers/include @@ -30,11 +30,15 @@ SOURCES += \ ../vkconfig_core/alert.cpp \ ../vkconfig_core/application.cpp \ ../vkconfig_core/application_singleton.cpp \ + ../vkconfig_core/bitfield.cpp \ ../vkconfig_core/command_line.cpp \ ../vkconfig_core/configuration.cpp \ + ../vkconfig_core/configuration_info.cpp \ ../vkconfig_core/configuration_manager.cpp \ - ../vkconfig_core/doc.cpp \ + ../vkconfig_core/configurator.cpp \ + ../vkconfig_core/configurator_signal.cpp \ ../vkconfig_core/date.cpp \ + ../vkconfig_core/doc.cpp \ ../vkconfig_core/environment.cpp \ ../vkconfig_core/header.cpp \ ../vkconfig_core/help.cpp \ @@ -43,13 +47,8 @@ SOURCES += \ ../vkconfig_core/layer.cpp \ ../vkconfig_core/layer_manager.cpp \ ../vkconfig_core/layer_preset.cpp \ - ../vkconfig_core/layer_state.cpp \ - ../vkconfig_core/layer_type.cpp \ - ../vkconfig_core/override.cpp \ ../vkconfig_core/parameter.cpp \ ../vkconfig_core/path.cpp \ - ../vkconfig_core/path_manager.cpp \ - ../vkconfig_core/platform.cpp \ ../vkconfig_core/registry.cpp \ ../vkconfig_core/setting.cpp \ ../vkconfig_core/setting_bool.cpp \ @@ -61,9 +60,19 @@ SOURCES += \ ../vkconfig_core/setting_int.cpp \ ../vkconfig_core/setting_list.cpp \ ../vkconfig_core/setting_string.cpp \ + ../vkconfig_core/type_hide_message.cpp \ + ../vkconfig_core/type_layer_control.cpp \ + ../vkconfig_core/type_layer_type.cpp \ + ../vkconfig_core/type_layers_mode.cpp \ + ../vkconfig_core/type_log.cpp \ + ../vkconfig_core/type_platform.cpp \ + ../vkconfig_core/type_status.cpp \ + ../vkconfig_core/type_tab.cpp \ + ../vkconfig_core/type_update.cpp \ ../vkconfig_core/util.cpp \ ../vkconfig_core/version.cpp \ - vulkan_util.cpp \ + ../vkconfig_core/vulkan_info.cpp \ + ../vkconfig_core/vulkan_util.cpp \ widget_preset.cpp \ widget_setting.cpp \ widget_setting_bool.cpp \ @@ -77,28 +86,25 @@ SOURCES += \ widget_setting_list_element.cpp \ widget_setting_list.cpp \ widget_tree_friendly_combobox.cpp \ - dialog_applications.cpp \ dialog_vulkan_analysis.cpp \ dialog_vulkan_info.cpp \ main.cpp \ - main_gui.cpp \ - main_signal.cpp \ - main_reset.cpp \ - main_layers.cpp \ - main_doc.cpp \ mainwindow.cpp \ - settings_tree.cpp \ - configurator.cpp + settings_tree.cpp HEADERS += \ ../vkconfig_core/alert.h \ ../vkconfig_core/application.h \ ../vkconfig_core/application_singleton.h \ + ../vkconfig_core/bitfield.h \ ../vkconfig_core/command_line.h \ ../vkconfig_core/configuration.h \ + ../vkconfig_core/configuration_info.h \ ../vkconfig_core/configuration_manager.h \ - ../vkconfig_core/doc.h \ + ../vkconfig_core/configurator.h \ + ../vkconfig_core/configurator_signal.h \ ../vkconfig_core/date.h \ + ../vkconfig_core/doc.h \ ../vkconfig_core/environment.h \ ../vkconfig_core/header.h \ ../vkconfig_core/help.h \ @@ -107,13 +113,8 @@ HEADERS += \ ../vkconfig_core/layer.h \ ../vkconfig_core/layer_manager.h \ ../vkconfig_core/layer_preset.h \ - ../vkconfig_core/layer_state.h \ - ../vkconfig_core/layer_type.h \ - ../vkconfig_core/override.h \ ../vkconfig_core/parameter.h \ ../vkconfig_core/path.h \ - ../vkconfig_core/path_manager.h \ - ../vkconfig_core/platform.h \ ../vkconfig_core/registry.h \ ../vkconfig_core/setting.h \ ../vkconfig_core/setting_bool.h \ @@ -125,9 +126,19 @@ HEADERS += \ ../vkconfig_core/setting_int.h \ ../vkconfig_core/setting_list.h \ ../vkconfig_core/setting_string.h \ + ../vkconfig_core/type_hide_message.h \ + ../vkconfig_core/type_layer_control.h \ + ../vkconfig_core/type_layer_type.h \ + ../vkconfig_core/type_layers_mode.h \ + ../vkconfig_core/type_log.h \ + ../vkconfig_core/type_platform.h \ + ../vkconfig_core/type_status.h \ + ../vkconfig_core/type_tab.h \ + ../vkconfig_core/type_update.h \ ../vkconfig_core/util.h \ ../vkconfig_core/version.h \ - vulkan_util.h \ + ../vkconfig_core/vulkan_info.h \ + ../vkconfig_core/vulkan_util.h \ widget_preset.h \ widget_setting.h \ widget_setting_bool.h \ @@ -141,20 +152,12 @@ HEADERS += \ widget_setting_list_element.h \ widget_setting_list.h \ widget_tree_friendly_combobox.h \ - dialog_applications.h \ dialog_vulkan_analysis.h \ dialog_vulkan_info.h \ - main_gui.h \ - main_signal.h \ - main_reset.h \ - main_layers.h \ - main_doc.h \ mainwindow.h \ - settings_tree.h \ - configurator.h + settings_tree.h FORMS += \ - dialog_applications.ui \ dialog_vulkan_analysis.ui \ dialog_vulkan_info.ui \ mainwindow.ui diff --git a/vkconfig/widget_preset.cpp b/vkconfig_gui/widget_preset.cpp similarity index 100% rename from vkconfig/widget_preset.cpp rename to vkconfig_gui/widget_preset.cpp diff --git a/vkconfig/widget_preset.h b/vkconfig_gui/widget_preset.h similarity index 100% rename from vkconfig/widget_preset.h rename to vkconfig_gui/widget_preset.h diff --git a/vkconfig3/widget_setting.cpp b/vkconfig_gui/widget_setting.cpp similarity index 100% rename from vkconfig3/widget_setting.cpp rename to vkconfig_gui/widget_setting.cpp diff --git a/vkconfig/widget_setting.h b/vkconfig_gui/widget_setting.h similarity index 100% rename from vkconfig/widget_setting.h rename to vkconfig_gui/widget_setting.h diff --git a/vkconfig/widget_setting_bool.cpp b/vkconfig_gui/widget_setting_bool.cpp similarity index 100% rename from vkconfig/widget_setting_bool.cpp rename to vkconfig_gui/widget_setting_bool.cpp diff --git a/vkconfig/widget_setting_bool.h b/vkconfig_gui/widget_setting_bool.h similarity index 100% rename from vkconfig/widget_setting_bool.h rename to vkconfig_gui/widget_setting_bool.h diff --git a/vkconfig/widget_setting_enum.cpp b/vkconfig_gui/widget_setting_enum.cpp similarity index 83% rename from vkconfig/widget_setting_enum.cpp rename to vkconfig_gui/widget_setting_enum.cpp index ff838de327..396e6ee6c8 100644 --- a/vkconfig/widget_setting_enum.cpp +++ b/vkconfig_gui/widget_setting_enum.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ #include "widget_setting_enum.h" #include "widget_setting.h" -#include "configurator.h" +#include "../vkconfig_core/configurator.h" #include "../vkconfig_core/setting_filesystem.h" #include @@ -109,20 +109,20 @@ void WidgetSettingEnum::Refresh(RefreshAreas refresh_areas) { this->field->clear(); this->enum_indexes.clear(); - const std::vector& devices = Configurator::Get().GetDeviceNames(); + const std::vector& physical_device_infos = Configurator::Get().vulkan_system_info.physicalDevices; int selection = 0; const std::string value = this->data().GetValue(); - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - this->field->addItem(devices[i].c_str()); - if (devices[i] == value || "${VP_PHYSICAL_DEVICES}" == value) { - this->data().SetValue(devices[i].c_str()); + for (std::size_t i = 0, n = physical_device_infos.size(); i < n; ++i) { + this->field->addItem(physical_device_infos[i].deviceName.c_str()); + if (physical_device_infos[i].deviceName == value || "${VP_PHYSICAL_DEVICES}" == value) { + this->data().SetValue(physical_device_infos[i].deviceName.c_str()); selection = static_cast(this->enum_indexes.size()); } this->enum_indexes.push_back(i); } this->field->setCurrentIndex(selection); - if (!devices.empty()) { + if (!physical_device_infos.empty()) { OnIndexChanged(selection); } } else if (refresh_areas == REFRESH_ENABLE_AND_STATE) { @@ -137,7 +137,9 @@ void WidgetSettingEnum::Refresh(RefreshAreas refresh_areas) { const std::string value = this->data().GetValue(); for (std::size_t i = 0, n = this->meta.enum_values.size(); i < n; ++i) { - if (!IsSupported(&this->meta.enum_values[i])) continue; + if (!IsSupported(&this->meta.enum_values[i])) { + continue; + } this->field->addItem(this->meta.enum_values[i].label.c_str()); if (this->meta.enum_values[i].key == value) { @@ -168,9 +170,9 @@ void WidgetSettingEnum::Resize() { width = std::max(width, HorizontalAdvance(fm, (profiles[i] + "0000").c_str())); } } else if (meta.default_value == "${VP_PHYSICAL_DEVICES}") { - const std::vector& devices = Configurator::Get().GetDeviceNames(); - for (std::size_t i = 0, n = devices.size(); i < n; ++i) { - width = std::max(width, HorizontalAdvance(fm, (devices[i] + "000").c_str())); + const std::vector& physical_device_infos = Configurator::Get().vulkan_system_info.physicalDevices; + for (std::size_t i = 0, n = physical_device_infos.size(); i < n; ++i) { + width = std::max(width, HorizontalAdvance(fm, (physical_device_infos[i].deviceName + std::string("000")).c_str())); } } else { for (std::size_t i = 0, n = this->meta.enum_values.size(); i < n; ++i) { @@ -200,11 +202,11 @@ void WidgetSettingEnum::OnIndexChanged(int index) { this->data().SetValue(profiles[index].c_str()); this->setToolTip(profiles[index].c_str()); } else if (meta.default_value == "${VP_PHYSICAL_DEVICES}") { - const std::vector& devices = Configurator::Get().GetDeviceNames(); - assert(index >= 0 && index < static_cast(devices.size())); + const std::vector& physical_device_infos = Configurator::Get().vulkan_system_info.physicalDevices; + assert(index >= 0 && index < static_cast(physical_device_infos.size())); - this->data().SetValue(devices[index].c_str()); - this->setToolTip(devices[index].c_str()); + this->data().SetValue(physical_device_infos[index].deviceName.c_str()); + this->setToolTip(physical_device_infos[index].deviceName.c_str()); } else { assert(index >= 0 && index < static_cast(this->meta.enum_values.size())); diff --git a/vkconfig/widget_setting_enum.h b/vkconfig_gui/widget_setting_enum.h similarity index 100% rename from vkconfig/widget_setting_enum.h rename to vkconfig_gui/widget_setting_enum.h diff --git a/vkconfig/widget_setting_filesystem.cpp b/vkconfig_gui/widget_setting_filesystem.cpp similarity index 69% rename from vkconfig/widget_setting_filesystem.cpp rename to vkconfig_gui/widget_setting_filesystem.cpp index 727b0ceaa8..1cb1616ccf 100644 --- a/vkconfig/widget_setting_filesystem.cpp +++ b/vkconfig_gui/widget_setting_filesystem.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ #include "../vkconfig_core/path.h" #include "../vkconfig_core/alert.h" -#include "../vkconfig/configurator.h" +#include "../vkconfig_core/configurator.h" #include @@ -73,13 +73,11 @@ void WidgetSettingFilesystem::Refresh(RefreshAreas refresh_areas) { LoadPath(this->data().GetValue()); this->field->blockSignals(true); - this->field->setText(this->data().GetValue()); - this->field->setToolTip(ReplaceBuiltInVariable(this->data().GetValue()).c_str()); + this->field->setText(this->data().GetValue().RelativePath().c_str()); + this->field->setToolTip(this->data().GetValue().AbsolutePath().c_str()); if (::CheckSettingOverridden(this->meta)) { this->DisplayOverride(this->field, this->meta); - } else { - this->field->setToolTip(ReplaceBuiltInVariable(this->field->text().toStdString()).c_str()); } this->field->blockSignals(false); @@ -93,15 +91,17 @@ void WidgetSettingFilesystem::resizeEvent(QResizeEvent* event) { this->button->setGeometry(button_rect); } -void WidgetSettingFilesystem::LoadPath(const std::string& path) { +void WidgetSettingFilesystem::LoadPath(const Path& path) { switch (this->meta.type) { case SETTING_LOAD_FILE: { const SettingMetaFileLoad& setting_meta = static_cast(this->meta); if (setting_meta.format == "PROFILE") { - if (path.empty()) return; + if (path.Empty()) { + return; + } SettingDataFileLoad& file_setting_data = static_cast(this->data()); - file_setting_data.profile_names = GetProfileNamesFromFile(path); + file_setting_data.profile_names = CollectProfileNamesFromFile(path); SettingDataString* enum_setting_data = FindSetting(this->data_set, "profile_name"); if (!file_setting_data.profile_names.empty() && enum_setting_data != nullptr) { @@ -115,10 +115,12 @@ void WidgetSettingFilesystem::LoadPath(const std::string& path) { case SETTING_LOAD_FOLDER: { const SettingMetaFolderLoad& setting_meta = static_cast(this->meta); if (setting_meta.format == "PROFILE") { - if (path.empty()) return; + if (path.Empty()) { + return; + } SettingDataFolderLoad& setting_data = static_cast(this->data()); - setting_data.profile_names = GetProfileNamesFromDir(path); + setting_data.profile_names = CollectProfileNamesFromDir(path); SettingDataString* enum_setting_data = FindSetting(this->data_set, "profile_name"); if (enum_setting_data != nullptr) { @@ -136,29 +138,29 @@ void WidgetSettingFilesystem::LoadPath(const std::string& path) { } void WidgetSettingFilesystem::browseButtonClicked() { - std::string path = field->text().toStdString(); - if (path.empty()) { - path = "${VK_LOCAL}"; - this->data().SetValue(path.c_str()); + Path path(this->field->text().toStdString()); + if (path.Empty()) { + path = Path("${VK_HOME}"); + this->data().SetValue(path); } switch (this->meta.type) { case SETTING_LOAD_FILE: case SETTING_SAVE_FILE: - if (!QFileInfo(ReplaceBuiltInVariable(path).c_str()).absoluteDir().exists()) { + if (!path.Exists()) { path = this->data().GetValue(); } - if (!QFileInfo(ReplaceBuiltInVariable(path).c_str()).absoluteDir().exists()) { - path.clear(); + if (!path.Exists()) { + path.Clear(); } break; case SETTING_LOAD_FOLDER: case SETTING_SAVE_FOLDER: - if (!QFileInfo(ReplaceBuiltInVariable(path).c_str()).exists()) { + if (!path.Exists()) { path = this->data().GetValue(); } - if (!QFileInfo(ReplaceBuiltInVariable(path).c_str()).exists()) { - path.clear(); + if (!path.Exists()) { + path.Clear(); } break; default: @@ -166,22 +168,22 @@ void WidgetSettingFilesystem::browseButtonClicked() { break; } - const std::string replaced_path = ReplaceBuiltInVariable(path); - const std::string dir = QFileInfo(replaced_path.c_str()).absoluteDir().absolutePath().toStdString(); + const std::string replaced_path = path.AbsolutePath(); + const std::string dir = path.AbsoluteDir(); const char* filter = this->meta.filter.c_str(); - std::string new_path; + Path new_path; switch (this->meta.type) { case SETTING_LOAD_FILE: - new_path = QFileDialog::getOpenFileName(this->button, "Select file", dir.c_str(), filter).toStdString(); + new_path = Path(QFileDialog::getOpenFileName(this->button, "Select file", dir.c_str(), filter).toStdString()); break; case SETTING_SAVE_FILE: - new_path = QFileDialog::getSaveFileName(this->button, "Select File", dir.c_str(), filter).toStdString(); + new_path = Path(QFileDialog::getSaveFileName(this->button, "Select File", dir.c_str(), filter).toStdString()); break; case SETTING_LOAD_FOLDER: case SETTING_SAVE_FOLDER: - new_path = QFileDialog::getExistingDirectory(this->button, "Select Folder", replaced_path.c_str()).toStdString(); + new_path = Path(QFileDialog::getExistingDirectory(this->button, "Select Folder", replaced_path.c_str()).toStdString()); break; default: assert(0); @@ -189,19 +191,17 @@ void WidgetSettingFilesystem::browseButtonClicked() { } // The user has cancel the operation - if (new_path.empty()) { + if (new_path.Empty()) { return; } - new_path = ConvertNativeSeparators(new_path); - // The path didn't change, preserve the built-in variables - if (replaced_path != new_path) { - this->data().SetValue(new_path.c_str()); + if (replaced_path != new_path.AbsolutePath().c_str()) { + this->data().SetValue(new_path); } - this->field->setText(this->data().GetValue()); - this->field->setToolTip(ReplaceBuiltInVariable(this->field->text().toStdString()).c_str()); + this->field->setText(this->data().GetValue().RelativePath().c_str()); + this->field->setToolTip(new_path.AbsolutePath().c_str()); LoadPath(new_path); @@ -209,26 +209,22 @@ void WidgetSettingFilesystem::browseButtonClicked() { } void WidgetSettingFilesystem::textFieldChanged(const QString& value) { - std::string file = value.toStdString(); + Path file(value.toStdString()); - if (!file.empty()) { + if (!file.Empty()) { LoadPath(file); - - if (VKC_ENV == VKC_ENV_WIN32) { - file = ConvertNativeSeparators(file); - } } - if (QFileInfo(ReplaceBuiltInVariable(file).c_str()).exists()) { - this->data().SetValue(file.c_str()); - this->field->setToolTip(ReplaceBuiltInVariable(file.c_str()).c_str()); + if (file.Exists()) { + this->data().SetValue(file); + this->field->setToolTip(file.AbsolutePath().c_str()); } emit itemChanged(); } -SettingDataString& WidgetSettingFilesystem::data() { - SettingDataString* data = FindSetting(this->data_set, this->meta.key.c_str()); +SettingDataFilesystem& WidgetSettingFilesystem::data() { + SettingDataFilesystem* data = FindSetting(this->data_set, this->meta.key.c_str()); assert(data != nullptr); return *data; } diff --git a/vkconfig/widget_setting_filesystem.h b/vkconfig_gui/widget_setting_filesystem.h similarity index 88% rename from vkconfig/widget_setting_filesystem.h rename to vkconfig_gui/widget_setting_filesystem.h index 6d82e368da..6a60e9728c 100644 --- a/vkconfig/widget_setting_filesystem.h +++ b/vkconfig_gui/widget_setting_filesystem.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #pragma once #include "../vkconfig_core/setting_filesystem.h" +#include "../vkconfig_core/path.h" #include "widget_setting.h" @@ -49,8 +50,8 @@ class WidgetSettingFilesystem : public WidgetSettingBase { void resizeEvent(QResizeEvent *event) override; private: - SettingDataString &data(); - void LoadPath(const std::string &path); + SettingDataFilesystem &data(); + void LoadPath(const Path &path); const SettingMetaFilesystem &meta; SettingDataSet &data_set; diff --git a/vkconfig/widget_setting_flags.cpp b/vkconfig_gui/widget_setting_flags.cpp similarity index 100% rename from vkconfig/widget_setting_flags.cpp rename to vkconfig_gui/widget_setting_flags.cpp diff --git a/vkconfig/widget_setting_flags.h b/vkconfig_gui/widget_setting_flags.h similarity index 100% rename from vkconfig/widget_setting_flags.h rename to vkconfig_gui/widget_setting_flags.h diff --git a/vkconfig3/widget_setting_float.cpp b/vkconfig_gui/widget_setting_float.cpp similarity index 94% rename from vkconfig3/widget_setting_float.cpp rename to vkconfig_gui/widget_setting_float.cpp index 2cab7e00c1..a9e4ae8eaa 100644 --- a/vkconfig3/widget_setting_float.cpp +++ b/vkconfig_gui/widget_setting_float.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,12 @@ #include "widget_setting_float.h" +#include "../vkconfig_core/configurator.h" +#include "../vkconfig_core/type_hide_message.h" + #include #include #include -#include #include @@ -96,8 +98,9 @@ void WidgetSettingFloat::OnErrorValue() { palette.setColor(QPalette::Base, QColor(255, 192, 192)); this->field->setPalette(palette); - QSettings settings; - if (settings.value("VKCONFIG_WIDGET_SETTING_FLOAT").toBool() == false) { + Environment& environment = Configurator::Get().environment; + + if (!(environment.hide_message_boxes_flags & GetBit(HIDE_MESSAGE_WIDGET_SETTING_FLOAT))) { const std::string float_format = this->meta.GetFloatFormat(); const std::string info = format("Do you want to reset to the setting default value? '%s'", float_format.c_str()); const std::string range = this->meta.HasRange() @@ -145,7 +148,7 @@ void WidgetSettingFloat::OnErrorValue() { this->Resize(); } if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WIDGET_SETTING_FLOAT", true); + environment.hide_message_boxes_flags |= GetBit(HIDE_MESSAGE_WIDGET_SETTING_FLOAT); } } diff --git a/vkconfig/widget_setting_float.h b/vkconfig_gui/widget_setting_float.h similarity index 100% rename from vkconfig/widget_setting_float.h rename to vkconfig_gui/widget_setting_float.h diff --git a/vkconfig3/widget_setting_frames.cpp b/vkconfig_gui/widget_setting_frames.cpp similarity index 92% rename from vkconfig3/widget_setting_frames.cpp rename to vkconfig_gui/widget_setting_frames.cpp index b9276dd73d..340fa12046 100644 --- a/vkconfig3/widget_setting_frames.cpp +++ b/vkconfig_gui/widget_setting_frames.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,14 @@ */ #include "widget_setting_frames.h" -#include "widget_setting.h" +#include "../vkconfig_core/configurator.h" #include "../vkconfig_core/util.h" +#include "../vkconfig_core/type_hide_message.h" #include #include #include -#include #include @@ -94,8 +94,9 @@ void WidgetSettingFrames::OnErrorValue() { palette.setColor(QPalette::Base, QColor(255, 192, 192)); this->field->setPalette(palette); - QSettings settings; - if (settings.value("VKCONFIG_WIDGET_SETTING_FRAMES").toBool() == false) { + Environment& environment = Configurator::Get().environment; + + if (!(environment.hide_message_boxes_flags & GetBit(HIDE_MESSAGE_WIDGET_SETTING_FRAMES))) { const std::string text = format("The setting input '%s' is invalid. Use list of comma separated integer ranges. Example: '0-2,16'.", this->data().GetValue()); @@ -117,7 +118,7 @@ void WidgetSettingFrames::OnErrorValue() { this->Resize(); } if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WIDGET_SETTING_FRAMES", true); + environment.hide_message_boxes_flags |= GetBit(HIDE_MESSAGE_WIDGET_SETTING_FRAMES); } } diff --git a/vkconfig/widget_setting_frames.h b/vkconfig_gui/widget_setting_frames.h similarity index 100% rename from vkconfig/widget_setting_frames.h rename to vkconfig_gui/widget_setting_frames.h diff --git a/vkconfig3/widget_setting_int.cpp b/vkconfig_gui/widget_setting_int.cpp similarity index 93% rename from vkconfig3/widget_setting_int.cpp rename to vkconfig_gui/widget_setting_int.cpp index 63603d1c02..048a6e3563 100644 --- a/vkconfig3/widget_setting_int.cpp +++ b/vkconfig_gui/widget_setting_int.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2021 Valve Corporation - * Copyright (c) 2020-2021 LunarG, Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,12 @@ #include "widget_setting_int.h" +#include "../vkconfig_core/configurator.h" +#include "../vkconfig_core/type_hide_message.h" + #include #include #include -#include #include @@ -93,8 +95,9 @@ void WidgetSettingInt::OnErrorValue() { palette.setColor(QPalette::Base, QColor(255, 192, 192)); this->field->setPalette(palette); - QSettings settings; - if (settings.value("VKCONFIG_WIDGET_SETTING_INT").toBool() == false) { + Environment& environment = Configurator::Get().environment; + + if (!(environment.hide_message_boxes_flags & GetBit(HIDE_MESSAGE_WIDGET_SETTING_INT))) { const std::string info = format("Do you want to reset to the setting default value? '%d'", this->meta.default_value); const std::string range = format("Enter a number in the range [%d, %d].", this->meta.min_value, this->meta.max_value); @@ -134,7 +137,7 @@ void WidgetSettingInt::OnErrorValue() { this->Resize(); } if (alert.checkBox()->isChecked()) { - settings.setValue("VKCONFIG_WIDGET_SETTING_INT", true); + environment.hide_message_boxes_flags |= GetBit(HIDE_MESSAGE_WIDGET_SETTING_INT); } } diff --git a/vkconfig/widget_setting_int.h b/vkconfig_gui/widget_setting_int.h similarity index 100% rename from vkconfig/widget_setting_int.h rename to vkconfig_gui/widget_setting_int.h diff --git a/vkconfig/widget_setting_list.cpp b/vkconfig_gui/widget_setting_list.cpp similarity index 100% rename from vkconfig/widget_setting_list.cpp rename to vkconfig_gui/widget_setting_list.cpp diff --git a/vkconfig/widget_setting_list.h b/vkconfig_gui/widget_setting_list.h similarity index 100% rename from vkconfig/widget_setting_list.h rename to vkconfig_gui/widget_setting_list.h diff --git a/vkconfig/widget_setting_list_element.cpp b/vkconfig_gui/widget_setting_list_element.cpp similarity index 100% rename from vkconfig/widget_setting_list_element.cpp rename to vkconfig_gui/widget_setting_list_element.cpp diff --git a/vkconfig/widget_setting_list_element.h b/vkconfig_gui/widget_setting_list_element.h similarity index 100% rename from vkconfig/widget_setting_list_element.h rename to vkconfig_gui/widget_setting_list_element.h diff --git a/vkconfig/widget_setting_string.cpp b/vkconfig_gui/widget_setting_string.cpp similarity index 100% rename from vkconfig/widget_setting_string.cpp rename to vkconfig_gui/widget_setting_string.cpp diff --git a/vkconfig/widget_setting_string.h b/vkconfig_gui/widget_setting_string.h similarity index 100% rename from vkconfig/widget_setting_string.h rename to vkconfig_gui/widget_setting_string.h diff --git a/vkconfig3/widget_tree_friendly_combobox.cpp b/vkconfig_gui/widget_tree_friendly_combobox.cpp similarity index 100% rename from vkconfig3/widget_tree_friendly_combobox.cpp rename to vkconfig_gui/widget_tree_friendly_combobox.cpp diff --git a/vkconfig3/widget_tree_friendly_combobox.h b/vkconfig_gui/widget_tree_friendly_combobox.h similarity index 100% rename from vkconfig3/widget_tree_friendly_combobox.h rename to vkconfig_gui/widget_tree_friendly_combobox.h