Skip to content

Commit 6080136

Browse files
committed
Add VK_EXT_ycbcr_3plane_16bit_lsb_formats extension
This extension adds support for 10/12bit YCbCr formats used by software decoders like ffmpeg, dav1d and libvpx. See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34303
1 parent d90ada3 commit 6080136

7 files changed

Lines changed: 272 additions & 5 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2026 The Khronos Group Inc.
2+
//
3+
// SPDX-License-Identifier: CC-BY-4.0
4+
5+
include::{generated}/meta/{refprefix}VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc[]
6+
7+
=== Other Extension Metadata
8+
9+
*Last Modified Date*::
10+
2026-04-30
11+
*IP Status*::
12+
No known IP claims.
13+
*Contributors*::
14+
- Robert Mader, Collabora
15+
16+
=== Description
17+
18+
This extension adds some 10/12/14bit {YCbCr} formats that are in common use for
19+
video software encode and decode, but were not part of the
20+
`apiext:VK_KHR_sampler_ycbcr_conversion` extension.
21+
22+
include::{generated}/interfaces/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc[]
23+
24+
=== Version History
25+
26+
* Revision 1, 2026-04-30 (Robert Mader)
27+
** Initial draft

chapters/descriptorbuffers.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,19 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and]
596596
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
597597
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
598598
endif::VK_EXT_ycbcr_2plane_444_formats[]
599+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
600+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
601+
feature is not enabled, pname:format must: not be
602+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT,
603+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT,
604+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT,
605+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT,
606+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT,
607+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT,
608+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT,
609+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT or
610+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
611+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
599612
****
600613

601614
include::{generated}/validity/structs/VkDescriptorAddressInfoEXT.adoc[]

chapters/features.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6033,6 +6033,39 @@ endif::VK_BASE_VERSION_1_3[]
60336033
--
60346034
endif::VK_EXT_ycbcr_2plane_444_formats[]
60356035

6036+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
6037+
[open,refpage='VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT',desc='Structure describing whether the implementation supports additional 3-plane 16bit LSB {YCbCr} formats',type='structs']
6038+
--
6039+
The sname:VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT structure is
6040+
defined as:
6041+
6042+
include::{generated}/api/structs/VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT.adoc[]
6043+
6044+
This structure describes the following feature:
6045+
6046+
* pname:sType is a elink:VkStructureType value identifying this structure.
6047+
* pname:pNext is `NULL` or a pointer to a structure extending this
6048+
structure.
6049+
* [[features-ycbcr3plane16BitLsbFormats]] pname:ycbcr3plane16BitLsbFormats
6050+
indicates that the implementation supports querying format features for, and
6051+
using, the following 3-plane 16bit LSB {YCbCr} formats:
6052+
** ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT
6053+
** ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT
6054+
** ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT
6055+
** ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT
6056+
** ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT
6057+
** ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT
6058+
** ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT
6059+
** ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT
6060+
** ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
6061+
6062+
:refpage: VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT
6063+
include::{chapters}/features.adoc[tag=features]
6064+
6065+
include::{generated}/validity/structs/VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT.adoc[]
6066+
--
6067+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
6068+
60366069
ifdef::VK_EXT_color_write_enable[]
60376070
[open,refpage='VkPhysicalDeviceColorWriteEnableFeaturesEXT',desc='Structure describing whether writes to color attachments can be enabled and disabled dynamically',type='structs']
60386071
--

chapters/formats.adoc

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,19 @@ ifdef::VK_KHR_maintenance5,VK_BASE_VERSION_1_3[and]
20812081
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
20822082
****
20832083
endif::VK_EXT_ycbcr_2plane_444_formats[]
2084+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2085+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
2086+
feature is not enabled, pname:format must: not be
2087+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT,
2088+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT,
2089+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT,
2090+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT,
2091+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT,
2092+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT,
2093+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT,
2094+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT or
2095+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
2096+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
20842097

20852098
include::{generated}/validity/protos/vkGetPhysicalDeviceFormatProperties.adoc[]
20862099
--
@@ -2428,9 +2441,9 @@ fname:vkGetPhysicalDeviceFormatProperties2 behaves similarly to
24282441
flink:vkGetPhysicalDeviceFormatProperties, with the ability to return
24292442
extended information in a pname:pNext chain of output structures.
24302443

