From c010c5b2586a05bcc60ca941250073b8ce95ce39 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 18 Jun 2017 16:45:36 +0200 Subject: [PATCH] Try to set use_hw_ctx in advance for Android --- gfx/drivers_context/android_ctx.c | 3 +++ gfx/video_driver.c | 3 +++ gfx/video_driver.h | 1 + 3 files changed, 7 insertions(+) diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index b1c907a838..30f99ab6b5 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -136,6 +136,9 @@ static void *android_gfx_ctx_init(video_frame_info_t *video_info, void *video_dr attribs[1] = EGL_OPENGL_ES3_BIT_KHR; #endif + and->egl.use_hw_ctx = video_info->shared_context + && video_info->hw_render_ctx; + switch (android_api) { case GFX_CTX_OPENGL_API: diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 2aa04cb16c..0a75c754be 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2465,6 +2465,7 @@ void video_driver_build_info(video_frame_info_t *video_info) video_driver_threaded_lock(is_threaded); #endif settings = config_get_ptr(); + video_info->hw_render_ctx = false; /* TODO/FIXME - might eventually do something here */ video_info->refresh_rate = settings->floats.video_refresh_rate; video_info->black_frame_insertion = settings->bools.video_black_frame_insertion; @@ -2726,6 +2727,8 @@ static const gfx_ctx_driver_t *video_context_driver_init( video_driver_build_info(&video_info); + video_info.hw_render_ctx = hw_render_ctx; + ctx_data = ctx->init(&video_info, data); if (!ctx_data) diff --git a/gfx/video_driver.h b/gfx/video_driver.h index cb816346a5..7946de4bf7 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -427,6 +427,7 @@ typedef struct video_frame_info bool runloop_is_paused; bool is_perfcnt_enable; bool menu_is_alive; + bool hw_render_ctx; int custom_vp_x; int custom_vp_y;