Get rid of video_context_driver_get_proc_address

This commit is contained in:
twinaphex 2019-08-28 21:26:43 +02:00
parent 88720b540e
commit fa3b927ece
5 changed files with 13 additions and 39 deletions

View File

@ -4325,14 +4325,12 @@ static void gl2_get_overlay_interface(void *data,
static retro_proc_address_t gl2_get_proc_address(void *data, const char *sym)
{
gfx_ctx_proc_address_t proc_address;
gl_t *gl = (gl_t*)data;
proc_address.addr = NULL;
proc_address.sym = sym;
if (gl && gl->ctx_driver->get_proc_address)
return gl->ctx_driver->get_proc_address(sym);
video_context_driver_get_proc_address(&proc_address);
return proc_address.addr;
return NULL;
}
static void gl2_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)

View File

@ -1982,13 +1982,14 @@ static uintptr_t gl_core_get_current_framebuffer(void *data)
return gl->hw_render_fbo;
}
static retro_proc_address_t gl_core_get_proc_address(void *data, const char *sym)
static retro_proc_address_t gl_core_get_proc_address(
void *data, const char *sym)
{
gfx_ctx_proc_address_t proc_address;
proc_address.addr = NULL;
proc_address.sym = sym;
video_context_driver_get_proc_address(&proc_address);
return proc_address.addr;
gl_core_t *gl = (gl_core_t*)data;
if (gl && gl->ctx_driver->get_proc_address)
return gl->ctx_driver->get_proc_address(sym);
return NULL;
}
static const video_poke_interface_t gl_core_poke_interface = {

View File

@ -256,15 +256,8 @@ static void *vg_init(const video_info_t *video,
if (vg_query_extension("KHR_EGL_image")
&& video_context_driver_init_image_buffer((void*)video))
{
gfx_ctx_proc_address_t proc_address;
proc_address.addr = NULL;
proc_address.sym = "vgCreateEGLImageTargetKHR";
video_context_driver_get_proc_address(&proc_address);
pvgCreateEGLImageTargetKHR =
(PFNVGCREATEEGLIMAGETARGETKHRPROC)proc_address.addr;
if (vg->ctx_driver->get_proc_address)
pvgCreateEGLImageTargetKHR = (PFNVGCREATEEGLIMAGETARGETKHRPROC)vg->ctx_driver->get_proc_address("vgCreateEGLImageTargetKHR");
if (pvgCreateEGLImageTargetKHR)
{

View File

@ -19645,16 +19645,6 @@ bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data)
return true;
}
bool video_context_driver_get_proc_address(gfx_ctx_proc_address_t *proc)
{
if (!current_video_context.get_proc_address)
return false;
proc->addr = current_video_context.get_proc_address(proc->sym);
return true;
}
bool video_context_driver_get_metrics(gfx_ctx_metrics_t *metrics)
{
if (

View File

@ -1405,12 +1405,6 @@ typedef struct gfx_ctx_input
void **input_data;
} gfx_ctx_input_t;
typedef struct gfx_ctx_proc_address
{
const char *sym;
retro_proc_address_t addr;
} gfx_ctx_proc_address_t;
typedef struct gfx_ctx_ident
{
const char *ident;
@ -1859,8 +1853,6 @@ void video_context_driver_destroy(void);
bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data);
bool video_context_driver_get_proc_address(gfx_ctx_proc_address_t *proc);
bool video_context_driver_suppress_screensaver(bool *bool_data);
bool video_context_driver_get_ident(gfx_ctx_ident_t *ident);