aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorlat9nq <lat9nq@gmail.com>2022-07-10 16:10:35 -0400
committerlat9nq <lat9nq@gmail.com>2022-07-10 16:52:00 -0400
commit33abdfff9bf0a549b0d1d327e914e9a1ab4b799b (patch)
tree60b91393706a3ddec37f10395a7fe1e3d69c20ad /src/yuzu/main.cpp
parent4f15d9ed6fba4fa1804c5be3f9378e3ad3d32688 (diff)
yuzu: Simplify broken Vulkan handling
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index f2e449560f..a2b11fdbf4 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -252,7 +252,7 @@ static QString PrettyProductName() {
return QSysInfo::prettyProductName();
}
-GMainWindow::GMainWindow()
+GMainWindow::GMainWindow(bool has_broken_vulkan)
: ui{std::make_unique<Ui::MainWindow>()}, system{std::make_unique<Core::System>()},
input_subsystem{std::make_shared<InputCommon::InputSubsystem>()},
config{std::make_unique<Config>(*system)},
@@ -352,17 +352,15 @@ GMainWindow::GMainWindow()
MigrateConfigFiles();
- if (!CheckVulkan()) {
- config->Save();
+ if (has_broken_vulkan) {
+ UISettings::values.has_broken_vulkan = true;
+
+ QMessageBox::warning(this, tr("Broken Vulkan Installation Detected"),
+ tr("Vulkan initialization failed during boot.<br><br>Click <a "
+ "href='https://yuzu-emu.org/wiki/faq/"
+ "#yuzu-starts-with-the-error-broken-vulkan-installation-detected'>"
+ "here for instructions to fix the issue</a>."));
- QMessageBox::warning(
- this, tr("Broken Vulkan Installation Detected"),
- tr("Vulkan initialization failed on the previous boot.<br><br>Click <a "
- "href='https://yuzu-emu.org/wiki/faq/"
- "#yuzu-starts-with-the-error-broken-vulkan-installation-detected'>here for "
- "instructions to fix the issue</a>."));
- }
- if (UISettings::values.has_broken_vulkan) {
Settings::values.renderer_backend = Settings::RendererBackend::OpenGL;
renderer_status_button->setDisabled(true);
@@ -3853,17 +3851,17 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
#endif
int main(int argc, char* argv[]) {
+ bool has_broken_vulkan = false;
#ifdef _WIN32
char variable_contents[32];
const DWORD startup_check_var =
GetEnvironmentVariable(STARTUP_CHECK_ENV_VAR, variable_contents, 32);
- if (startup_check_var != 0) {
- std::fprintf(stderr, "perform statup checks\n");
+ const std::string variable_contents_s{variable_contents};
+ if (startup_check_var > 0 && variable_contents_s == "ON") {
CheckVulkan();
return 0;
- } else {
- std::fprintf(stderr, "%d\n", StartupChecks());
}
+ StartupChecks(argv[0], &has_broken_vulkan);
#elif YUZU_UNIX
#error "Unimplemented"
#endif
@@ -3907,7 +3905,7 @@ int main(int argc, char* argv[]) {
// generating shaders
setlocale(LC_ALL, "C");
- GMainWindow main_window{};
+ GMainWindow main_window{has_broken_vulkan};
// After settings have been loaded by GMainWindow, apply the filter
main_window.show();