From 19ad9aa1cb58691c8a0188260b5799e823363094 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 4 Dec 2017 12:43:22 +0100 Subject: [PATCH] Add resolve extensions callback --- gfx/drivers/gl.c | 3 +++ gfx/drivers_renderchain/gl1_renderchain.c | 7 ++++--- gfx/drivers_renderchain/gl2_renderchain.c | 6 ++++++ gfx/video_driver.h | 4 ++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 3cc6adf629..b7302756e8 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1371,6 +1371,9 @@ static bool resolve_extensions(gl_t *gl, const char *context_ident) video_driver_unset_rgba(); + if (gl->renderchain_driver->resolve_extensions) + gl->renderchain_driver->resolve_extensions(gl, gl->renderchain_data, context_ident); + #if defined(HAVE_OPENGLES) && !defined(HAVE_PSGL) if (!gl_check_capability(GL_CAPS_BGRA8888)) { diff --git a/gfx/drivers_renderchain/gl1_renderchain.c b/gfx/drivers_renderchain/gl1_renderchain.c index a9762cf0ba..56a5d27650 100644 --- a/gfx/drivers_renderchain/gl1_renderchain.c +++ b/gfx/drivers_renderchain/gl1_renderchain.c @@ -327,10 +327,11 @@ gl_renderchain_driver_t gl2_renderchain = { NULL, /* renderchain_init */ NULL, /* init_hw_render */ gl1_renderchain_free, - NULL, /* deinit_hw_render */ - NULL, /* start_render */ + NULL, /* deinit_hw_render */ + NULL, /* start_render */ NULL, /* check_fbo_dimensions */ NULL, /* recompute_pass_sizes */ - NULL, /* renderchain_render */ + NULL, /* renderchain_render */ + NULL, /* resolve_extensions */ "gl1", }; diff --git a/gfx/drivers_renderchain/gl2_renderchain.c b/gfx/drivers_renderchain/gl2_renderchain.c index 07934a6d52..5e6d5bcad5 100644 --- a/gfx/drivers_renderchain/gl2_renderchain.c +++ b/gfx/drivers_renderchain/gl2_renderchain.c @@ -1461,6 +1461,11 @@ static void gl2_renderchain_init_textures_reference( #endif } +static void gl2_renderchain_resolve_extensions(void *data, + void *chain_data, const char *context_ident) +{ +} + gl_renderchain_driver_t gl2_renderchain = { NULL, /* set_coords */ NULL, /* set_mvp */ @@ -1513,5 +1518,6 @@ gl_renderchain_driver_t gl2_renderchain = { gl2_renderchain_check_fbo_dimensions, gl2_renderchain_recompute_pass_sizes, gl2_renderchain_render, + gl2_renderchain_resolve_extensions, "gl2", }; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 33765da5dd..1519bdc7a3 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -904,6 +904,10 @@ typedef struct gl_renderchain_driver uint64_t frame_count, const struct video_tex_info *tex_info, const struct video_tex_info *feedback_info); + void (*resolve_extensions)( + void *data, + void *chain_data, + const char *context_ident); const char *ident; } gl_renderchain_driver_t;