[qt] do not fatally error out immediately if OpenGL is missing some extensions (#2876)
It may be possible to run without the extensions, with decreased stability of course (or partial implementation thereof) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2876 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
d3dbabcfc7
commit
ce0a299bdb
|
|
@ -1052,53 +1052,40 @@ bool GRenderWindow::LoadOpenGL() {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
// Display various warnings (but not fatal errors) for missing OpenGL extensions or lack of
|
||||||
const QString renderer =
|
// OpenGL 4.6 support
|
||||||
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_6) {
|
if (!GLAD_GL_VERSION_4_6) {
|
||||||
LOG_ERROR(Frontend, "GPU does not support OpenGL 4.6: {}", renderer.toStdString());
|
|
||||||
QMessageBox::warning(this, tr("Error while initializing OpenGL 4.6!"),
|
QMessageBox::warning(this, tr("Error while initializing OpenGL 4.6!"),
|
||||||
tr("Your GPU may not support OpenGL 4.6, or you do not have the "
|
tr("Your GPU may not support OpenGL 4.6, 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;
|
||||||
}
|
}
|
||||||
|
if (QStringList missing_ext = GetUnsupportedGLExtensions(); !missing_ext.empty()) {
|
||||||
QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions();
|
|
||||||
if (!unsupported_gl_extensions.empty()) {
|
|
||||||
QMessageBox::warning(
|
QMessageBox::warning(
|
||||||
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 "
|
||||||
"extensions:<br>%2")
|
"extensions:<br>%2")
|
||||||
.arg(renderer)
|
.arg(renderer).arg(missing_ext.join(QStringLiteral("<br>"))));
|
||||||
.arg(unsupported_gl_extensions.join(QStringLiteral("<br>"))));
|
// Non fatal
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList GRenderWindow::GetUnsupportedGLExtensions() const {
|
QStringList GRenderWindow::GetUnsupportedGLExtensions() const {
|
||||||
QStringList unsupported_ext;
|
QStringList missing_ext;
|
||||||
|
|
||||||
// Extensions required to support some texture formats.
|
// Extensions required to support some texture formats.
|
||||||
if (!GLAD_GL_EXT_texture_compression_s3tc) {
|
if (!GLAD_GL_EXT_texture_compression_s3tc)
|
||||||
unsupported_ext.append(QStringLiteral("EXT_texture_compression_s3tc"));
|
missing_ext.append(QStringLiteral("EXT_texture_compression_s3tc"));
|
||||||
}
|
if (!GLAD_GL_ARB_texture_compression_rgtc)
|
||||||
if (!GLAD_GL_ARB_texture_compression_rgtc) {
|
missing_ext.append(QStringLiteral("ARB_texture_compression_rgtc"));
|
||||||
unsupported_ext.append(QStringLiteral("ARB_texture_compression_rgtc"));
|
if (!missing_ext.empty())
|
||||||
}
|
LOG_ERROR(Frontend, "GPU does not support all required extensions");
|
||||||
|
for (const QString& ext : missing_ext)
|
||||||
if (!unsupported_ext.empty()) {
|
|
||||||
const std::string gl_renderer{reinterpret_cast<const char*>(glGetString(GL_RENDERER))};
|
|
||||||
LOG_ERROR(Frontend, "GPU does not support all required extensions: {}", gl_renderer);
|
|
||||||
}
|
|
||||||
for (const QString& ext : unsupported_ext) {
|
|
||||||
LOG_ERROR(Frontend, "Unsupported GL extension: {}", ext.toStdString());
|
LOG_ERROR(Frontend, "Unsupported GL extension: {}", ext.toStdString());
|
||||||
}
|
return missing_ext;
|
||||||
|
|
||||||
return unsupported_ext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread_) {
|
void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread_) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue