From bf7b1c9d9c252bed7ea6eb30fcef1e5f201bfec6 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 31 May 2022 20:04:33 +0200 Subject: [PATCH] (Wayland) Fixups --- gfx/common/wayland_common.c | 4 +--- gfx/common/wayland_common.h | 2 +- gfx/drivers_context/wayland_ctx.c | 11 ++++++----- gfx/drivers_context/wayland_vk_ctx.c | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/gfx/common/wayland_common.c b/gfx/common/wayland_common.c index 1b7c2df7ab..f7e5d082cd 100644 --- a/gfx/common/wayland_common.c +++ b/gfx/common/wayland_common.c @@ -412,9 +412,7 @@ static bool draw_splash_screen(gfx_ctx_wayland_data_t *wl) return true; } - - -bool gfx_ctx_wl_init_common(void *video_driver, +bool gfx_ctx_wl_init_common( const toplevel_listener_t *toplevel_listener, gfx_ctx_wayland_data_t **wwl) { int i; diff --git a/gfx/common/wayland_common.h b/gfx/common/wayland_common.h index 6f08772e7d..29ef375f66 100644 --- a/gfx/common/wayland_common.h +++ b/gfx/common/wayland_common.h @@ -61,7 +61,7 @@ void gfx_ctx_wl_update_title_common(gfx_ctx_wayland_data_t *wl); bool gfx_ctx_wl_get_metrics_common(gfx_ctx_wayland_data_t *wl, enum display_metric_types type, float *value); -bool gfx_ctx_wl_init_common(void *video_driver, +bool gfx_ctx_wl_init_common( const toplevel_listener_t *toplevel_listener, gfx_ctx_wayland_data_t **wl); diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index 8af43658f8..6784e0f62c 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -271,12 +271,12 @@ error: } #endif -static void *gfx_ctx_wl_init(void *video_driver) +static void *gfx_ctx_wl_init(void *data) { int i; gfx_ctx_wayland_data_t *wl = NULL; - if (!gfx_ctx_wl_init_common(video_driver, &toplevel_listener, &wl)) + if (!gfx_ctx_wl_init_common(&toplevel_listener, &wl)) goto error; #ifdef HAVE_EGL @@ -460,7 +460,7 @@ static enum gfx_ctx_api gfx_ctx_wl_get_api(void *data) return wl_api; } -static bool gfx_ctx_wl_bind_api(void *video_driver, +static bool gfx_ctx_wl_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { #ifdef HAVE_EGL @@ -531,17 +531,18 @@ static uint32_t gfx_ctx_wl_get_flags(void *data) { uint32_t flags = 0; gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data; + const char *video_ident = video_driver_get_ident(); if (wl->core_hw_context_enable) BIT32_SET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT); - if (string_is_equal(video_driver_get_ident(), "glcore")) + if (string_is_equal(video_ident, "glcore")) { #if defined(HAVE_SLANG) && defined(HAVE_SPIRV_CROSS) BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_SLANG); #endif } - else if (string_is_equal(video_driver_get_ident(), "gl")) + else if (string_is_equal(video_ident, "gl")) { #ifdef HAVE_GLSL BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_GLSL); diff --git a/gfx/drivers_context/wayland_vk_ctx.c b/gfx/drivers_context/wayland_vk_ctx.c index 15c737f03f..f19e4de04a 100644 --- a/gfx/drivers_context/wayland_vk_ctx.c +++ b/gfx/drivers_context/wayland_vk_ctx.c @@ -151,12 +151,12 @@ static const toplevel_listener_t toplevel_listener = { }, }; -static void *gfx_ctx_wl_init(void *video_driver) +static void *gfx_ctx_wl_init(void *data) { int i; gfx_ctx_wayland_data_t *wl = NULL; - if (!gfx_ctx_wl_init_common(video_driver, &toplevel_listener, &wl)) + if (!gfx_ctx_wl_init_common(&toplevel_listener, &wl)) goto error; if (!vulkan_context_init(&wl->vk, VULKAN_WSI_WAYLAND)) @@ -257,7 +257,7 @@ static enum gfx_ctx_api gfx_ctx_wl_get_api(void *data) return GFX_CTX_VULKAN_API; } -static bool gfx_ctx_wl_bind_api(void *video_driver, +static bool gfx_ctx_wl_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { if (api == GFX_CTX_VULKAN_API)