various: add GPU context description

Now that obj_settings_list is used for GPU contexts, detailed
descriptions can be added so that --gpu-context=help can print
the descriptions of the GPU contexts using standard
obj_settings_list help printing.
This commit is contained in:
nanahi 2024-04-15 23:18:44 -04:00 committed by Kacper Michajłow
parent a6ff33425d
commit 2533ea764f
18 changed files with 18 additions and 0 deletions

View File

@ -547,6 +547,7 @@ bool ra_d3d11_ctx_prefer_8bit_output_format(struct ra_ctx *ra)
const struct ra_ctx_fns ra_ctx_d3d11 = {
.type = "d3d11",
.name = "d3d11",
.description = "Direct3D 11",
.reconfig = d3d11_reconfig,
.control = d3d11_control,
.update_render_opts = d3d11_update_render_opts,

View File

@ -147,6 +147,7 @@ static bool get_desc(struct m_obj_desc *dst, int index)
const struct ra_ctx_fns *ctx = contexts[index];
*dst = (struct m_obj_desc) {
.name = ctx->name,
.description = ctx->description,
};
return true;
}

View File

@ -34,6 +34,7 @@ struct ra_ctx {
struct ra_ctx_fns {
const char *type; // API type (for --gpu-api)
const char *name; // name (for --gpu-context)
const char *description; // description (for --gpu-context=help)
// Resize the window, or create a new window if there isn't one yet.
// Currently, there is an unfortunate interaction with ctx->vo, and

View File

@ -123,6 +123,7 @@ static int android_control(struct ra_ctx *ctx, int *events, int request, void *a
const struct ra_ctx_fns ra_ctx_android = {
.type = "opengl",
.name = "android",
.description = "Android/EGL",
.reconfig = android_reconfig,
.control = android_control,
.init = android_init,

View File

@ -646,6 +646,7 @@ static int angle_control(struct ra_ctx *ctx, int *events, int request, void *arg
const struct ra_ctx_fns ra_ctx_angle = {
.type = "opengl",
.name = "angle",
.description = "Win32/ANGLE (via Direct3D)",
.init = angle_init,
.reconfig = angle_reconfig,
.control = angle_control,

View File

@ -739,6 +739,7 @@ static void drm_egl_wakeup(struct ra_ctx *ctx)
const struct ra_ctx_fns ra_ctx_drm_egl = {
.type = "opengl",
.name = "drm",
.description = "DRM/EGL",
.reconfig = drm_egl_reconfig,
.control = drm_egl_control,
.init = drm_egl_init,

View File

@ -598,6 +598,7 @@ static int dxgl_control(struct ra_ctx *ctx, int *events, int request,
const struct ra_ctx_fns ra_ctx_dxgl = {
.type = "opengl",
.name = "dxinterop",
.description = "WGL rendering/Direct3D 9Ex presentation",
.init = dxgl_init,
.reconfig = dxgl_reconfig,
.control = dxgl_control,

View File

@ -342,6 +342,7 @@ static void glx_wait_events(struct ra_ctx *ctx, int64_t until_time_ns)
const struct ra_ctx_fns ra_ctx_glx = {
.type = "opengl",
.name = "x11",
.description = "X11/GLX",
.reconfig = glx_reconfig,
.control = glx_control,
.wakeup = glx_wakeup,

View File

@ -220,6 +220,7 @@ static bool wayland_egl_init(struct ra_ctx *ctx)
const struct ra_ctx_fns ra_ctx_wayland_egl = {
.type = "opengl",
.name = "wayland",
.description = "Wayland/EGL",
.reconfig = wayland_egl_reconfig,
.control = wayland_egl_control,
.wakeup = wayland_egl_wakeup,

View File

@ -380,6 +380,7 @@ static void wgl_update_render_opts(struct ra_ctx *ctx)
const struct ra_ctx_fns ra_ctx_wgl = {
.type = "opengl",
.name = "win",
.description = "Win32/WGL",
.init = wgl_init,
.reconfig = wgl_reconfig,
.control = wgl_control,

View File

@ -216,6 +216,7 @@ static void mpegl_wait_events(struct ra_ctx *ctx, int64_t until_time_ns)
const struct ra_ctx_fns ra_ctx_x11_egl = {
.type = "opengl",
.name = "x11egl",
.description = "X11/EGL",
.reconfig = mpegl_reconfig,
.control = mpegl_control,
.wakeup = mpegl_wakeup,

View File

@ -89,6 +89,7 @@ static int android_control(struct ra_ctx *ctx, int *events, int request, void *a
const struct ra_ctx_fns ra_ctx_vulkan_android = {
.type = "vulkan",
.name = "androidvk",
.description = "Android/Vulkan",
.reconfig = android_reconfig,
.control = android_control,
.init = android_init,

View File

@ -486,6 +486,7 @@ static void display_wait_events(struct ra_ctx *ctx, int64_t until_time_ns)
const struct ra_ctx_fns ra_ctx_vulkan_display = {
.type = "vulkan",
.name = "displayvk",
.description = "VK_KHR_display",
.reconfig = display_reconfig,
.control = display_control,
.wakeup = display_wakeup,

View File

@ -128,6 +128,7 @@ static int mac_vk_control(struct ra_ctx *ctx, int *events, int request, void *ar
const struct ra_ctx_fns ra_ctx_vulkan_mac = {
.type = "vulkan",
.name = "macvk",
.description = "mac/Vulkan (via Metal)",
.reconfig = mac_vk_reconfig,
.control = mac_vk_control,
.init = mac_vk_init,

View File

@ -157,6 +157,7 @@ static void wayland_vk_update_render_opts(struct ra_ctx *ctx)
const struct ra_ctx_fns ra_ctx_vulkan_wayland = {
.type = "vulkan",
.name = "waylandvk",
.description = "Wayland/Vulkan",
.reconfig = wayland_vk_reconfig,
.control = wayland_vk_control,
.wakeup = wayland_vk_wakeup,

View File

@ -107,6 +107,7 @@ static void win_update_render_opts(struct ra_ctx *ctx)
const struct ra_ctx_fns ra_ctx_vulkan_win = {
.type = "vulkan",
.name = "winvk",
.description = "Win32/Vulkan",
.reconfig = win_reconfig,
.control = win_control,
.update_render_opts = win_update_render_opts,

View File

@ -134,6 +134,7 @@ static void xlib_wait_events(struct ra_ctx *ctx, int64_t until_time_ns)
const struct ra_ctx_fns ra_ctx_vulkan_xlib = {
.type = "vulkan",
.name = "x11vk",
.description = "X11/Vulkan",
.reconfig = xlib_reconfig,
.control = xlib_control,
.wakeup = xlib_wakeup,

View File

@ -37,6 +37,7 @@ static bool init(struct ra_ctx *ctx)
const struct ra_ctx_fns ra_ctx_wldmabuf = {
.type = "none",
.name = "wldmabuf",
.description = "Wayland/DMA-BUF",
.init = init,
.uninit = uninit,
};