Search code examples
colorsvulkancolor-space

How is VK_COLOR_SPACE_PASS_THROUGH_EXT meant to be used?


All other possible values of VkColorSpaceKHR specify a recognised colour space encoding, and I assume that creating a swapchain with those values would mean that the final pixel data submitted by the application to the presentation queue would be transformed, somewhere down the line, into a decoded space, through a known EOTF.

The specification defines VK_COLOR_SPACE_PASS_THROUGH_EXT as follows:

"VK_COLOR_SPACE_PASS_THROUGH_EXT specifies that color components are used 'as is'. This is intended to allow applications to supply data for color spaces not described here."

What would this mean for my application? Let's say (entirely hypothetically) that I was building some fancy spectrum renderer and I was using a custom system for representing colours, and then that would all be transformed into a final RGB format, with just the three channels of intensity values, independent of colour space or any encoding.

Would my image really just be blitted to the screen "as is", as the specification claims? If so, how does the implementation know what to do with the given pixel data? Would it result in every pixel on my display being set to those raw RGB intensities, with no transfer functions being applied?

Thanks, and as always, I do not really know what I'm talking about so please bear with me.


Solution

  • Pass-through means pass it through. In terms of display presentation, the Vulkan implementation is an intermediary between the user and the display engine (ie: the part of the OS that deals with how a window accesses and manipulates the screen). Pass-through means for Vulkan to pass the data through as-is. The user is providing the data in the color space that the display engine expects it to be.