From 275c00974e51e87db76f975234ae1c9b2c413292 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 4 Oct 2021 06:18:55 +0200 Subject: vo_gpu: libplacebo: drop conditional code paths for old versions No longer needed with the bump to v3.104. --- video/out/hwdec/hwdec_vaapi_vk.c | 12 +----------- video/out/placebo/ra_pl.c | 19 ------------------- video/out/vulkan/context.c | 4 ---- 3 files changed, 1 insertion(+), 34 deletions(-) (limited to 'video') diff --git a/video/out/hwdec/hwdec_vaapi_vk.c b/video/out/hwdec/hwdec_vaapi_vk.c index 328560b0ab..b6af805e39 100644 --- a/video/out/hwdec/hwdec_vaapi_vk.c +++ b/video/out/hwdec/hwdec_vaapi_vk.c @@ -46,13 +46,8 @@ static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper, bool probing) uint32_t offset = p->desc.layers[n].offset[0]; uint32_t pitch = p->desc.layers[n].pitch[0]; -#if PL_API_VER >= 88 // AMD drivers do not return the size in the surface description, so we - // need to query it manually. The reason we guard this logic behind - // PL_API_VER >= 88 is that the same drivers also require DRM format - // modifier support in order to not produce corrupted textures, so - // having this #ifdef merely exists to protect users from combining - // too-new mpv with too-old libplacebo. + // need to query it manually. if (size == 0) { size = lseek(fd, 0, SEEK_END); if (size == -1) { @@ -67,7 +62,6 @@ static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper, bool probing) return false; } } -#endif struct pl_tex_params tex_params = { .w = mp_image_plane_w(&p->layout, n), @@ -82,12 +76,8 @@ static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper, bool probing) }, .size = size, .offset = offset, -#if PL_API_VER >= 88 .drm_format_mod = p->desc.objects[id].drm_format_modifier, -#endif -#if PL_API_VER >= 106 .stride_w = pitch, -#endif }, }; diff --git a/video/out/placebo/ra_pl.c b/video/out/placebo/ra_pl.c index 168450a269..2233434bf8 100644 --- a/video/out/placebo/ra_pl.c +++ b/video/out/placebo/ra_pl.c @@ -142,14 +142,9 @@ bool mppl_wrap_tex(struct ra *ra, const struct pl_tex *pltex, .blit_dst = pltex->params.blit_dst, .host_mutable = pltex->params.host_writable, .downloadable = pltex->params.host_readable, -#if PL_API_VER >= 103 // These don't exist upstream, so just pick something reasonable .src_linear = pltex->params.format->caps & PL_FMT_CAP_LINEAR, .src_repeat = false, -#else - .src_linear = pltex->params.sample_mode == PL_TEX_SAMPLE_LINEAR, - .src_repeat = pltex->params.address_mode == PL_TEX_ADDRESS_REPEAT, -#endif }, .priv = (void *) pltex, }; @@ -173,12 +168,6 @@ static struct ra_tex *tex_create_pl(struct ra *ra, .blit_dst = params->blit_dst || params->render_dst, .host_writable = params->host_mutable, .host_readable = params->downloadable, -#if PL_API_VER < 103 - .sample_mode = params->src_linear ? PL_TEX_SAMPLE_LINEAR - : PL_TEX_SAMPLE_NEAREST, - .address_mode = params->src_repeat ? PL_TEX_ADDRESS_REPEAT - : PL_TEX_ADDRESS_CLAMP, -#endif .initial_data = params->initial_data, }); @@ -360,7 +349,6 @@ static void blit_pl(struct ra *ra, struct ra_tex *dst, struct ra_tex *src, pldst.y1 = MPMIN(MPMAX(dst_rc->y1, 0), dst->params.h); } -#if PL_API_VER >= 103 pl_tex_blit(get_gpu(ra), &(struct pl_tex_blit_params) { .src = src->priv, .dst = dst->priv, @@ -369,9 +357,6 @@ static void blit_pl(struct ra *ra, struct ra_tex *dst, struct ra_tex *src, .sample_mode = src->params.src_linear ? PL_TEX_SAMPLE_LINEAR : PL_TEX_SAMPLE_NEAREST, }); -#else - pl_tex_blit(get_gpu(ra), dst->priv, src->priv, pldst, plsrc); -#endif } static const enum pl_var_type var_type[RA_VARTYPE_COUNT] = { @@ -602,12 +587,10 @@ static void renderpass_run_pl(struct ra *ra, case RA_VARTYPE_IMG_W: { struct ra_tex *tex = *((struct ra_tex **) val->data); bind.object = tex->priv; -#if PL_API_VER >= 103 bind.sample_mode = tex->params.src_linear ? PL_TEX_SAMPLE_LINEAR : PL_TEX_SAMPLE_NEAREST; bind.address_mode = tex->params.src_repeat ? PL_TEX_ADDRESS_REPEAT : PL_TEX_ADDRESS_CLAMP; -#endif break; } case RA_VARTYPE_BUF_RO: @@ -627,9 +610,7 @@ static void renderpass_run_pl(struct ra *ra, .num_var_updates = p->num_varups, .desc_bindings = p->binds, .push_constants = params->push_constants, -#if PL_API_VER >= 60 .timer = get_active_timer(ra), -#endif }; if (p->pl_pass->params.type == PL_PASS_RASTER) { diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index efc62a2552..7c9f2f6151 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -172,9 +172,7 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk, .async_compute = p->opts->async_compute, .queue_count = p->opts->queue_count, .device_name = p->opts->device, -#if PL_API_VER >= 24 .disable_events = p->opts->disable_events, -#endif }); if (!vk->vulkan) goto error; @@ -189,11 +187,9 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk, .surface = vk->surface, .present_mode = preferred_mode, .swapchain_depth = ctx->vo->opts->swapchain_depth, -#if PL_API_VER >= 29 // mpv already handles resize events, so gracefully allow suboptimal // swapchains to exist in order to make resizing even smoother .allow_suboptimal = true, -#endif }; if (p->opts->swap_mode >= 0) // user override -- cgit v1.2.3