Skip to content

rendervulkan, pipewire: fix NV12 storage image support for PipeWire capture - #2502

Open
ErenYeager1836 wants to merge 1 commit into
ValveSoftware:masterfrom
ErenYeager1836:fix/nv12-storage-nvidia
Open

ErenYeager1836 wants to merge 1 commit into
ValveSoftware:masterfrom
ErenYeager1836:fix/nv12-storage-nvidia

Conversation

@ErenYeager1836

Copy link
Copy Markdown

On drivers where VK_FORMAT_G8_B8R8_2PLANE_420_UNORM lacks STORAGE_IMAGE_BIT (such as NVIDIA proprietary), creating an NV12 storage image requires VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, and listing the per-plane formats (R8_UNORM and R8G8_UNORM) in VkImageFormatListCreateInfo. Without extended usage, storage writes are invalid under the Vulkan specification and are dropped by the driver, causing solid green frames (all zero bytes) in Steam Remote Play / PipeWire.

Furthermore, dst_luma and dst_chroma in descriptor_set.h were declared with an rgba8 format qualifier instead of r8 and rg8, violating storage image format matching with the underlying plane views.

This PR:

  1. Adds R8_UNORM and R8G8_UNORM to VkImageFormatListCreateInfo and enables MUTABLE_FORMAT_BIT and EXTENDED_USAGE_BIT for YCbCr storage textures in CVulkanTexture::BInit.
  2. Uses r8 and rg8 format qualifiers for dst_luma and dst_chroma when NV12_EXPORT is defined.
  3. Implements vulkan_supports_nv12_storage() and only advertises NV12 in PipeWire if storage is supported by the device.

Closes #2489

@ErenYeager1836
ErenYeager1836 force-pushed the fix/nv12-storage-nvidia branch from 40b0540 to 8fe5abf Compare October 18, 2026 05:07
…apture

On drivers where VK_FORMAT_G8_B8R8_2PLANE_420_UNORM lacks STORAGE_IMAGE_BIT
(such as NVIDIA proprietary), creating an NV12 storage image requires
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, and
listing the per-plane formats (R8_UNORM and R8G8_UNORM) in
VkImageFormatListCreateInfo. Without extended usage, storage writes are
invalid under the Vulkan specification and are dropped by the driver,
causing solid green frames (0x00 bytes) in Steam Remote Play / PipeWire.

This commit:
1. Adds R8_UNORM and R8G8_UNORM to VkImageFormatListCreateInfo and enables
   MUTABLE_FORMAT_BIT and EXTENDED_USAGE_BIT for YCbCr storage textures.
2. Implements vulkan_supports_nv12_storage() and only advertises NV12
   in PipeWire if storage is supported by the device.

Closes ValveSoftware#2489
@ErenYeager1836
ErenYeager1836 force-pushed the fix/nv12-storage-nvidia branch from 8fe5abf to 13178bd Compare October 20, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant