mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 13:26:30 -05:00
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.
This commit is contained in:
parent
945cfe234b
commit
c433c0a746
1 changed files with 16 additions and 12 deletions
|
@ -604,28 +604,27 @@ bool GRenderWindow::LoadOpenGL() {
|
||||||
auto context = CreateSharedContext();
|
auto context = CreateSharedContext();
|
||||||
auto scope = context->Acquire();
|
auto scope = context->Acquire();
|
||||||
if (!gladLoadGL()) {
|
if (!gladLoadGL()) {
|
||||||
QMessageBox::critical(
|
QMessageBox::warning(
|
||||||
this, tr("Error while initializing OpenGL!"),
|
this, tr("Error while initializing OpenGL!"),
|
||||||
tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver."));
|
tr("Your GPU may not support OpenGL, or you do not have the latest graphics driver."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString renderer = QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
|
const QString renderer =
|
||||||
|
QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
|
||||||
|
|
||||||
if (!GLAD_GL_VERSION_4_3) {
|
if (!GLAD_GL_VERSION_4_3) {
|
||||||
LOG_CRITICAL(Frontend, "GPU does not support OpenGL 4.3: {:s}", renderer.toStdString());
|
LOG_ERROR(Frontend, "GPU does not support OpenGL 4.3: {}", renderer.toStdString());
|
||||||
QMessageBox::critical(this, tr("Error while initializing OpenGL 4.3!"),
|
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 "
|
tr("Your GPU may not support OpenGL 4.3, or you do not have the "
|
||||||
"latest graphics driver.<br><br>GL Renderer:<br>%1")
|
"latest graphics driver.<br><br>GL Renderer:<br>%1")
|
||||||
.arg(renderer));
|
.arg(renderer));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions();
|
QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions();
|
||||||
if (!unsupported_gl_extensions.empty()) {
|
if (!unsupported_gl_extensions.empty()) {
|
||||||
LOG_CRITICAL(Frontend, "GPU does not support all needed extensions: {:s}",
|
QMessageBox::warning(
|
||||||
renderer.toStdString());
|
|
||||||
QMessageBox::critical(
|
|
||||||
this, tr("Error while initializing OpenGL!"),
|
this, tr("Error while initializing OpenGL!"),
|
||||||
tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you "
|
tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you "
|
||||||
"have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
|
"have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
|
||||||
|
@ -661,8 +660,13 @@ QStringList GRenderWindow::GetUnsupportedGLExtensions() const {
|
||||||
if (!GLAD_GL_ARB_depth_buffer_float)
|
if (!GLAD_GL_ARB_depth_buffer_float)
|
||||||
unsupported_ext.append(QStringLiteral("ARB_depth_buffer_float"));
|
unsupported_ext.append(QStringLiteral("ARB_depth_buffer_float"));
|
||||||
|
|
||||||
for (const QString& ext : unsupported_ext)
|
if (!unsupported_ext.empty()) {
|
||||||
LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext.toStdString());
|
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;
|
return unsupported_ext;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue