summaryrefslogtreecommitdiffstats
path: root/video/out/vulkan
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-02-03 16:20:18 +0100
committerNiklas Haas <github-daiK1o@haasn.dev>2022-02-03 18:22:14 +0100
commit88c6c84b64f91bd1f532a62770ebf4615bda098e (patch)
treee2e56403a247a29a80e0e7b5f09a8405a9f26c3f /video/out/vulkan
parente8e89fae3819c84068562201fe18cbe7ec180fd7 (diff)
downloadmpv-88c6c84b64f91bd1f532a62770ebf4615bda098e.tar.bz2
mpv-88c6c84b64f91bd1f532a62770ebf4615bda098e.tar.xz
libplacebo: update log helpers
Use the pl_log APIs introduced in libplacebo v4, replacing the deprecated pl_context concept.
Diffstat (limited to 'video/out/vulkan')
-rw-r--r--video/out/vulkan/common.h4
-rw-r--r--video/out/vulkan/context.c4
-rw-r--r--video/out/vulkan/context_display.c2
-rw-r--r--video/out/vulkan/utils.c20
4 files changed, 13 insertions, 17 deletions
diff --git a/video/out/vulkan/common.h b/video/out/vulkan/common.h
index 523de8e66e..4165ec10ee 100644
--- a/video/out/vulkan/common.h
+++ b/video/out/vulkan/common.h
@@ -27,8 +27,8 @@
// Shared struct used to hold vulkan context information
struct mpvk_ctx {
- struct mp_log *pl_log;
- struct pl_context *ctx;
+ struct mp_log *log;
+ pl_log pllog;
const struct pl_vk_inst *vkinst;
const struct pl_vulkan *vulkan;
const struct pl_gpu *gpu; // points to vulkan->gpu for convenience
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index 216e653c82..def2ee3901 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -162,9 +162,9 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk,
p->params = params;
p->opts = mp_get_config_group(p, ctx->global, &vulkan_conf);
- assert(vk->ctx);
+ assert(vk->pllog);
assert(vk->vkinst);
- vk->vulkan = pl_vulkan_create(vk->ctx, &(struct pl_vulkan_params) {
+ vk->vulkan = pl_vulkan_create(vk->pllog, &(struct pl_vulkan_params) {
.instance = vk->vkinst->instance,
.surface = vk->surface,
.async_transfer = p->opts->async_transfer,
diff --git a/video/out/vulkan/context_display.c b/video/out/vulkan/context_display.c
index 956a3f2a2f..4568f1dc46 100644
--- a/video/out/vulkan/context_display.c
+++ b/video/out/vulkan/context_display.c
@@ -388,7 +388,7 @@ static bool display_init(struct ra_ctx *ctx)
.instance = vk->vkinst->instance,
.device_name = device_name,
};
- VkPhysicalDevice device = pl_vulkan_choose_device(vk->ctx, &vulkan_params);
+ VkPhysicalDevice device = pl_vulkan_choose_device(vk->pllog, &vulkan_params);
talloc_free(device_name);
if (!device) {
MP_MSG(ctx, msgl, "Failed to open physical device.\n");
diff --git a/video/out/vulkan/utils.c b/video/out/vulkan/utils.c
index f125962e5f..cd69334aa9 100644
--- a/video/out/vulkan/utils.c
+++ b/video/out/vulkan/utils.c
@@ -3,30 +3,26 @@
bool mpvk_init(struct mpvk_ctx *vk, struct ra_ctx *ctx, const char *surface_ext)
{
- vk->ctx = pl_context_create(PL_API_VER, NULL);
- if (!vk->ctx)
+ vk->log = mp_log_new(ctx, ctx->log, "libplacebo");
+ vk->pllog = mppl_log_create(vk->log);
+ if (!vk->pllog)
goto error;
- vk->pl_log = mp_log_new(ctx, ctx->log, "libplacebo");
- mppl_ctx_set_log(vk->ctx, vk->pl_log, true);
- mp_verbose(vk->pl_log, "Initialized libplacebo %s (API v%d)\n",
- PL_VERSION, PL_API_VER);
-
const char *exts[] = {
VK_KHR_SURFACE_EXTENSION_NAME,
surface_ext,
};
- vk->vkinst = pl_vk_inst_create(vk->ctx, &(struct pl_vk_inst_params) {
+ mppl_log_set_probing(vk->pllog, true);
+ vk->vkinst = pl_vk_inst_create(vk->pllog, &(struct pl_vk_inst_params) {
.debug = ctx->opts.debug,
.extensions = exts,
.num_extensions = MP_ARRAY_SIZE(exts),
});
-
+ mppl_log_set_probing(vk->pllog, false);
if (!vk->vkinst)
goto error;
- mppl_ctx_set_log(vk->ctx, vk->pl_log, false); // disable probing
return true;
error:
@@ -43,6 +39,6 @@ void mpvk_uninit(struct mpvk_ctx *vk)
}
pl_vk_inst_destroy(&vk->vkinst);
- pl_context_destroy(&vk->ctx);
- TA_FREEP(&vk->pl_log);
+ pl_log_destroy(&vk->pllog);
+ TA_FREEP(&vk->log);
}