diff --git a/gfx/common/d3d8_common.c b/gfx/common/d3d8_common.c index 3b5af8ef95..0a6781d361 100644 --- a/gfx/common/d3d8_common.c +++ b/gfx/common/d3d8_common.c @@ -39,8 +39,8 @@ #include #endif -static UINT SDKVersion = 0; - +/* TODO/FIXME - static globals */ +static UINT SDKVersion = 0; #ifdef HAVE_DYNAMIC_D3D static dylib_t g_d3d8_dll; #ifdef HAVE_D3DX diff --git a/gfx/common/d3d9_common.c b/gfx/common/d3d9_common.c index c78caaad59..3314cfa731 100644 --- a/gfx/common/d3d9_common.c +++ b/gfx/common/d3d9_common.c @@ -39,8 +39,8 @@ #include #endif +/* TODO/FIXME - static globals */ static UINT d3d9_SDKVersion = 0; - #ifdef HAVE_DYNAMIC_D3D static dylib_t g_d3d9_dll; #ifdef HAVE_D3DX diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index 55faa4a385..a08b509d18 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -51,7 +51,6 @@ static dylib_t vulkan_library; static VkInstance cached_instance_vk; static VkDevice cached_device_vk; static retro_vulkan_destroy_device_t cached_destroy_device_vk; -static struct string_list *vulkan_gpu_list = NULL; #if 0 #define WSI_HARDENING_TEST @@ -1576,10 +1575,10 @@ static bool vulkan_context_init_gpu(gfx_ctx_vulkan_data_t *vk) return false; } - if (vulkan_gpu_list) - string_list_free(vulkan_gpu_list); + if (vk->gpu_list) + string_list_free(vk->gpu_list); - vulkan_gpu_list = string_list_new(); + vk->gpu_list = string_list_new(); for (i = 0; i < gpu_count; i++) { @@ -1590,10 +1589,10 @@ static bool vulkan_context_init_gpu(gfx_ctx_vulkan_data_t *vk) RARCH_LOG("[Vulkan]: Found GPU at index %d: %s\n", i, gpu_properties.deviceName); - string_list_append(vulkan_gpu_list, gpu_properties.deviceName, attr); + string_list_append(vk->gpu_list, gpu_properties.deviceName, attr); } - video_driver_set_gpu_api_devices(GFX_CTX_VULKAN_API, vulkan_gpu_list); + video_driver_set_gpu_api_devices(GFX_CTX_VULKAN_API, vk->gpu_list); if (0 <= gpu_index && gpu_index < (int)gpu_count) { @@ -2651,10 +2650,10 @@ void vulkan_context_destroy(gfx_ctx_vulkan_data_t *vk, } video_driver_set_gpu_api_devices(GFX_CTX_VULKAN_API, NULL); - if (vulkan_gpu_list) + if (vk->gpu_list) { - string_list_free(vulkan_gpu_list); - vulkan_gpu_list = NULL; + string_list_free(vk->gpu_list); + vk->gpu_list = NULL; } } diff --git a/gfx/common/vulkan_common.h b/gfx/common/vulkan_common.h index bac43c8f21..ecb3abdbd7 100644 --- a/gfx/common/vulkan_common.h +++ b/gfx/common/vulkan_common.h @@ -20,6 +20,9 @@ #include "../../config.h" #endif +#include + + #define VULKAN_DESCRIPTOR_MANAGER_BLOCK_SETS 16 #define VULKAN_MAX_DESCRIPTOR_POOL_SIZES 16 #define VULKAN_BUFFER_BLOCK_SIZE (64 * 1024) @@ -165,6 +168,8 @@ typedef struct gfx_ctx_vulkan_data /* Used to check if we need to use mailbox emulation or not. * Only relevant on Windows for now. */ bool fullscreen; + + struct string_list *gpu_list; } gfx_ctx_vulkan_data_t; struct vulkan_display_surface_info