Files
FFmpeg/libavfilter
Philip Langdale 8ad6288553 avfilter/vf_libplacebo: add flag to inherit the input's Vulkan device
vf_libplacebo is unique in that it can function as both a Vulkan filter, and a
software filter, depending on how it the filter graph is configured. While this
is very flexible, it create a problem in situations where the filter does not
receive a Vulkan hw frames context up front. When that doesn't happen, it will
initialise its own standalone pl context, and then fail to interoperate with
a context provided via the input link. This then leads to graph failures.

There are two primary scenarios where this existing logic breaks what should
be valid configurations:
* When the global filter hw device is a cuda device and we use something like
  `hwupload=derive_device=vulkan` to pass frames from cuda to vulkan
* In mpv (and probably other media players) which don't set the global filter
  hw device at all. In this case, it's impossible to configure vf_libplacebo
  to use a hw frames ctx, even if it's using Vulkan for everythng else. This
  prevents the use of vf_libplacebo in any fully hardware accelerated pipeline
  in mpv

There are various ways we could imagine addressing it - such as allowing the
filter to discard the initial pl context and recreating it based on the passed
in device, but it's easier to reason about if we add a flag that explicitly
tells the filter that it should inherit the device context from the input link.
This puts the filter into a mode that works like all the other Vulkan filters.

This requires explicit configuration from the user, but the intent is clearer,
and the user can always know when it's necessary as they define the filter
graph.
2026-07-09 13:25:09 +00:00
..
2026-05-15 20:29:29 +02:00
2026-05-15 20:29:29 +02:00