diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-04 16:13:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-04 16:13:55 -0400 |
commit | 0a0233f39f7dbad013d14714a49cc9184da9cee9 (patch) | |
tree | f22a89f89c64d05bff56d1a87ddf1cdb43c332fa /src/yuzu/main.cpp | |
parent | 9936d1b9e28feeaa1a4c46bd3aa487fbeacbcdfd (diff) | |
parent | fbef849c04771fa2f35c11706ed15a410da519d6 (diff) |
Merge pull request #490 from BreadFish64/extension-check
Add checks for OpenGL extension support
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index a5d7807e2..3038bd6da 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -335,6 +335,24 @@ void GMainWindow::OnDisplayTitleBars(bool show) { } } +bool GMainWindow::SupportsRequiredGLExtensions() { + QStringList unsupported_ext; + + if (!GLAD_GL_ARB_program_interface_query) + unsupported_ext.append("ARB_program_interface_query"); + if (!GLAD_GL_ARB_separate_shader_objects) + unsupported_ext.append("ARB_separate_shader_objects"); + if (!GLAD_GL_ARB_shader_storage_buffer_object) + unsupported_ext.append("ARB_shader_storage_buffer_object"); + if (!GLAD_GL_ARB_vertex_attrib_binding) + unsupported_ext.append("ARB_vertex_attrib_binding"); + + for (const QString& ext : unsupported_ext) + NGLOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext.toStdString()); + + return unsupported_ext.empty(); +} + bool GMainWindow::LoadROM(const QString& filename) { // Shutdown previous session if the emu thread is still active... if (emu_thread != nullptr) @@ -350,6 +368,14 @@ bool GMainWindow::LoadROM(const QString& filename) { return false; } + if (!SupportsRequiredGLExtensions()) { + QMessageBox::critical( + this, tr("Error while initializing OpenGL Core!"), + tr("Your GPU may not support one or more required OpenGL extensions. Please " + "ensure you have the latest graphics driver. See the log for more details.")); + return false; + } + Core::System& system{Core::System::GetInstance()}; system.SetGPUDebugContext(debug_context); |