This commit is contained in:
twinaphex 2018-10-10 18:08:13 +02:00
parent 8c845a249e
commit c3c169aeab

View File

@ -1788,28 +1788,37 @@ static void *gl_init(const video_info_t *video,
hwr = video_driver_get_hw_context();
#ifdef GL_CONTEXT_PROFILE_MASK
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
{
gfx_ctx_flags_t flags;
/* Check if we have a core context */
GLint gl_flags = 0;
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &gl_flags);
gl_query_core_context_set(true);
gl->core_context_in_use = true;
/**
* Ensure that the rest of the frontend knows we have a core context
*/
flags.flags = 0;
BIT32_SET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
video_context_driver_set_flags(&flags);
RARCH_LOG("[GL]: Using Core GL context, setting up VAO...\n");
if (!gl_check_capability(GL_CAPS_VAO))
if (gl_flags & GL_CONTEXT_CORE_PROFILE_BIT)
{
RARCH_ERR("[GL]: Failed to initialize VAOs.\n");
goto error;
gfx_ctx_flags_t flags;
gl_query_core_context_set(true);
gl->core_context_in_use = true;
/**
* Ensure that the rest of the frontend knows we have a core context
*/
flags.flags = 0;
BIT32_SET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
video_context_driver_set_flags(&flags);
RARCH_LOG("[GL]: Using Core GL context, setting up VAO...\n");
if (!gl_check_capability(GL_CAPS_VAO))
{
RARCH_ERR("[GL]: Failed to initialize VAOs.\n");
goto error;
}
}
}
#endif
if (!renderchain_gl_init_first(&gl->renderchain_driver,
&gl->renderchain_data))