Merge pull request #7548 from stenzek/graphics-window-crash

OGL: Fix crash when opening graphics window on another backend
This commit is contained in:
Pierre Bourdon 2018-11-07 17:45:52 +01:00 committed by GitHub
commit 16a618f413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -474,6 +474,7 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context)
g_Config.backend_info.bSupportsDynamicSamplerIndexing =
GLExtensions::Supports("GL_ARB_gpu_shader5");
g_ogl_config.bIsES = m_main_gl_context->IsGLES();
g_ogl_config.bSupportsGLSLCache = GLExtensions::Supports("GL_ARB_get_program_binary");
g_ogl_config.bSupportsGLPinnedMemory = GLExtensions::Supports("GL_AMD_pinned_memory");
g_ogl_config.bSupportsGLSync = GLExtensions::Supports("GL_ARB_sync");

View File

@ -48,6 +48,7 @@ enum class EsFbFetchType
// ogl-only config, so not in VideoConfig.h
struct VideoConfig
{
bool bIsES;
bool bSupportsGLSLCache;
bool bSupportsGLPinnedMemory;
bool bSupportsGLSync;

View File

@ -68,7 +68,7 @@ std::string VideoBackend::GetName() const
std::string VideoBackend::GetDisplayName() const
{
if (g_renderer && static_cast<Renderer*>(g_renderer.get())->IsGLES())
if (g_ogl_config.bIsES)
return _trans("OpenGL ES");
else
return _trans("OpenGL");