| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Extensions.VK_EXT_swapchain_colorspace
Description
Name
VK_EXT_swapchain_colorspace - instance extension
VK_EXT_swapchain_colorspace
- Name String
VK_EXT_swapchain_colorspace
- Extension Type
- Instance extension
- Registered Extension Number
- 105
- Revision
- 5
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_surface
- Contact
Other Extension Metadata
- Last Modified Date
- 2019-04-26
- IP Status
- No known IP claims.
- Contributors
- Courtney Goeltzenleuchter, Google
Description
This extension expands ColorSpaceKHR
to add support for most standard color spaces beyond
COLOR_SPACE_SRGB_NONLINEAR_KHR. This
extension also adds support for
COLOR_SPACE_PASS_THROUGH_EXT which
allows applications to use color spaces not explicitly enumerated in
ColorSpaceKHR.
New Enum Constants
EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSIONExtending
ColorSpaceKHR:COLOR_SPACE_ADOBERGB_LINEAR_EXTCOLOR_SPACE_ADOBERGB_NONLINEAR_EXTCOLOR_SPACE_BT2020_LINEAR_EXTCOLOR_SPACE_BT709_LINEAR_EXTCOLOR_SPACE_BT709_NONLINEAR_EXTCOLOR_SPACE_DCI_P3_LINEAR_EXTCOLOR_SPACE_DCI_P3_NONLINEAR_EXTCOLOR_SPACE_DISPLAY_P3_LINEAR_EXTCOLOR_SPACE_DISPLAY_P3_NONLINEAR_EXTCOLOR_SPACE_DOLBYVISION_EXTCOLOR_SPACE_EXTENDED_SRGB_LINEAR_EXTCOLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXTCOLOR_SPACE_HDR10_HLG_EXTCOLOR_SPACE_HDR10_ST2084_EXTCOLOR_SPACE_PASS_THROUGH_EXT
Issues
1) Does the spec need to specify which kinds of image formats support the color spaces?
RESOLVED: Pixel format is independent of color space (though some
color spaces really want / need floating-point color components to be
useful). Therefore, do not plan on documenting what formats support
which color spaces. An application can call
getPhysicalDeviceSurfaceFormatsKHR to
query what a particular implementation supports.
2) How does application determine if HW supports appropriate transfer function for a color space?
RESOLVED: Extension indicates that implementation must not do the OETF encoding if it is not sRGB. That responsibility falls to the application shaders. Any other native OETF / EOTF functions supported by an implementation can be described by separate extension.
Version History
Revision 1, 2016-12-27 (Courtney Goeltzenleuchter)
- Initial version
Revision 2, 2017-01-19 (Courtney Goeltzenleuchter)
- Add pass through and multiple options for BT2020.
- Clean up some issues with equations not displaying properly.
Revision 3, 2017-06-23 (Courtney Goeltzenleuchter)
- Add extended sRGB non-linear enum.
Revision 4, 2019-04-26 (Graeme Leese)
- Clarify color space transfer function usage.
- Refer to normative definitions in the Data Format Specification.
- Clarify DCI-P3 and Display P3 usage.
Revision 5, 2024-03-16 (Zehui Lin)
- Fix interchanged concepts of EOTF and OETF.
- Clarify that the presentation engine can accept the color spaces.
See Also
No cross-references are available
Document Notes
For more information, see the Vulkan Specification.
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- pattern COLOR_SPACE_DCI_P3_LINEAR_EXT :: ColorSpaceKHR
- type EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION = 5
- pattern EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION :: Integral a => a
- type EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME = "VK_EXT_swapchain_colorspace"
- pattern EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME :: (Eq a, IsString a) => a
- newtype ColorSpaceKHR where
- ColorSpaceKHR Int32
- pattern COLOR_SPACE_ADOBERGB_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_ADOBERGB_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_BT2020_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_BT709_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_BT709_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DCI_P3_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DISPLAY_NATIVE_AMD :: ColorSpaceKHR
- pattern COLOR_SPACE_DISPLAY_P3_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_DOLBYVISION_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_HDR10_HLG_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_HDR10_ST2084_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_PASS_THROUGH_EXT :: ColorSpaceKHR
- pattern COLOR_SPACE_SRGB_NONLINEAR_KHR :: ColorSpaceKHR
Documentation
pattern COLOR_SPACE_DCI_P3_LINEAR_EXT :: ColorSpaceKHR Source #
pattern EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION :: Integral a => a Source #
type EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME = "VK_EXT_swapchain_colorspace" Source #
pattern EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME :: (Eq a, IsString a) => a Source #
newtype ColorSpaceKHR Source #
VkColorSpaceKHR - Supported color space of the presentation engine
Description
COLOR_SPACE_SRGB_NONLINEAR_KHRspecifies support for the images in sRGB color space, encoded according to the sRGB specification.
COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXTspecifies support for the images in Display-P3 color space, encoded using a Display-P3 transfer function.COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXTspecifies support for the images in extended sRGB color space, encoded using a linear transfer function.COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXTspecifies support for the images in extended sRGB color space, encoded according to the scRGB specification.COLOR_SPACE_DISPLAY_P3_LINEAR_EXTspecifies support for the images in Display-P3 color space, encoded using a linear transfer function.COLOR_SPACE_DCI_P3_NONLINEAR_EXTspecifies support for the images in DCI-P3 color space, encoded according to the DCI-P3 specification. Note that values in such an image are interpreted as XYZ encoded color data by the presentation engine.COLOR_SPACE_BT709_LINEAR_EXTspecifies support for the images in BT709 color space, encoded using a linear transfer function.COLOR_SPACE_BT709_NONLINEAR_EXTspecifies support for the images in BT709 color space, encoded according to the BT709 specification.COLOR_SPACE_BT2020_LINEAR_EXTspecifies support for the images in BT2020 color space, encoded using a linear transfer function.COLOR_SPACE_HDR10_ST2084_EXTspecifies support for the images in HDR10 (BT2020) color space, encoded according to SMPTE ST2084 Perceptual Quantizer (PQ) specification.COLOR_SPACE_HDR10_HLG_EXTspecifies support for the images in HDR10 (BT2020) color space, encoded according to the Hybrid Log Gamma (HLG) specification.COLOR_SPACE_ADOBERGB_LINEAR_EXTspecifies support for images in Adobe RGB color space, encoded using a linear transfer function.COLOR_SPACE_ADOBERGB_NONLINEAR_EXTspecifies support for the images in Adobe RGB color space, encoded according to the Adobe RGB specification (approximately Gamma 2.2).COLOR_SPACE_PASS_THROUGH_EXTspecifies that color components are used “as is”. This is intended to allow applications to supply data for color spaces not described here.COLOR_SPACE_DISPLAY_NATIVE_AMDspecifies support for the display’s native color space. This matches the color space expectations of AMD’s FreeSync2 standard, for displays supporting it.
In the initial release of the VK_KHR_surface and VK_KHR_swapchain
extensions, the token COLORSPACE_SRGB_NONLINEAR_KHR was used. Starting
in the 2016-05-13 updates to the extension branches, matching release
1.0.13 of the core API specification, COLOR_SPACE_SRGB_NONLINEAR_KHR
is used instead for consistency with Vulkan naming rules. The older enum
is still available for backwards compatibility.
In older versions of this extension COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
was misnamed
COLOR_SPACE_DCI_P3_LINEAR_EXT.
This has been updated to indicate that it uses RGB color encoding, not
XYZ. The old name is legacy but is maintained for backwards
compatibility.
In older versions of the VK_EXT_swapchain_colorspace extension,
COLOR_SPACE_DOLBYVISION_EXT was exposed. The intent was to indicate
the presentation engine shall decode an image using the SMPTE ST 2084
Perceptual Quantizer (PQ) EOTF, and then apply a proprietary OOTF to
process the image. However, Dolby Vision profile 8.4 describes an
encoding using the Hybrid Log Gamma (HLG) OETF, and there is no
swapchain extension for signaling Dolby Vision metadata to be used by a
proprietary OOTF. This enum is legacy but is maintained for backwards
compatibility.
For a traditional “Linear” or non-gamma transfer function color space
use COLOR_SPACE_PASS_THROUGH_EXT.
On Wayland, COLOR_SPACE_PASS_THROUGH_EXT can be used to disable color
management by the WSI on a surface, which makes it possible for the
application to create a wp_color_management_surface_v1 object without
triggering a surface_exists protocol error.
The presentation engine interprets the pixel values of the R, G, and B components as having been encoded using an appropriate transfer function. Applications should ensure that the appropriate transfer function has been applied. Texel encode requires that all implementations implicitly apply the sRGB EOTF-1 on R, G, and B components when shaders write to an sRGB pixel format image, which is useful for sRGB color spaces. For sRGB color spaces with other pixel formats, or other non-linear color spaces, applications can apply the transfer function explicitly in a shader. The A channel is always interpreted as linearly encoded.
This extension defines enums for ColorSpaceKHR that correspond to the
following color spaces:
| Name | Red Primary | Green Primary | Blue Primary | White-point | Transfer function |
|---|---|---|---|---|---|
| DCI-P3 | 1.000, 0.000 | 0.000, 1.000 | 0.000, 0.000 | 0.3333, 0.3333 | DCI P3 |
| Display-P3 | 0.680, 0.320 | 0.265, 0.690 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | Display-P3 |
| BT709 | 0.640, 0.330 | 0.300, 0.600 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | BT709 |
| sRGB | 0.640, 0.330 | 0.300, 0.600 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | sRGB |
| extended sRGB | 0.640, 0.330 | 0.300, 0.600 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | scRGB |
| HDR10_ST2084 | 0.708, 0.292 | 0.170, 0.797 | 0.131, 0.046 | 0.3127, 0.3290 (D65) | ST2084 PQ |
| HDR10_HLG | 0.708, 0.292 | 0.170, 0.797 | 0.131, 0.046 | 0.3127, 0.3290 (D65) | HLG |
| Adobe RGB | 0.640, 0.330 | 0.210, 0.710 | 0.150, 0.060 | 0.3127, 0.3290 (D65) | Adobe RGB |
Color Spaces and Attributes
The transfer functions are described in the “Transfer Functions” chapter of the Khronos Data Format Specification.
Except Display-P3 OETF, which is:
[begin{aligned} E & = begin{cases} 1.055 times L^{1 over 2.4} - 0.055 & text{for} 0.0030186 leq L leq 1 -- 12.92 times L & text{for} 0 leq L < 0.0030186
Constructors
| ColorSpaceKHR Int32 |
Bundled Patterns
| pattern COLOR_SPACE_ADOBERGB_LINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_ADOBERGB_NONLINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_BT2020_LINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_BT709_LINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_BT709_NONLINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_DCI_P3_NONLINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_DISPLAY_NATIVE_AMD :: ColorSpaceKHR | |
| pattern COLOR_SPACE_DISPLAY_P3_LINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_DOLBYVISION_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_HDR10_HLG_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_HDR10_ST2084_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_PASS_THROUGH_EXT :: ColorSpaceKHR | |
| pattern COLOR_SPACE_SRGB_NONLINEAR_KHR :: ColorSpaceKHR |