diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index a1ebcd872a..92a2c813c5 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -386,6 +386,7 @@ void vulkan_copy_staging_to_dynamic(vk_t *vk, VkCommandBuffer cmd, #ifdef VULKAN_DEBUG_TEXTURE_ALLOC static VkImage vk_images[4 * 1024]; static unsigned vk_count; +static unsigned track_seq; void vulkan_log_textures(void) { @@ -398,7 +399,6 @@ void vulkan_log_textures(void) vk_count = 0; } -static unsigned track_seq; static void vulkan_track_alloc(VkImage image) { vk_images[vk_count++] = image; diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index 7198b974e1..f1122e816e 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -42,14 +42,7 @@ #include "../../verbosity.h" #include "../../configuration.h" -static enum gfx_ctx_api android_api = GFX_CTX_NONE; - -/* forward declaration */ -int system_property_get(const char *cmd, const char *args, char *value); - #ifdef HAVE_OPENGLES -static bool g_es3 = false; - #ifndef EGL_OPENGL_ES3_BIT_KHR #define EGL_OPENGL_ES3_BIT_KHR 0x0040 #endif @@ -68,6 +61,16 @@ typedef struct #endif } android_ctx_data_t; + +/* Forward declaration */ +int system_property_get(const char *cmd, const char *args, char *value); + +/* TODO/FIXME - static global */ +static enum gfx_ctx_api android_api = GFX_CTX_NONE; +#ifdef HAVE_OPENGLES +static bool g_es3 = false; +#endif + static void android_gfx_ctx_destroy(void *data) { android_ctx_data_t *and = (android_ctx_data_t*)data; diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 3e0ec110a1..50adccee9a 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -189,16 +189,16 @@ static bool wgl_has_extension(const char *extension, const char *extensions) static void create_gl_context(HWND hwnd, bool *quit) { struct retro_hw_render_callback *hwr = video_driver_get_hw_context(); - bool debug = hwr->debug_context; bool core_context = (win32_major * 1000 + win32_minor) >= 3001; win32_hdc = GetDC(hwnd); +#ifdef GL_DEBUG + bool debug = true; +#else + bool debug = hwr->debug_context; +#endif win32_setup_pixel_format(win32_hdc, true); -#ifdef GL_DEBUG - debug = true; -#endif - if (win32_hrc) { RARCH_LOG("[WGL]: Using cached GL context.\n"); @@ -272,21 +272,24 @@ static void create_gl_context(HWND hwnd, bool *quit) if (!pcreate_context) pcreate_context = (wglCreateContextAttribsProc)gfx_ctx_wgl_get_proc_address("wglCreateContextAttribsARB"); - /* In order to support the core info "required_hw_api" field correctly, we should try to init the highest available - * version GL context possible. This means trying successively lower versions until it works, because GL has - * no facility for determining the highest possible supported version. + /* In order to support the core info "required_hw_api" + * field correctly, we should try to init the highest available + * version GL context possible. This means trying successively + * lower versions until it works, because GL has + * no facility for determining the highest possible + * supported version. */ if (pcreate_context) { int i; - int gl_versions[][2] = {{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, {3, 1}, {3, 0}}; - int gl_version_rows = ARRAY_SIZE(gl_versions); int (*versions)[2]; - int version_rows = 0; - HGLRC context = NULL; + int gl_versions[][2] = {{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, {3, 1}, {3, 0}}; + int gl_version_rows = ARRAY_SIZE(gl_versions); + int version_rows = 0; + HGLRC context = NULL; + int version_rows = gl_version_rows; - versions = gl_versions; - version_rows = gl_version_rows; + versions = gl_versions; /* only try higher versions when core_context is true */ if (!core_context) @@ -330,9 +333,13 @@ static void create_gl_context(HWND hwnd, bool *quit) /* found a suitable version that is high enough, we can stop now */ break; } - else if (versions[i][0] == win32_major && versions[i][1] == win32_minor) + else if ( + versions[i][0] == win32_major && + versions[i][1] == win32_minor) { - /* The requested version was tried and is not supported, go ahead and fail since everything else will be lower than that. */ + /* The requested version was tried and + * is not supported, go ahead and fail + * since everything else will be lower than that. */ break; } } diff --git a/libretro-common/queues/task_queue.c b/libretro-common/queues/task_queue.c index 00358fdfbf..18029ce78c 100644 --- a/libretro-common/queues/task_queue.c +++ b/libretro-common/queues/task_queue.c @@ -65,8 +65,6 @@ static task_queue_t tasks_finished = {NULL, NULL}; static struct retro_task_impl *impl_current = NULL; static bool task_threaded_enable = false; -static uint32_t task_count = 0; - #ifdef HAVE_THREADS static slock_t *running_lock = NULL; static slock_t *finished_lock = NULL; @@ -890,7 +888,9 @@ char* task_get_title(retro_task_t *task) retro_task_t *task_init(void) { - retro_task_t *task = (retro_task_t*)malloc(sizeof(*task)); + /* TODO/FIXME - static local global */ + static uint32_t task_count = 0; + retro_task_t *task = (retro_task_t*)malloc(sizeof(*task)); if (!task) return NULL;