summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar lat9nq2020-11-09 22:12:41 -0500
committerGravatar lat9nq2020-11-09 22:12:41 -0500
commit945cfe234b649aec08efcebadae905de5dfcda90 (patch)
tree4dd95e3e6ee809cc5e059a0bbf2f48b4964d15f5
parentMerge pull request #4909 from lioncash/interrupt (diff)
downloadyuzu-945cfe234b649aec08efcebadae905de5dfcda90.tar.gz
yuzu-945cfe234b649aec08efcebadae905de5dfcda90.tar.xz
yuzu-945cfe234b649aec08efcebadae905de5dfcda90.zip
bootmanager: Log and show GL_RENDERER string when GPU is insufficient
Changes the first message to not include the OpenGL version, as the error is caused by OpenGL failing to load. Adds a new check for OpenGL version 4.3. This will display a message with a similar error as well as the GL_RENDERER string. Adds a CRITICAL log message when triggered. This prevents a crash with yuzu trying to use older OpenGL versions. Modifies the unsupported extension message to output the GL_RENDERER string in the message, as well as logging the string.
Diffstat (limited to '')
-rw-r--r--src/yuzu/bootmanager.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 408eac2b7..4481c749b 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -10,6 +10,7 @@
10#include <QMessageBox> 10#include <QMessageBox>
11#include <QPainter> 11#include <QPainter>
12#include <QScreen> 12#include <QScreen>
13#include <QString>
13#include <QStringList> 14#include <QStringList>
14#include <QWindow> 15#include <QWindow>
15 16
@@ -603,19 +604,34 @@ bool GRenderWindow::LoadOpenGL() {
603 auto context = CreateSharedContext(); 604 auto context = CreateSharedContext();
604 auto scope = context->Acquire(); 605 auto scope = context->Acquire();
605 if (!gladLoadGL()) { 606 if (!gladLoadGL()) {
607 QMessageBox::critical(
608 this, tr("Error while initializing OpenGL!"),
609 tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver."));
610 return false;
611 }
612
613 QString renderer = QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
614
615 if (!GLAD_GL_VERSION_4_3) {
616 LOG_CRITICAL(Frontend, "GPU does not support OpenGL 4.3: {:s}", renderer.toStdString());
606 QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3!"), 617 QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3!"),
607 tr("Your GPU may not support OpenGL 4.3, or you do not have the " 618 tr("Your GPU may not support OpenGL 4.3, or you do not have the "
608 "latest graphics driver.")); 619 "latest graphics driver.<br><br>GL Renderer:<br>%1")
620 .arg(renderer));
609 return false; 621 return false;
610 } 622 }
611 623
612 QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions(); 624 QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions();
613 if (!unsupported_gl_extensions.empty()) { 625 if (!unsupported_gl_extensions.empty()) {
626 LOG_CRITICAL(Frontend, "GPU does not support all needed extensions: {:s}",
627 renderer.toStdString());
614 QMessageBox::critical( 628 QMessageBox::critical(
615 this, tr("Error while initializing OpenGL!"), 629 this, tr("Error while initializing OpenGL!"),
616 tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you " 630 tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you "
617 "have the latest graphics driver.<br><br>Unsupported extensions:<br>") + 631 "have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
618 unsupported_gl_extensions.join(QStringLiteral("<br>"))); 632 "extensions:<br>%2")
633 .arg(renderer)
634 .arg(unsupported_gl_extensions.join(QStringLiteral("<br>"))));
619 return false; 635 return false;
620 } 636 }
621 return true; 637 return true;