diff options
-rw-r--r-- | video/out/vulkan/context.c | 14 | ||||
-rw-r--r-- | video/out/vulkan/context.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index 9bdeb14d9b..efc62a2552 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -221,6 +221,20 @@ bool ra_vk_ctx_resize(struct ra_ctx *ctx, int width, int height) return ok; } +char *ra_vk_ctx_get_device_name(struct ra_ctx *ctx) +{ + /* + * This implementation is a bit odd because it has to work even if the + * ctx hasn't been initialised yet. A context implementation may need access + * to the device name before it can fully initialise the ctx. + */ + struct vulkan_opts *opts = mp_get_config_group(NULL, ctx->global, + &vulkan_conf); + char *device_name = talloc_strdup(NULL, opts->device); + talloc_free(opts); + return device_name; +} + static int color_depth(struct ra_swapchain *sw) { return 0; // TODO: implement this somehow? diff --git a/video/out/vulkan/context.h b/video/out/vulkan/context.h index 6ae64bb0f5..d85b3fe193 100644 --- a/video/out/vulkan/context.h +++ b/video/out/vulkan/context.h @@ -25,3 +25,6 @@ bool ra_vk_ctx_resize(struct ra_ctx *ctx, int width, int height); // May be called on a ra_ctx of any type. struct mpvk_ctx *ra_vk_ctx_get(struct ra_ctx *ctx); + +// Get the user requested Vulkan device name. +char *ra_vk_ctx_get_device_name(struct ra_ctx *ctx);
\ No newline at end of file |