diff options
author | LC <mathew1800@gmail.com> | 2020-11-15 12:33:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 12:33:48 +0100 |
commit | ce718522bcc606326bf6510187a9169e8bfd3787 (patch) | |
tree | 3cd641666755522777b65afa52fe28f7401c5544 | |
parent | Merge pull request #4895 from Morph1984/cave-story-plus-applet-fix (diff) | |
parent | bootmanager: Address review comments (diff) | |
download | yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.tar yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.tar.gz yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.tar.bz2 yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.tar.lz yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.tar.xz yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.tar.zst yuzu-ce718522bcc606326bf6510187a9169e8bfd3787.zip |
-rw-r--r-- | src/yuzu/bootmanager.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 408eac2b7..e38bc7a9a 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -10,6 +10,7 @@ #include <QMessageBox> #include <QPainter> #include <QScreen> +#include <QString> #include <QStringList> #include <QWindow> @@ -603,19 +604,33 @@ bool GRenderWindow::LoadOpenGL() { auto context = CreateSharedContext(); auto scope = context->Acquire(); if (!gladLoadGL()) { - QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3!"), - tr("Your GPU may not support OpenGL 4.3, or you do not have the " - "latest graphics driver.")); + QMessageBox::warning( + this, tr("Error while initializing OpenGL!"), + tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver.")); + return false; + } + + const QString renderer = + QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER))); + + if (!GLAD_GL_VERSION_4_3) { + LOG_ERROR(Frontend, "GPU does not support OpenGL 4.3: {}", renderer.toStdString()); + QMessageBox::warning(this, tr("Error while initializing OpenGL 4.3!"), + tr("Your GPU may not support OpenGL 4.3, or you do not have the " + "latest graphics driver.<br><br>GL Renderer:<br>%1") + .arg(renderer)); return false; } QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions(); if (!unsupported_gl_extensions.empty()) { - QMessageBox::critical( + QMessageBox::warning( this, tr("Error while initializing OpenGL!"), tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you " - "have the latest graphics driver.<br><br>Unsupported extensions:<br>") + - unsupported_gl_extensions.join(QStringLiteral("<br>"))); + "have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported " + "extensions:<br>%2") + .arg(renderer) + .arg(unsupported_gl_extensions.join(QStringLiteral("<br>")))); return false; } return true; @@ -645,8 +660,13 @@ QStringList GRenderWindow::GetUnsupportedGLExtensions() const { if (!GLAD_GL_ARB_depth_buffer_float) unsupported_ext.append(QStringLiteral("ARB_depth_buffer_float")); - for (const QString& ext : unsupported_ext) - LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext.toStdString()); + if (!unsupported_ext.empty()) { + LOG_ERROR(Frontend, "GPU does not support all required extensions: {}", + glGetString(GL_RENDERER)); + } + for (const QString& ext : unsupported_ext) { + LOG_ERROR(Frontend, "Unsupported GL extension: {}", ext.toStdString()); + } return unsupported_ext; } |