abergmeier
abergmeier

Reputation: 14052

How to load extensions

I am trying to write a Vulkan program but am somewhat fuzzy on how the extension mechanism works.

Concretely, I want to access VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT (is not found at compilation) but am not sure how to include the swapchain_colorspace extension.

Upvotes: 1

Views: 4012

Answers (1)

krOoze
krOoze

Reputation: 13246

VK_EXT_swapchain_colorspace is an instance extension. You can enable the extension by passing its name to vkCreateInstance via the pCreateInfo->ppEnabledExtensionNames.

You can use either "VK_EXT_swapchain_colorspace" directly or use the VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME macro to avoid typos.

Then, generally speaking, you have to load extension commands (functions) unless it is WSI and you are using the official Vulkan loader. VK_EXT_swapchain_colorspace defines no new commands, so that step can be skipped.

Enumerants such as VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT are always present\defined (assuming you have updated vulkan.h header; if not, just download newest LunarG Vulkan SDK). Enabling the extension only gives formal permission for them to be used.

Upvotes: 2

Related Questions