On Monday 17th of June 2019 we released new version of our graphics driver – 19.6.2. With it we added support for 5 new Vulkan® extensions. Here is a brief description of what they do and how to use them.


Specification: VK_EXT_full_screen_exclusive

This is the most extensive one. It lets you explicitly control exclusive fullscreen mode of your swapchain surface. This is for instance useful for HDR support. Without it, it depends fully on the driver to go fullscreen and omit window compositor (which may result in better performance) when it detects that your application uses borderless window that spans to entire monitor – just like in OpenGL®. DirectX®, on the other hand, has a notion of fullscreen mode for years, in form of IDXGISwapChain::SetFullscreenState function.

Let’s start the description of this extension from some new, generic functions. vkGetPhysicalDeviceSurfacePresentModes2EXT lets you query for the list of VkPresentModeKHR supported by specified VKSurfaceKHR. Similarly,vkGetDeviceGroupSurfacePresentModes2EXT queries for VkDeviceGroupPresentModeFlagsKHR of a surface, useful for multi-GPU configurations. They differ from standard vkGetPhysicalDeviceSurfacePresentModesKHR and vkGetDeviceGroupSurfacePresentModesKHR by using a new structure VkPhysicalDeviceSurfaceInfo2KHR that allows you to attach additional structures next to your surface handle.

New structures added are:

  • VkSurfaceCapabilitiesFullScreenExclusiveEXT – returns boolean flag fullScreenExclusiveSupported
  • VkSurfaceFullScreenExclusiveWin32InfoEXT – specifies Win32 handle to a monitor – HMONITOR
  • VkSurfaceFullScreenExclusiveInfoEXT – specifies fullscreen exclusive mode – a value of new enum VkFullScreenExclusiveEXT.

Enum VkFullScreenExclusiveEXT can take following values:

  • VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT – default driver behavior, as if extension was not used.
  • VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT – exclusive fullscreen explicitly enabled. Driver will use it if it can.
  • VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT – exclusive fullscreen explicitly disabled.
  • VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT – fullscreen mode can be changed in runtime.

Using that last value allows to control exclusive fullscreen mode using new functions: vkAcquireFullScreenExclusiveModeEXT, vkReleaseFullScreenExclusiveModeEXT. Please note however that going fullscreen may fail – the function then returns error code VK_ERROR_INITIALIZATION_FAILED. The exclusive fullscreen state may also be lost at any other time, e.g. after user pressed Alt+Tab. The screen may then flicker for a moment. In that case, a new error code VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT is returned by a swapchain command. You need to handle it properly.


Specification: VK_EXT_host_query_reset

This extension offers the possibility to reset a query or a set of queries on host (CPU) with a new function: vkResetQueryPoolEXT. It is different from standard vkCmdResetQueryPool, which records query reset command to a command buffer to be executed later on the GPU.

Before you use it, you need to query for support and enable it as a device feature. While calling vkGetPhysicalDeviceFeatures2KHR, attach structure VkPhysicalDeviceHostQueryResetFeaturesEXT and inspect returned flag. Then, while creating device with function vkCreateDevice, attach the same structure to VkDeviceCreateInfo to enable the feature.


Specification: VK_EXT_separate_stencil_usage

This is a simple one. It lets you specify different usage flags for stencil and depth aspect of a depth-stencil image. We recommend setting only the usage flags necessary, as it may allow the driver to better optimize the use of the image, e.g. by using internal compression formats.

Normally when you create an image, you specify usage flags as VkImageCreateInfo::usage, but an image used as depth-stencil attachment consists of 2 aspects: depth and stencil. With this extension, you can attach a new structure VkImageStencilUsageCreateInfoEXT while creating the image with function vkCreateImage and specify stencilUsage flags there, while normal image usage flags affect only the depth aspect. For example, you may want your Z-buffer to have VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT (to serve as Z-buffer) plus VK_IMAGE_USAGE_SAMPLED_BIT (to sample from it) and VK_IMAGE_USAGE_TRANSFER_SRC_BIT (to make transfers from it to another image), while your stencil buffer may have only VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT flag.


Specification: VK_KHR_uniform_buffer_standard_layout

This extension modifies the alignment rules for uniform buffers, allowing for tighter packing of arrays and structures. This allows, among other things, the std430 layout, as defined in GLSL specification, to be supported in uniform buffers. It’s a superset of VK_EXT_scalar_block_layout, which we also support.

Just like with VK_EXT_host_query_reset, you need to first query for support and enable it as device feature. To do it, attach structure VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR while calling vkGetPhysicalDeviceFeatures2KHR and inspect returned flag. Then, while creating device with function vkCreateDevice, attach the same structure to VkDeviceCreateInfo to enable the feature.

These were all “EXT” or “KHR” extensions, which mean you can expect them to be supported by multiple GPU vendors. You can check support for particular extensions on different graphics chips and driver versions using the great Vulkan Hardware Database by Sascha Willems. Now to the AMD-specific extension:


Specification: VK_AMD_display_native_hdr

It gives you more control over HDR displays supporting FreeSync 2 HDR – features that were previously available through AMD GPU Services (AGS) library.

  • Native color space. VkColorSpaceKHR enum is extended by a new value: VK_COLOR_SPACE_DISPLAY_NATIVE_AMD.
  • Control of local dimming. To use it, first query for support: While calling function vkGetPhysicalDeviceSurfaceCapabilities2KHR, attach structure VkDisplayNativeHdrSurfaceCapabilitiesAMD to get boolean flag localDimmingSupport. Then, while creating swapchain using function vkCreateSwapchainKHR, attach structure VkSwapchainDisplayNativeHdrCreateInfoAMD to pass flag localDimmingEnabled. You can also enable or disable local dimming dynamically by calling new function vkSetLocalDimmingAMD.