summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar lat9nq2020-11-09 22:55:05 -0500
committerGravatar lat9nq2020-11-09 22:55:05 -0500
commitc433c0a746ad3826b4cbcf9f62b587e08dec03ad (patch)
treef3fd141b7e4483b055f6eb134b664bd0e247c133 /src
parentbootmanager: Log and show GL_RENDERER string when GPU is insufficient (diff)
downloadyuzu-c433c0a746ad3826b4cbcf9f62b587e08dec03ad.tar.gz
yuzu-c433c0a746ad3826b4cbcf9f62b587e08dec03ad.tar.xz
yuzu-c433c0a746ad3826b4cbcf9f62b587e08dec03ad.zip
bootmanager: Address review comments
Changes QMessageBox usages to warnings, as the problems they bring to light are being safely handled by the application and do not warrant something of the "critical" level. Changes LOG_CRITICAL to LOG_ERROR for the same reason. Preferring ERROR to WARNING as yuzu is denying loading of any guest applications after checking for these conditions. Moved logging the GL_RENDERER string into GetUnsupportedGLExtensions() to make more clear that unsupported extensions were already being logged. Makes placement of the logs easier to understand later, as well.
Diffstat (limited to '')
-rw-r--r--src/yuzu/bootmanager.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 4481c749b..e38bc7a9a 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -604,28 +604,27 @@ bool GRenderWindow::LoadOpenGL() {
604 auto context = CreateSharedContext(); 604 auto context = CreateSharedContext();
605 auto scope = context->Acquire(); 605 auto scope = context->Acquire();
606 if (!gladLoadGL()) { 606 if (!gladLoadGL()) {
607 QMessageBox::critical( 607 QMessageBox::warning(
608 this, tr("Error while initializing OpenGL!"), 608 this, tr("Error while initializing OpenGL!"),
609 tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver.")); 609 tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver."));
610 return false; 610 return false;
611 } 611 }
612 612
613 QString renderer = QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER))); 613 const QString renderer =
614 QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
614 615
615 if (!GLAD_GL_VERSION_4_3) { 616 if (!GLAD_GL_VERSION_4_3) {
616 LOG_CRITICAL(Frontend, "GPU does not support OpenGL 4.3: {:s}", renderer.toStdString()); 617 LOG_ERROR(Frontend, "GPU does not support OpenGL 4.3: {}", renderer.toStdString());
617 QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3!"), 618 QMessageBox::warning(this, tr("Error while initializing OpenGL 4.3!"),
618 tr("Your GPU may not support OpenGL 4.3, or you do not have the " 619 tr("Your GPU may not support OpenGL 4.3, or you do not have the "
619 "latest graphics driver.<br><br>GL Renderer:<br>%1") 620 "latest graphics driver.<br><br>GL Renderer:<br>%1")
620 .arg(renderer)); 621 .arg(renderer));
621 return false; 622 return false;
622 } 623 }
623 624
624 QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions(); 625 QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions();
625 if (!unsupported_gl_extensions.empty()) { 626 if (!unsupported_gl_extensions.empty()) {
626 LOG_CRITICAL(Frontend, "GPU does not support all needed extensions: {:s}", 627 QMessageBox::warning(
627 renderer.toStdString());
628 QMessageBox::critical(
629 this, tr("Error while initializing OpenGL!"), 628 this, tr("Error while initializing OpenGL!"),
630 tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you " 629 tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you "
631 "have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported " 630 "have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
@@ -661,8 +660,13 @@ QStringList GRenderWindow::GetUnsupportedGLExtensions() const {
661 if (!GLAD_GL_ARB_depth_buffer_float) 660 if (!GLAD_GL_ARB_depth_buffer_float)
662 unsupported_ext.append(QStringLiteral("ARB_depth_buffer_float")); 661 unsupported_ext.append(QStringLiteral("ARB_depth_buffer_float"));
663 662
664 for (const QString& ext : unsupported_ext) 663 if (!unsupported_ext.empty()) {
665 LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext.toStdString()); 664 LOG_ERROR(Frontend, "GPU does not support all required extensions: {}",
665 glGetString(GL_RENDERER));
666 }
667 for (const QString& ext : unsupported_ext) {
668 LOG_ERROR(Frontend, "Unsupported GL extension: {}", ext.toStdString());
669 }
666 670
667 return unsupported_ext; 671 return unsupported_ext;
668} 672}