Skip to content

vulkan/context: update minimum vulkan header version and add new ffmpeg requested extensions - #18570

Open
philipl wants to merge 4 commits into
mpv-player:masterfrom
philipl:vulkan-lavu-resync
Open

philipl wants to merge 4 commits into
mpv-player:masterfrom
philipl:vulkan-lavu-resync

Conversation

@philipl

@philipl philipl commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

This set of changes brings our requested Vulkan extensions and features back in sync with both ffmpeg and libplacebo, while bumping our required Vulkan headers up, allowing for the removal of a bunch of conditional #ifdeferry.

My commits do the header version bump and remove an unnecessary extension request, with @cyanreg's changes from #18521 layered on top. Note that we are continuing the mpv practice of not redundantly including extensions and features that libplacebo already enables.

Maybe we'd prefer not to remove the shader object extension to avoid functional degradation with older ffmpeg releases; if so we can just not merge that commit.

This supersedes #18521.

philipl and others added 4 commits October 4, 2026 21:17
Debian stable is on 1.4.309, and Ubuntu LTS is brand new this year, so we have
an opportunity to bump our minimum headers up.

This lets us drop the #ifdef checks that guard the extension entries and
feature structs for extensions older than that release, and reference
VK_KHR_video_decode_av1 through its define rather than as a string
literal.
Our general principle is that if libplacebo requests a Vulkan extension or
feature that we want, we don't redundantly request it ourselves. Both mpv and
libplacebo have resynced their extension lists based on what ffmpeg wants,
and in the process, `shaderZeroInitializeWorkgroupMemory` ended up in both
lists. So we should remove it from mpv.

In the process of doing this audit, I noted that the video maintenance
extensions we request are also in libplacebo, but not in our minimum version
(7.360.1), so we should keep the explicit requests for now.
Bring the extensions and features we request in line with what the libavutil
Vulkan hwcontext enables, so FFmpeg can make full use of the device we give it.

New extensions, along with their matching features:
* VK_KHR_workgroup_memory_explicit_layout
* VK_KHR_shader_maximal_reconvergence (1.3.276)
* VK_EXT_shader_replicated_composites (1.3.286)
* VK_EXT_zero_initialize_device_memory (1.4.315)
* VK_KHR_unified_image_layouts (1.4.317)
* VK_EXT_shader_long_vector (1.4.337)
* VK_KHR_maintenance11 (1.4.350)

The core 1.0-1.3 features now match lavu's device_features_copy_needed(),
minus the ones libplacebo already requests. Dynamic rendering is now
requested through VkPhysicalDeviceVulkan13Features, which libplacebo maps
back onto the extension structs for older devices.

Not mirrored from lavu:
* Video encode extensions, as we only decode.
* VK_KHR_internally_synchronized_queues. libplacebo creates the queues, and
  newer versions enable it on their own. Enabling the feature with a libplacebo
  that doesn't create its queues with the flag would make lavu request queues
  with a flag they were never created with.
* VK_EXT_physical_device_drm, which lavu only uses when creating its own device.
FFmpeg doesn't use it anymore, since Mesa doesn't cache shader objects.
@philipl
philipl requested a review from kasper93 October 5, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants