From 2a4bca8b4ab4a698ae034a8ac8ffa3b10c660601 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 9 Mar 2019 23:31:40 +1000 Subject: VideoBackends: Verify validity before doing full renderer init Prevents attempting to create invalid MSAA configurations, for example. --- Source/Core/VideoBackends/OGL/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/main.cpp') diff --git a/Source/Core/VideoBackends/OGL/main.cpp b/Source/Core/VideoBackends/OGL/main.cpp index 22dba1a21f..3ca016556b 100644 --- a/Source/Core/VideoBackends/OGL/main.cpp +++ b/Source/Core/VideoBackends/OGL/main.cpp @@ -135,6 +135,8 @@ bool VideoBackend::InitializeGLExtensions(GLContext* context) bool VideoBackend::FillBackendInfo() { + InitBackendInfo(); + // check for the max vertex attributes GLint numvertexattribs = 0; glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &numvertexattribs); @@ -162,10 +164,8 @@ bool VideoBackend::FillBackendInfo() bool VideoBackend::Initialize(const WindowSystemInfo& wsi) { - InitializeShared(); - std::unique_ptr main_gl_context = - GLContext::Create(wsi, g_ActiveConfig.stereo_mode == StereoMode::QuadBuffer, true, false, + GLContext::Create(wsi, g_Config.stereo_mode == StereoMode::QuadBuffer, true, false, Config::Get(Config::GFX_PREFER_GLES)); if (!main_gl_context) return false; @@ -173,6 +173,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi) if (!InitializeGLExtensions(main_gl_context.get()) || !FillBackendInfo()) return false; + InitializeShared(); g_renderer = std::make_unique(std::move(main_gl_context), wsi.render_surface_scale); ProgramShaderCache::Init(); g_vertex_manager = std::make_unique(); -- cgit v1.2.3