diff options
Diffstat (limited to 'src')
| -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) { | |||
| 335 | } | 335 | } |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | bool GMainWindow::SupportsRequiredGLExtensions() { | ||
| 339 | QStringList unsupported_ext; | ||
| 340 | |||
| 341 | if (!GLAD_GL_ARB_program_interface_query) | ||
| 342 | unsupported_ext.append("ARB_program_interface_query"); | ||
| 343 | if (!GLAD_GL_ARB_separate_shader_objects) | ||
| 344 | unsupported_ext.append("ARB_separate_shader_objects"); | ||
| 345 | if (!GLAD_GL_ARB_shader_storage_buffer_object) | ||
| 346 | unsupported_ext.append("ARB_shader_storage_buffer_object"); | ||
| 347 | if (!GLAD_GL_ARB_vertex_attrib_binding) | ||
| 348 | unsupported_ext.append("ARB_vertex_attrib_binding"); | ||
| 349 | |||
| 350 | for (const QString& ext : unsupported_ext) | ||
| 351 | NGLOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext.toStdString()); | ||
| 352 | |||
| 353 | return unsupported_ext.empty(); | ||
| 354 | } | ||
| 355 | |||
| 338 | bool GMainWindow::LoadROM(const QString& filename) { | 356 | bool GMainWindow::LoadROM(const QString& filename) { |
| 339 | // Shutdown previous session if the emu thread is still active... | 357 | // Shutdown previous session if the emu thread is still active... |
| 340 | if (emu_thread != nullptr) | 358 | if (emu_thread != nullptr) |
| @@ -350,6 +368,14 @@ bool GMainWindow::LoadROM(const QString& filename) { | |||
| 350 | return false; | 368 | return false; |
| 351 | } | 369 | } |
| 352 | 370 | ||
| 371 | if (!SupportsRequiredGLExtensions()) { | ||
| 372 | QMessageBox::critical( | ||
| 373 | this, tr("Error while initializing OpenGL Core!"), | ||
| 374 | tr("Your GPU may not support one or more required OpenGL extensions. Please " | ||
| 375 | "ensure you have the latest graphics driver. See the log for more details.")); | ||
| 376 | return false; | ||
| 377 | } | ||
| 378 | |||
| 353 | Core::System& system{Core::System::GetInstance()}; | 379 | Core::System& system{Core::System::GetInstance()}; |
| 354 | 380 | ||
| 355 | system.SetGPUDebugContext(debug_context); | 381 | 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: | |||
| 79 | void ConnectWidgetEvents(); | 79 | void ConnectWidgetEvents(); |
| 80 | void ConnectMenuEvents(); | 80 | void ConnectMenuEvents(); |
| 81 | 81 | ||
| 82 | bool SupportsRequiredGLExtensions(); | ||
| 82 | bool LoadROM(const QString& filename); | 83 | bool LoadROM(const QString& filename); |
| 83 | void BootGame(const QString& filename); | 84 | void BootGame(const QString& filename); |
| 84 | void ShutdownGame(); | 85 | 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() { | |||
| 78 | SDL_MaximizeWindow(render_window); | 78 | SDL_MaximizeWindow(render_window); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | bool EmuWindow_SDL2::SupportsRequiredGLExtensions() { | ||
| 82 | std::vector<std::string> unsupported_ext; | ||
| 83 | |||
| 84 | if (!GLAD_GL_ARB_program_interface_query) | ||
| 85 | unsupported_ext.push_back("ARB_program_interface_query"); | ||
| 86 | if (!GLAD_GL_ARB_separate_shader_objects) | ||
| 87 | unsupported_ext.push_back("ARB_separate_shader_objects"); | ||
| 88 | if (!GLAD_GL_ARB_shader_storage_buffer_object) | ||
| 89 | unsupported_ext.push_back("ARB_shader_storage_buffer_object"); | ||
| 90 | if (!GLAD_GL_ARB_vertex_attrib_binding) | ||
| 91 | unsupported_ext.push_back("ARB_vertex_attrib_binding"); | ||
| 92 | |||
| 93 | for (const std::string& ext : unsupported_ext) | ||
| 94 | NGLOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext); | ||
| 95 | |||
| 96 | return unsupported_ext.empty(); | ||
| 97 | } | ||
| 98 | |||
| 81 | EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { | 99 | EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { |
| 82 | InputCommon::Init(); | 100 | InputCommon::Init(); |
| 83 | 101 | ||
| @@ -128,6 +146,11 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { | |||
| 128 | exit(1); | 146 | exit(1); |
| 129 | } | 147 | } |
| 130 | 148 | ||
| 149 | if (!SupportsRequiredGLExtensions()) { | ||
| 150 | NGLOG_CRITICAL(Frontend, "GPU does not support all required OpenGL extensions! Exiting..."); | ||
| 151 | exit(1); | ||
| 152 | } | ||
| 153 | |||
| 131 | OnResize(); | 154 | OnResize(); |
| 132 | OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); | 155 | OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); |
| 133 | SDL_PumpEvents(); | 156 | 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: | |||
| 46 | /// Called when user passes the fullscreen parameter flag | 46 | /// Called when user passes the fullscreen parameter flag |
| 47 | void Fullscreen(); | 47 | void Fullscreen(); |
| 48 | 48 | ||
| 49 | /// Whether the GPU and driver supports the OpenGL extension required | ||
| 50 | bool SupportsRequiredGLExtensions(); | ||
| 51 | |||
| 49 | /// Called when a configuration change affects the minimal size of the window | 52 | /// Called when a configuration change affects the minimal size of the window |
| 50 | void OnMinimalClientAreaChangeRequest( | 53 | void OnMinimalClientAreaChangeRequest( |
| 51 | const std::pair<unsigned, unsigned>& minimal_size) override; | 54 | const std::pair<unsigned, unsigned>& minimal_size) override; |