2431-
ifdef::VK_EXT_ycbcr_2plane_444_formats[]
24322444
.Valid Usage
24332445
****
2446+
ifdef::VK_EXT_ycbcr_2plane_444_formats[]
24342447
* [[VUID-vkGetPhysicalDeviceFormatProperties2-None-12273]]
24352448
If
24362449
ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported,]
@@ -2445,8 +2458,21 @@ ifdef::VK_KHR_maintenance5,VK_BASE_VERSION_1_3[and]
24452458
ename:VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
24462459
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
24472460
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
2448-
****
24492461
endif::VK_EXT_ycbcr_2plane_444_formats[]
2462+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2463+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
2464+
feature is not enabled, pname:format must: not be
2465+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT,
2466+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT,
2467+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT,
2468+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT,
2469+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT,
2470+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT,
2471+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT,
2472+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT or
2473+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
2474+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2475+
****
24502476

24512477
include::{generated}/validity/protos/vkGetPhysicalDeviceFormatProperties2.adoc[]
24522478
--

chapters/resources.adoc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,19 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and]
13341334
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
13351335
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
13361336
endif::VK_EXT_ycbcr_2plane_444_formats[]
1337+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
1338+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
1339+
feature is not enabled, pname:format must: not be
1340+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT,
1341+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT,
1342+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT,
1343+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT,
1344+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT,
1345+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT,
1346+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT,
1347+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT or
1348+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
1349+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
13371350
****
13381351

13391352
include::{generated}/validity/structs/VkBufferViewCreateInfo.adoc[]
@@ -3100,6 +3113,19 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and]
31003113
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
31013114
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
31023115
endif::VK_EXT_ycbcr_2plane_444_formats[]
3116+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
3117+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
3118+
feature is not enabled, pname:format must: not be
3119+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT,
3120+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT,
3121+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT,
3122+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT,
3123+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT,
3124+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT,
3125+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT,
3126+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT or
3127+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
3128+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
31033129
ifdef::VK_EXT_descriptor_heap[]
31043130
* [[VUID-VkImageCreateInfo-flags-11281]]
31053131
If slink:VkOpaqueCaptureDataCreateInfoEXT::pname:pData is not `NULL`,
@@ -6787,6 +6813,19 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and]
67876813
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
67886814
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
67896815
endif::VK_EXT_ycbcr_2plane_444_formats[]
6816+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
6817+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
6818+
feature is not enabled, pname:format must: not be
6819+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16_EXT,
6820+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16_EXT,
6821+
ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16_EXT,
6822+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16_EXT,
6823+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16_EXT,
6824+
ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16_EXT,
6825+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_420_UNORM_3PACK16_EXT,
6826+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_422_UNORM_3PACK16_EXT or
6827+
ename:VK_FORMAT_X2G14_X2B14_X2R14_3PLANE_444_UNORM_3PACK16_EXT
6828+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
67906829
****
67916830

67926831
include::{generated}/validity/structs/VkImageViewCreateInfo.adoc[]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2026 The Khronos Group Inc.
2+
//
3+
// SPDX-License-Identifier: CC-BY-4.0
4+
5+
= VK_EXT_ycbcr_3plane_16bit_lsb_formats
6+
:toc: left
7+
:docs: https://docs.vulkan.org/spec/latest/
8+
:extensions: {docs}appendices/extensions.html#
9+
:sectnums:
10+
11+
This extension adds support for 10/12/14 bit {YCbCr} formats used by software
12+
decoders like ffmpeg, dav1d and libvpx.
13+
14+
== Problem Statement
15+
16+
Many popular software video decoders - such as ffmpeg/libav, dav1d and libvpx -
17+
use formats for 10, 12 and 14 bit content that are not yet supported in Vulkan,
18+
but are supported by Linux DRM and Mesa GLES (at least the 10 and 12 bit ones).
19+
These formats are long established and optimized for the given task and it would
20+
be very hard for decoders to switch to formats optimized for hardware video
21+
decoders such as P010.
22+
23+
Supporting these formats directly in drivers has various advantages for apps
24+
and system compositors, as it allows to avoid unnecessary copies and/or quality
25+
loss. Further more it can also simplify code-sharing with code-paths for
26+
hardware decoders.
27+
28+
Unfortunately it is not possible to use the existing 16 bit formats such as
29+
VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM as - unlike most formats used by hardware
30+
decoders - the alignment is LSB, not MSB. The bit-values thus need to get
31+
shifted by 6, 4 or 2 bits.
32+
33+
== Proposal
34+
35+
Add the formats in question. For any drivers already supporting YCbCr formats
36+
via shaders this should be straight forward. Values in the 0.0 - 1.0 range just
37+
need to get multiplied by 65535.0 / 1023.0 (for 10 bit), 65535.0 / 4095.0 (for
38+
12 bit) or 65535.0 / 16383.0 (for 14 bit).
39+
40+
== Issues

0 commit comments

Comments
 (0)