Skip to content

Commit 24c3e2e

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 24c3e2e

7 files changed

Lines changed: 307 additions & 7 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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,22 @@ 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_Z6R10_UNORM_EXT,
603+
ename:VK_FORMAT_Z4R12_UNORM_EXT,
604+
ename:VK_FORMAT_Z2R14_UNORM_EXT,
605+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT,
606+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT,
607+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT,
608+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT,
609+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT,
610+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT,
611+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT,
612+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT or
613+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
614+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
599615
****
600616

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

chapters/features.adoc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6033,6 +6033,42 @@ 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_Z6R10_UNORM_EXT
6053+
** ename:VK_FORMAT_Z4R12_UNORM_EXT
6054+
** ename:VK_FORMAT_Z2R14_UNORM_EXT
6055+
** ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT
6056+
** ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT
6057+
** ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT
6058+
** ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT
6059+
** ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT
6060+
** ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT
6061+
** ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT
6062+
** ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT
6063+
** ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
6064+
6065+
:refpage: VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT
6066+
include::{chapters}/features.adoc[tag=features]
6067+
6068+
include::{generated}/validity/structs/VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT.adoc[]
6069+
--
6070+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
6071+
60366072
ifdef::VK_EXT_color_write_enable[]
60376073
[open,refpage='VkPhysicalDeviceColorWriteEnableFeaturesEXT',desc='Structure describing whether writes to color attachments can be enabled and disabled dynamically',type='structs']
60386074
--

chapters/formats.adoc

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,9 +2062,9 @@ include::{generated}/api/protos/vkGetPhysicalDeviceFormatProperties.adoc[]
20622062
structure in which physical device properties for pname:format are
20632063
returned.
20642064

2065-
ifdef::VK_EXT_ycbcr_2plane_444_formats[]
20662065
.Valid Usage
20672066
****
2067+
ifdef::VK_EXT_ycbcr_2plane_444_formats[]
20682068
* [[VUID-vkGetPhysicalDeviceFormatProperties-None-12272]]
20692069
If
20702070
ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported,]
@@ -2079,8 +2079,24 @@ ifdef::VK_KHR_maintenance5,VK_BASE_VERSION_1_3[and]
20792079
ename:VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
20802080
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
20812081
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
2082-
****
20832082
endif::VK_EXT_ycbcr_2plane_444_formats[]
2083+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2084+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
2085+
feature is not enabled, pname:format must: not be
2086+
ename:VK_FORMAT_Z6R10_UNORM_EXT,
2087+
ename:VK_FORMAT_Z4R12_UNORM_EXT,
2088+
ename:VK_FORMAT_Z2R14_UNORM_EXT,
2089+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT,
2090+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT,
2091+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT,
2092+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT,
2093+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT,
2094+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT,
2095+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT,
2096+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT or
2097+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
2098+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2099+
****
20842100

20852101
include::{generated}/validity/protos/vkGetPhysicalDeviceFormatProperties.adoc[]
20862102
--
@@ -2428,9 +2444,9 @@ fname:vkGetPhysicalDeviceFormatProperties2 behaves similarly to
24282444
flink:vkGetPhysicalDeviceFormatProperties, with the ability to return
24292445
extended information in a pname:pNext chain of output structures.
24302446

2431-
ifdef::VK_EXT_ycbcr_2plane_444_formats[]
24322447
.Valid Usage
24332448
****
2449+
ifdef::VK_EXT_ycbcr_2plane_444_formats[]
24342450
* [[VUID-vkGetPhysicalDeviceFormatProperties2-None-12273]]
24352451
If
24362452
ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported,]
@@ -2445,8 +2461,24 @@ ifdef::VK_KHR_maintenance5,VK_BASE_VERSION_1_3[and]
24452461
ename:VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
24462462
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
24472463
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
2448-
****
24492464
endif::VK_EXT_ycbcr_2plane_444_formats[]
2465+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2466+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
2467+
feature is not enabled, pname:format must: not be
2468+
ename:VK_FORMAT_Z6R10_UNORM_EXT,
2469+
ename:VK_FORMAT_Z4R12_UNORM_EXT,
2470+
ename:VK_FORMAT_Z2R14_UNORM_EXT,
2471+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT,
2472+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT,
2473+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT,
2474+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT,
2475+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT,
2476+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT,
2477+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT,
2478+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT or
2479+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
2480+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
2481+
****
24502482

24512483
include::{generated}/validity/protos/vkGetPhysicalDeviceFormatProperties2.adoc[]
24522484
--

chapters/resources.adoc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,22 @@ 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_Z6R10_UNORM_EXT,
1341+
ename:VK_FORMAT_Z4R12_UNORM_EXT,
1342+
ename:VK_FORMAT_Z2R14_UNORM_EXT,
1343+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT,
1344+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT,
1345+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT,
1346+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT,
1347+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT,
1348+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT,
1349+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT,
1350+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT or
1351+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
1352+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
13371353
****
13381354

13391355
include::{generated}/validity/structs/VkBufferViewCreateInfo.adoc[]
@@ -3100,6 +3116,22 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and]
31003116
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
31013117
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
31023118
endif::VK_EXT_ycbcr_2plane_444_formats[]
3119+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
3120+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
3121+
feature is not enabled, pname:format must: not be
3122+
ename:VK_FORMAT_Z6R10_UNORM_EXT,
3123+
ename:VK_FORMAT_Z4R12_UNORM_EXT,
3124+
ename:VK_FORMAT_Z2R14_UNORM_EXT,
3125+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT,
3126+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT,
3127+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT,
3128+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT,
3129+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT,
3130+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT,
3131+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT,
3132+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT or
3133+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
3134+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
31033135
ifdef::VK_EXT_descriptor_heap[]
31043136
* [[VUID-VkImageCreateInfo-flags-11281]]
31053137
If slink:VkOpaqueCaptureDataCreateInfoEXT::pname:pData is not `NULL`,
@@ -6787,6 +6819,22 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and]
67876819
ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or
67886820
ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM
67896821
endif::VK_EXT_ycbcr_2plane_444_formats[]
6822+
ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
6823+
* If the <<features-ycbcr3plane16BitLsbFormats,pname:ycbcr3plane16BitLsbFormats>>
6824+
feature is not enabled, pname:format must: not be
6825+
ename:VK_FORMAT_Z6R10_UNORM_EXT,
6826+
ename:VK_FORMAT_Z4R12_UNORM_EXT,
6827+
ename:VK_FORMAT_Z2R14_UNORM_EXT,
6828+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_420_UNORM_3PACK16_EXT,
6829+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_422_UNORM_3PACK16_EXT,
6830+
ename:VK_FORMAT_Z6G10_Z6B10_Z6R10_3PLANE_444_UNORM_3PACK16_EXT,
6831+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_420_UNORM_3PACK16_EXT,
6832+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_422_UNORM_3PACK16_EXT,
6833+
ename:VK_FORMAT_Z4G12_Z4B12_Z4R12_3PLANE_444_UNORM_3PACK16_EXT,
6834+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_420_UNORM_3PACK16_EXT,
6835+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_422_UNORM_3PACK16_EXT or
6836+
ename:VK_FORMAT_Z2G14_Z2B14_Z2R14_3PLANE_444_UNORM_3PACK16_EXT
6837+
endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[]
67906838
****
67916839

67926840
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)