summaryrefslogtreecommitdiff
path: root/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-06-04 16:13:55 -0400
committerGravatar GitHub2018-06-04 16:13:55 -0400
commit0a0233f39f7dbad013d14714a49cc9184da9cee9 (patch)
treef22a89f89c64d05bff56d1a87ddf1cdb43c332fa /src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
parentMerge pull request #513 from Subv/cache_alignment (diff)
parentsdl: add check for GL extension support (diff)
downloadyuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.gz
yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.tar.xz
yuzu-0a0233f39f7dbad013d14714a49cc9184da9cee9.zip
Merge pull request #490 from BreadFish64/extension-check
Add checks for OpenGL extension support
Diffstat (limited to 'src/yuzu_cmd/emu_window/emu_window_sdl2.cpp')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp23
1 files changed, 23 insertions, 0 deletions
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
81bool 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
81EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { 99EmuWindow_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();