diff --git a/appendices/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc b/appendices/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc new file mode 100644 index 000000000..0b9b7bdf6 --- /dev/null +++ b/appendices/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc @@ -0,0 +1,27 @@ +// Copyright 2020-2025 The Khronos Group Inc. +// +// SPDX-License-Identifier: CC-BY-4.0 + +include::{generated}/meta/{refprefix}VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc[] + +=== Other Extension Metadata + +*Last Modified Date*:: + 2025-04-01 +*IP Status*:: + No known IP claims. +*Contributors*:: + - Robert Mader, Collabora + +=== Description + +This extension adds some {YCbCr} formats that are in common use for video +software encode and decode, but were not part of the +`apiext:VK_KHR_sampler_ycbcr_conversion` extension. + +include::{generated}/interfaces/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc[] + +=== Version History + + * Revision 1, 2025-04-01 (Robert Mader) + ** Initial draft diff --git a/chapters/descriptorbuffers.adoc b/chapters/descriptorbuffers.adoc index f2fa0ad5c..6a9368c10 100644 --- a/chapters/descriptorbuffers.adoc +++ b/chapters/descriptorbuffers.adoc @@ -596,6 +596,17 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and] ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + * [[VUID-VkDescriptorAddressInfoEXT-None-?????]] + If the <> + feature is not enabled, pname:format must: not be + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 or + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] **** include::{generated}/validity/structs/VkDescriptorAddressInfoEXT.adoc[] diff --git a/chapters/features.adoc b/chapters/features.adoc index 2641f9047..b6e1cbec5 100644 --- a/chapters/features.adoc +++ b/chapters/features.adoc @@ -6033,6 +6033,36 @@ endif::VK_BASE_VERSION_1_3[] -- endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] +[open,refpage='VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT',desc='Structure describing whether the implementation supports additional 3-plane 16bit LSB {YCbCr} formats',type='structs'] +-- +The sname:VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT structure is +defined as: + +include::{generated}/api/structs/VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT.adoc[] + +This structure describes the following feature: + + * pname:sType is a elink:VkStructureType value identifying this structure. + * pname:pNext is `NULL` or a pointer to a structure extending this + structure. + * [[features-ycbcr3plane16BitLsbFormats]] pname:ycbcr3plane16BitLsbFormats + indicates that the implementation supports the following 3-plane 16bit LSB + {YCbCr} formats: + ** ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16 + ** ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16 + ** ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16 + ** ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16 + ** ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 + ** ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 + +:refpage: VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT +include::{chapters}/features.adoc[tag=features] + +include::{generated}/validity/structs/VkPhysicalDeviceYcbcr3Plane16BitLsbFormatsFeaturesEXT.adoc[] +-- +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + ifdef::VK_EXT_color_write_enable[] [open,refpage='VkPhysicalDeviceColorWriteEnableFeaturesEXT',desc='Structure describing whether writes to color attachments can be enabled and disabled dynamically',type='structs'] -- diff --git a/chapters/formats.adoc b/chapters/formats.adoc index d435abacb..6a9ba26fb 100644 --- a/chapters/formats.adoc +++ b/chapters/formats.adoc @@ -2081,6 +2081,17 @@ ifdef::VK_KHR_maintenance5,VK_BASE_VERSION_1_3[and] ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM **** endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + * [[VUID-vkGetPhysicalDeviceFormatProperties-None-?????]] + If the <> + feature is not enabled, pname:format must: not be + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 or + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] include::{generated}/validity/protos/vkGetPhysicalDeviceFormatProperties.adoc[] -- @@ -2447,6 +2458,17 @@ ifdef::VK_KHR_maintenance5,VK_BASE_VERSION_1_3[and] ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM **** endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + * [[VUID-vkGetPhysicalDeviceFormatProperties2-None-?????]] + If the <> + feature is not enabled, pname:format must: not be + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 or + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] include::{generated}/validity/protos/vkGetPhysicalDeviceFormatProperties2.adoc[] -- diff --git a/chapters/resources.adoc b/chapters/resources.adoc index 9d74a68d2..f557724ac 100644 --- a/chapters/resources.adoc +++ b/chapters/resources.adoc @@ -1323,6 +1323,17 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and] ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + * [[VUID-VkBufferViewCreateInfo-None-?????]] + If the <> + feature is not enabled, pname:format must: not be + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 or + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] **** include::{generated}/validity/structs/VkBufferViewCreateInfo.adoc[] @@ -3067,6 +3078,17 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and] ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + * [[VUID-VkImageCreateInfo-None-?????]] + If the <> + feature is not enabled, pname:format must: not be + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 or + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] ifdef::VK_EXT_descriptor_heap[] * [[VUID-VkImageCreateInfo-flags-11281]] If slink:VkOpaqueCaptureDataCreateInfoEXT::pData is not `NULL`, @@ -6732,6 +6754,17 @@ ifdef::VK_BASE_VERSION_1_3[Vulkan 1.3 is not supported and] ename:VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, or ename:VK_FORMAT_G16_B16R16_2PLANE_444_UNORM endif::VK_EXT_ycbcr_2plane_444_formats[] +ifdef::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] + * [[VUID-VkImageViewCreateInfo-None-?????]] + If the <> + feature is not enabled, pname:format must: not be + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_422_UNORM_3PACK16, + ename:VK_FORMAT_X6G10_X6B10_X6R10_3PLANE_444_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_420_UNORM_3PACK16, + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_422_UNORM_3PACK16 or + ename:VK_FORMAT_X4G12_X4B12_X4R12_3PLANE_444_UNORM_3PACK16 +endif::VK_EXT_ycbcr_3plane_16bit_lsb_formats[] **** include::{generated}/validity/structs/VkImageViewCreateInfo.adoc[] diff --git a/proposals/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc b/proposals/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc new file mode 100644 index 000000000..62f51ab80 --- /dev/null +++ b/proposals/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc @@ -0,0 +1,39 @@ +// Copyright 2022-2025 The Khronos Group Inc. +// +// SPDX-License-Identifier: CC-BY-4.0 + += VK_EXT_ycbcr_3plane_16bit_lsb_formats +:toc: left +:docs: https://docs.vulkan.org/spec/latest/ +:extensions: {docs}appendices/extensions.html# +:sectnums: + +This extension adds support for 10/12bit {YCbCr} formats used by software +decoders like ffmpeg, dav1d and libvpx. + +== Problem Statement + +Many popular software video decoders - such as ffmpeg/libav, dav1d and libvpx - +use formats for 10 and 12 bit content that are not yet supported in Vulkan, but +are for example in Linux DRM and Mesa GLES. These formats long established and +optimized for the given task and it would be very hard for decoders to switch +to formats optimized for hardware video decoders such as P010. + +Supporting these formats directly in drivers has various advantages for apps +and system compositors, as it allows to avoid unnecessary copies and/or quality +loss. Further more it can also simplify code-sharing with code-paths for +hardware decoders. + +Unfortunately it is not possible to use the existing 16 bit formats such as +VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM as - unlike most formats used by hardware +decoders - the alignment is LSB, not MSB. The bit-values thus need to get +shifted by 6 or 4 bit. + +== Proposal + +Add the formats in question. For any drivers already supporting YCbCr formats +via shaders this should be straight forward. Values in the 0.0 - 1.0 range just +need to get multiplied by 65535.0 / 1023.0 (for 10 bit) or 65535.0 / 4095.0 (for +12 bit). + +== Issues diff --git a/xml/vk.xml b/xml/vk.xml index 332de107a..e6d97a552 100644 --- a/xml/vk.xml +++ b/xml/vk.xml @@ -8554,6 +8554,11 @@ typedef void* MTLSharedEvent_id; void* pNext VkBool32 ycbcr2plane444Formats + + VkStructureType sType + void* pNext + VkBool32 ycbcr3plane16BitLsbFormats + VkStructureType sType void* pNext @@ -30541,10 +30546,19 @@ endif::VK_KHR_internally_synchronized_queues[] - + - - + + + + + + + + + + + @@ -32645,6 +32659,54 @@ endif::VK_KHR_internally_synchronized_queues[] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +