Skip to content

Commit

Permalink
VideoBackends: Verify validity before doing full renderer init
Browse files Browse the repository at this point in the history
Prevents attempting to create invalid MSAA configurations, for example.
  • Loading branch information
stenzek committed Mar 29, 2019
1 parent 1151a12 commit 2a4bca8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Core/VideoBackends/OGL/main.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -162,17 +164,16 @@ bool VideoBackend::FillBackendInfo()

bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
{
InitializeShared();

std::unique_ptr<GLContext> 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;

if (!InitializeGLExtensions(main_gl_context.get()) || !FillBackendInfo())
return false;

InitializeShared();
g_renderer = std::make_unique<Renderer>(std::move(main_gl_context), wsi.render_surface_scale);
ProgramShaderCache::Init();
g_vertex_manager = std::make_unique<VertexManager>();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/VideoBackendBase.cpp
Expand Up @@ -294,6 +294,7 @@ void VideoBackendBase::InitializeShared()
GeometryShaderManager::Init();
PixelShaderManager::Init();

g_Config.VerifyValidity();
UpdateActiveConfig();
}

Expand Down

0 comments on commit 2a4bca8

Please sign in to comment.