diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index 9c444b676d..27db8fd692 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -537,6 +537,12 @@ static void *android_gfx_ctx_get_context_data(void *data) } #endif +static uint32_t android_gfx_ctx_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_android = { android_gfx_ctx_init, android_gfx_ctx_destroy, @@ -562,6 +568,7 @@ const gfx_ctx_driver_t gfx_ctx_android = { NULL, NULL, "android", + android_gfx_ctx_get_flags, android_gfx_ctx_bind_hw_render, #ifdef HAVE_VULKAN android_gfx_ctx_get_context_data diff --git a/gfx/drivers_context/bbqnx_ctx.c b/gfx/drivers_context/bbqnx_ctx.c index dc4c3219a1..743f054d04 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -398,6 +398,12 @@ static void gfx_ctx_qnx_get_video_size(void *data, #endif } +static uint32_t gfx_ctx_qnx_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_bbqnx = { gfx_ctx_qnx_init, gfx_ctx_qnx_destroy, @@ -423,5 +429,6 @@ const gfx_ctx_driver_t gfx_ctx_bbqnx = { NULL, NULL, "blackberry_qnx", - gfx_ctx_qnx_bind_hw_render, + gfx_ctx_qnx_get_flags, + gfx_ctx_qnx_bind_hw_render }; diff --git a/gfx/drivers_context/cgl_ctx.c b/gfx/drivers_context/cgl_ctx.c index dbe136f657..5301f6ef3a 100644 --- a/gfx/drivers_context/cgl_ctx.c +++ b/gfx/drivers_context/cgl_ctx.c @@ -340,6 +340,12 @@ error: return NULL; } +static uint32_t gfx_ctx_cgl_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_cgl = { gfx_ctx_cgl_init, gfx_ctx_cgl_destroy, @@ -365,5 +371,6 @@ const gfx_ctx_driver_t gfx_ctx_cgl = { NULL, gfx_ctx_cgl_show_mouse, "cgl", + gfx_ctx_cgl_get_flags, gfx_ctx_cgl_bind_hw_render, }; diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 8d38890fd2..bd79119abb 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -595,6 +595,12 @@ static void cocoagl_gfx_ctx_bind_hw_render(void *data, bool enable) [g_context makeCurrentContext]; } +static uint32_t cocoagl_gfx_ctx_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_cocoagl = { cocoagl_gfx_ctx_init, cocoagl_gfx_ctx_destroy, @@ -620,5 +626,6 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = { NULL, NULL, "cocoagl", + cocoagl_gfx_ctx_get_flags, cocoagl_gfx_ctx_bind_hw_render, }; diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index 7b5a023f93..a7feb1bf5b 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -302,6 +302,12 @@ static bool gfx_ctx_d3d_get_metrics(void *data, return win32_get_metrics(data, type, value); } +static uint32_t gfx_ctx_d3d_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_d3d = { gfx_ctx_d3d_init, gfx_ctx_d3d_destroy, @@ -327,4 +333,5 @@ const gfx_ctx_driver_t gfx_ctx_d3d = { NULL, gfx_ctx_d3d_show_mouse, "d3d", + gfx_ctx_d3d_get_flags, }; diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index 6e2d6979ac..a279884591 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -870,6 +870,12 @@ static void gfx_ctx_drm_bind_hw_render(void *data, bool enable) } } +static uint32_t gfx_ctx_drm_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_drm = { gfx_ctx_drm_init, gfx_ctx_drm_destroy, @@ -895,5 +901,6 @@ const gfx_ctx_driver_t gfx_ctx_drm = { NULL, NULL, "kms", - gfx_ctx_drm_bind_hw_render, + gfx_ctx_drm_get_flags, + gfx_ctx_drm_bind_hw_render }; diff --git a/gfx/drivers_context/emscriptenegl_ctx.c b/gfx/drivers_context/emscriptenegl_ctx.c index ec577563b1..7b06bed330 100644 --- a/gfx/drivers_context/emscriptenegl_ctx.c +++ b/gfx/drivers_context/emscriptenegl_ctx.c @@ -303,6 +303,12 @@ static void gfx_ctx_emscripten_bind_hw_render(void *data, bool enable) #endif } +static uint32_t gfx_ctx_emscripten_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_emscripten = { gfx_ctx_emscripten_init, gfx_ctx_emscripten_destroy, @@ -328,5 +334,6 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = { gfx_ctx_emscripten_write_egl_image, NULL, "emscripten", - gfx_ctx_emscripten_bind_hw_render, + gfx_ctx_emscripten_get_flags, + gfx_ctx_emscripten_bind_hw_render }; diff --git a/gfx/drivers_context/gfx_null_ctx.c b/gfx/drivers_context/gfx_null_ctx.c index f89f917b55..ab2e24890a 100644 --- a/gfx/drivers_context/gfx_null_ctx.c +++ b/gfx/drivers_context/gfx_null_ctx.c @@ -133,6 +133,12 @@ static void *gfx_ctx_null_init(void *video_driver) return (void*)"null"; } +static uint32_t gfx_ctx_null_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_null = { gfx_ctx_null_init, gfx_ctx_null_destroy, @@ -158,6 +164,7 @@ const gfx_ctx_driver_t gfx_ctx_null = { NULL, gfx_ctx_null_show_mouse, "null", - gfx_ctx_null_bind_hw_render, + gfx_ctx_null_get_flags, + gfx_ctx_null_bind_hw_render }; diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 5dc46a2fcf..01bec69607 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -291,6 +291,12 @@ static void gfx_ctx_mali_fbdev_bind_hw_render(void *data, bool enable) #endif } +static uint32_t gfx_ctx_mali_fbdev_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_mali_fbdev = { gfx_ctx_mali_fbdev_init, gfx_ctx_mali_fbdev_destroy, @@ -316,6 +322,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = { NULL, NULL, "mali-fbdev", + gfx_ctx_mali_fbdev_get_flags, gfx_ctx_mali_fbdev_bind_hw_render }; diff --git a/gfx/drivers_context/opendingux_fbdev_ctx.c b/gfx/drivers_context/opendingux_fbdev_ctx.c index ac86af6c34..e8d45bb06b 100644 --- a/gfx/drivers_context/opendingux_fbdev_ctx.c +++ b/gfx/drivers_context/opendingux_fbdev_ctx.c @@ -267,6 +267,12 @@ static void gfx_ctx_opendingux_bind_hw_render(void *data, bool enable) #endif } +static uint32_t gfx_ctx_opendingux_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = { gfx_ctx_opendingux_init, gfx_ctx_opendingux_destroy, @@ -292,5 +298,6 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = { NULL, NULL, "opendingux-fbdev", + gfx_ctx_opendingux_get_flags, gfx_ctx_opendingux_bind_hw_render }; diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index 4859aac7ca..a5cd8a2ff1 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -414,6 +414,12 @@ static void gfx_ctx_ps3_get_video_output_next(void *data) } } +static uint32_t gfx_ctx_ps3_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_ps3 = { gfx_ctx_ps3_init, gfx_ctx_ps3_destroy, @@ -439,5 +445,6 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = { NULL, NULL, "ps3", + gfx_ctx_ps3_get_flags, }; diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index e5984d8af5..4755d4eefa 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -400,6 +400,12 @@ static void sdl_ctx_show_mouse(void *data, bool state) SDL_ShowCursor(state); } +static uint32_t sdl_ctx_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_sdl_gl = { sdl_ctx_init, @@ -426,5 +432,6 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl = NULL, sdl_ctx_show_mouse, "sdl_gl", + sdl_ctx_get_flags, NULL /* bind_hw_render */ }; diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index 8e5b690a43..193aef4f18 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -624,6 +624,12 @@ static gfx_ctx_proc_t gfx_ctx_vc_get_proc_address(const char *symbol) #endif } +static uint32_t gfx_ctx_vc_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_videocore = { gfx_ctx_vc_init, gfx_ctx_vc_destroy, @@ -649,5 +655,6 @@ const gfx_ctx_driver_t gfx_ctx_videocore = { gfx_ctx_vc_image_buffer_write, NULL, "videocore", - gfx_ctx_vc_bind_hw_render, + gfx_ctx_vc_get_flags, + gfx_ctx_vc_bind_hw_render }; diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index 8e180bbdae..3e60cf6876 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -261,6 +261,12 @@ static void gfx_ctx_vivante_swap_buffers(void *data) #endif } +static uint32_t gfx_ctx_vivante_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = { gfx_ctx_vivante_init, gfx_ctx_vivante_destroy, @@ -286,5 +292,6 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = { NULL, NULL, "vivante-fbdev", - gfx_ctx_vivante_bind_hw_render, + gfx_ctx_vivante_get_flags, + gfx_ctx_vivante_bind_hw_render }; diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index 66d756378c..8064548e4f 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -1138,6 +1138,12 @@ static void gfx_ctx_wl_bind_hw_render(void *data, bool enable) } } +static uint32_t gfx_ctx_wl_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_wayland = { gfx_ctx_wl_init, gfx_ctx_wl_destroy, @@ -1163,6 +1169,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = { NULL, NULL, "wayland", + gfx_ctx_wl_get_flags, gfx_ctx_wl_bind_hw_render, #ifdef HAVE_VULKAN gfx_ctx_wl_get_context_data diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index b088e5dc9e..1bb3c710f4 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -448,6 +448,12 @@ static void gfx_ctx_wgl_bind_hw_render(void *data, bool enable) wglMakeCurrent(g_hdc, enable ? g_hw_hrc : g_hrc); } +static uint32_t gfx_ctx_wgl_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_wgl = { gfx_ctx_wgl_init, gfx_ctx_wgl_destroy, @@ -473,6 +479,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = { NULL, gfx_ctx_wgl_show_mouse, "wgl", - gfx_ctx_wgl_bind_hw_render, + gfx_ctx_wgl_get_flags, + gfx_ctx_wgl_bind_hw_render }; diff --git a/gfx/drivers_context/x_ctx.c b/gfx/drivers_context/x_ctx.c index 1f1c659b1d..f9d3ebe1d0 100644 --- a/gfx/drivers_context/x_ctx.c +++ b/gfx/drivers_context/x_ctx.c @@ -886,6 +886,12 @@ static void *gfx_ctx_x_get_context_data(void *data) } #endif +static uint32_t gfx_ctx_x_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_x = { gfx_ctx_x_init, gfx_ctx_x_destroy, @@ -911,6 +917,7 @@ const gfx_ctx_driver_t gfx_ctx_x = { NULL, gfx_ctx_x_show_mouse, "x", + gfx_ctx_x_get_flags, gfx_ctx_x_bind_hw_render, #ifdef HAVE_VULKAN diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index c1aae15d92..6268a074e8 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -574,6 +574,12 @@ static gfx_ctx_proc_t gfx_ctx_xegl_get_proc_address(const char *symbol) return NULL; } +static uint32_t gfx_ctx_xegl_get_flags(void *data) +{ + (void)data; + return GFX_CTX_FLAGS_NONE; +} + const gfx_ctx_driver_t gfx_ctx_x_egl = { gfx_ctx_xegl_init, @@ -600,5 +606,6 @@ const gfx_ctx_driver_t gfx_ctx_x_egl = NULL, gfx_ctx_xegl_show_mouse, "x-egl", - gfx_ctx_xegl_bind_hw_render, + gfx_ctx_xegl_get_flags, + gfx_ctx_xegl_bind_hw_render }; diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index ad90b59381..5f5219f3a9 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -52,6 +52,12 @@ enum display_metric_types DISPLAY_METRIC_DPI }; +enum display_flags +{ + GFX_CTX_FLAGS_NONE = 0, + GFX_CTX_FLAGS_CORE_GL +}; + enum gfx_ctx_ctl_state { GFX_CTL_NONE = 0, @@ -182,6 +188,8 @@ typedef struct gfx_ctx_driver /* Human readable string. */ const char *ident; + uint32_t (*get_flags)(void *data); + /* Optional. Binds HW-render offscreen context. */ void (*bind_hw_render)(void *data, bool enable);