Skip to content

Commit

Permalink
vkconfig3: Requires Vulkan Loader 301
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Nov 14, 2024
1 parent ab07474 commit 5648dcb
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions vkconfig_cmd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ int main(int argc, char* argv[]) {
return -1;
}

if (vulkan_info.loaderVersion < REQUIRED_LOADER_VERSION) {
if (vulkan_info.loaderVersion < Version::REQUIRED_LOADER_VERSION) {
fprintf(stderr,
"%s: [ERROR] The system has Vulkan Loader version %s but version %s is requered. Please update the Vulkan Runtime "
"at https://vulkan.lunarg.com/sdk/home",
VKCONFIG_SHORT_NAME, vulkan_info.loaderVersion.str().c_str(), REQUIRED_LOADER_VERSION.str().c_str());
VKCONFIG_SHORT_NAME, vulkan_info.loaderVersion.str().c_str(), Version::REQUIRED_LOADER_VERSION.str().c_str());
return -1;
}

Expand Down
4 changes: 2 additions & 2 deletions vkconfig_core/alert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ void Alert::StartLoaderFailure() {
void Alert::StartLoaderIncompatibleVersions(const Version& system_loader_version, const Version& required_loader_version) {
QMessageBox alert;
alert.setWindowTitle("Vulkan Configurator failed to start...");
alert.setText(format("The system has Vulkan Loader version % s but version %s is requered.",
alert.setText(format("The system has Vulkan Loader version % s but version %s is requered. Please update the Vulkan Runtime.",
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.setInformativeText("<a href=\"https://vulkan.lunarg.com/sdk/home\">https://vulkan.lunarg.com/sdk/home</a>");
alert.setIcon(QMessageBox::Critical);
alert.exec();
}
Expand Down
2 changes: 1 addition & 1 deletion vkconfig_core/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void AddApplicationEnabledParameters(std::vector<Parameter>& parameters,
Parameter applications_enabled_layers;
applications_enabled_layers.key = ::GetLabel(LAYER_BUILTIN_UNORDERED);
applications_enabled_layers.builtin = LAYER_BUILTIN_UNORDERED;
applications_enabled_layers.control = LAYER_CONTROL_DISCARD; // Until the Vulkan Loader is fixed
applications_enabled_layers.control = default_control;
applications_enabled_layers.overridden_rank = Parameter::NO_RANK;
parameters.push_back(applications_enabled_layers);
}
Expand Down
6 changes: 5 additions & 1 deletion vkconfig_core/executable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ bool Executable::RemoveActiveOptions() {

std::swap(new_options, this->options_list);

this->active_options = this->options_list[std::max<int>(executable_index - 1, 0)].label;
if (this->options_list.empty()) {
this->active_options.clear();
} else {
this->active_options = this->options_list[std::max<int>(executable_index - 1, 0)].label;
}

return removed;
}
Expand Down
10 changes: 10 additions & 0 deletions vkconfig_core/test/test_executable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ TEST(test_executable, ctor_path) {
EXPECT_STREQ(Path("${VK_HOME}/vkcube.txt").RelativePath().c_str(), options->log_file.RelativePath().c_str());
}

TEST(test_executable, remove_last) {
Executable executable("./vkcube");
EXPECT_EQ(1, executable.GetOptions().size());
EXPECT_EQ(0, executable.GetActiveOptionsIndex());

EXPECT_EQ(true, executable.RemoveActiveOptions());
EXPECT_EQ(0, executable.GetOptions().size());
EXPECT_EQ(Executable::INVALID_OPTIONS, executable.GetActiveOptionsIndex());
}

TEST(test_executable, duplicate) {
Executable executable("./vkcube");
EXPECT_EQ(1, executable.GetOptions().size());
Expand Down
1 change: 1 addition & 0 deletions vkconfig_core/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Version Version::VKCONFIG(3, 0, 0);
const Version Version::VKHEADER(VK_HEADER_VERSION_COMPLETE);
const Version Version::NONE(0, 0, 0);
const Version Version::LATEST(~0, ~0, ~0);
const Version Version::REQUIRED_LOADER_VERSION(1, 3, 301);

const char *VKCONFIG_NAME = "Vulkan Configurator";
const char *VKCONFIG_SHORT_NAME = "vkconfig";
Expand Down
1 change: 1 addition & 0 deletions vkconfig_core/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Version {
static const Version VKHEADER;
static const Version NONE;
static const Version LATEST;
static const Version REQUIRED_LOADER_VERSION;

explicit Version() : _major(0), _minor(0), _patch(0) {}
explicit Version(uint32_t version_complete);
Expand Down
2 changes: 0 additions & 2 deletions vkconfig_core/vulkan_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <sstream>
#include <iostream>

const Version REQUIRED_LOADER_VERSION(1, 3, 284);

static std::string GetUUIDString(const uint8_t deviceUUID[VK_UUID_SIZE]) {
std::string result;

Expand Down
2 changes: 0 additions & 2 deletions vkconfig_core/vulkan_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include <string>
#include <vector>

extern const Version REQUIRED_LOADER_VERSION;

enum VendorID {
VENDOR_ID_KHRONOS = VK_VENDOR_ID_KHRONOS,
VENDOR_ID_MESA = VK_VENDOR_ID_MESA,
Expand Down
4 changes: 2 additions & 2 deletions vkconfig_gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ int main(int argc, char* argv[]) {
return -1;
}

if (configurator.vulkan_system_info.loaderVersion < REQUIRED_LOADER_VERSION) {
Alert::StartLoaderIncompatibleVersions(configurator.vulkan_system_info.loaderVersion, REQUIRED_LOADER_VERSION);
if (configurator.vulkan_system_info.loaderVersion < Version::REQUIRED_LOADER_VERSION) {
Alert::StartLoaderIncompatibleVersions(configurator.vulkan_system_info.loaderVersion, Version::REQUIRED_LOADER_VERSION);
return -1;
}

Expand Down

0 comments on commit 5648dcb

Please sign in to comment.