Create dynamic_verify_hw_context - if we request a GL hw context and we have

the Vulkan driver running, return false - or vice versa. Can now use ffmpeg
core with Vulkan
This commit is contained in:
twinaphex 2016-08-31 03:42:58 +02:00
parent 5ae110601c
commit a4bd80596e

View File

@ -893,6 +893,32 @@ static bool dynamic_request_hw_context(enum retro_hw_context_type type,
return true;
}
static bool dynamic_verify_hw_context(enum retro_hw_context_type type,
unsigned minor, unsigned major)
{
const char *video_ident = video_driver_get_ident();
switch (type)
{
case RETRO_HW_CONTEXT_VULKAN:
if (!string_is_equal(video_ident, "vulkan"))
return false;
break;
case RETRO_HW_CONTEXT_OPENGLES2:
case RETRO_HW_CONTEXT_OPENGLES3:
case RETRO_HW_CONTEXT_OPENGLES_VERSION:
case RETRO_HW_CONTEXT_OPENGL:
case RETRO_HW_CONTEXT_OPENGL_CORE:
if (!string_is_equal(video_ident, "gl"))
return false;
break;
default:
break;
}
return true;
}
/**
* rarch_environment_cb:
* @cmd : Identifier of command.
@ -1201,6 +1227,9 @@ bool rarch_environment_cb(unsigned cmd, void *data)
if (!dynamic_request_hw_context(cb->context_type, cb->version_minor, cb->version_major))
return false;
if (!dynamic_verify_hw_context(cb->context_type, cb->version_minor, cb->version_major))
return false;
cb->get_current_framebuffer = video_driver_get_current_framebuffer;
cb->get_proc_address = video_driver_get_proc_address;