diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-04 22:13:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-04 22:13:55 +0200 |
commit | 0a0233f39f7dbad013d14714a49cc9184da9cee9 (patch) | |
tree | f22a89f89c64d05bff56d1a87ddf1cdb43c332fa | |
parent | Merge pull request #513 from Subv/cache_alignment (diff) | |
parent | sdl: add check for GL extension support (diff) | |
download | yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.gz yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.bz2 yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.lz yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.xz yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.zst yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu/main.cpp | 26 | ||||
-rw-r--r-- | src/yuzu/main.h | 1 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 23 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.h | 3 |
4 files changed, 53 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); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 20ff65314..ac3024d8a 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -79,6 +79,7 @@ private: void ConnectWidgetEvents(); void ConnectMenuEvents(); + bool SupportsRequiredGLExtensions(); bool LoadROM(const QString& filename); void BootGame(const QString& filename); void ShutdownGame(); diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index e21de6f21..cfd8eb7e6 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -78,6 +78,24 @@ void EmuWindow_SDL2::Fullscreen() { SDL_MaximizeWindow(render_window); } +bool EmuWindow_SDL2::SupportsRequiredGLExtensions() { + std::vector<std::string> unsupported_ext; + + if (!GLAD_GL_ARB_program_interface_query) + unsupported_ext.push_back("ARB_program_interface_query"); + if (!GLAD_GL_ARB_separate_shader_objects) + unsupported_ext.push_back("ARB_separate_shader_objects"); + if (!GLAD_GL_ARB_shader_storage_buffer_object) + unsupported_ext.push_back("ARB_shader_storage_buffer_object"); + if (!GLAD_GL_ARB_vertex_attrib_binding) + unsupported_ext.push_back("ARB_vertex_attrib_binding"); + + for (const std::string& ext : unsupported_ext) + NGLOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext); + + return unsupported_ext.empty(); +} + EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { InputCommon::Init(); @@ -128,6 +146,11 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { exit(1); } + if (!SupportsRequiredGLExtensions()) { + NGLOG_CRITICAL(Frontend, "GPU does not support all required OpenGL extensions! Exiting..."); + exit(1); + } + OnResize(); OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); SDL_PumpEvents(); diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h index 7d5cfffb6..1d835c3c6 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h @@ -46,6 +46,9 @@ private: /// Called when user passes the fullscreen parameter flag void Fullscreen(); + /// Whether the GPU and driver supports the OpenGL extension required + bool SupportsRequiredGLExtensions(); + /// Called when a configuration change affects the minimal size of the window void OnMinimalClientAreaChangeRequest( const std::pair<unsigned, unsigned>& minimal_size) override; |