diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 77c3bbc7b9..17917df2a1 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -18,6 +18,19 @@ #include "video_driver.h" +typedef struct +{ + struct string_list *list; + enum gfx_ctx_api api; +} gfx_api_gpu_map; + +static gfx_api_gpu_map gpu_map[] = { + { NULL, GFX_CTX_VULKAN_API }, + { NULL, GFX_CTX_DIRECT3D10_API }, + { NULL, GFX_CTX_DIRECT3D11_API }, + { NULL, GFX_CTX_DIRECT3D12_API } +}; + video_driver_t *hw_render_context_driver( enum retro_hw_context_type type, int major, int minor) { @@ -121,6 +134,37 @@ enum retro_hw_context_type hw_render_context_type(const char *s) return RETRO_HW_CONTEXT_NONE; } +/* string list stays owned by the caller and must be available at + * all times after the video driver is inited */ +void video_driver_set_gpu_api_devices( + enum gfx_ctx_api api, struct string_list *list) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(gpu_map); i++) + { + if (api == gpu_map[i].api) + { + gpu_map[i].list = list; + break; + } + } +} + +struct string_list* video_driver_get_gpu_api_devices(enum gfx_ctx_api api) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(gpu_map); i++) + { + if (api == gpu_map[i].api) + return gpu_map[i].list; + } + + return NULL; +} + + /** * video_driver_translate_coord_viewport: * @mouse_x : Pointer X coordinate. diff --git a/retroarch.c b/retroarch.c index fceb1b1fd2..01f1553509 100644 --- a/retroarch.c +++ b/retroarch.c @@ -23442,36 +23442,6 @@ const char* video_driver_get_gpu_api_version_string(void) return p_rarch->video_driver_gpu_api_version_string; } -/* string list stays owned by the caller and must be available at - * all times after the video driver is inited */ -void video_driver_set_gpu_api_devices( - enum gfx_ctx_api api, struct string_list *list) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(gpu_map); i++) - { - if (api == gpu_map[i].api) - { - gpu_map[i].list = list; - break; - } - } -} - -struct string_list* video_driver_get_gpu_api_devices(enum gfx_ctx_api api) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(gpu_map); i++) - { - if (api == gpu_map[i].api) - return gpu_map[i].list; - } - - return NULL; -} - /* CAMERA */ /** diff --git a/retroarch_data.h b/retroarch_data.h index d9273cdb13..5f0288cfa3 100644 --- a/retroarch_data.h +++ b/retroarch_data.h @@ -936,12 +936,6 @@ typedef struct video_pixel_scaler void *scaler_out; } video_pixel_scaler_t; -typedef struct -{ - struct string_list *list; - enum gfx_ctx_api api; -} gfx_api_gpu_map; - typedef void *(*constructor_t)(void); typedef void (*destructor_t )(void*); @@ -1606,13 +1600,6 @@ struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END] = { { 1.3333f, "Full" } }; -static gfx_api_gpu_map gpu_map[] = { - { NULL, GFX_CTX_VULKAN_API }, - { NULL, GFX_CTX_DIRECT3D10_API }, - { NULL, GFX_CTX_DIRECT3D11_API }, - { NULL, GFX_CTX_DIRECT3D12_API } -}; - /* TODO/FIXME - turn these into static global variable */ #ifdef HAVE_DISCORD bool discord_is_inited = false;