Class KHRDisplay

java.lang.Object
org.lwjgl.vulkan.KHRDisplay

public class KHRDisplay extends Object
This extension provides the API to enumerate displays and available modes on a given device.
Examples
Note

The example code for the VK_KHR_display and VK_KHR_display_swapchain extensions was removed from the appendix after revision 1.0.43. The display enumeration example code was ported to the cube demo that is shipped with the official Khronos SDK, and is being kept up-to-date in that location (see: https://github.com/KhronosGroup/Vulkan-Tools/blob/main/cube/cube.c).

Name String
VK_KHR_display
Extension Type
Instance extension
Registered Extension Number
3
Revision
23
Extension and Version Dependencies
VK_KHR_surface
Contact
Other Extension Metadata
Last Modified Date
2017-03-13
IP Status
No known IP claims.
Contributors
  • James Jones, NVIDIA
  • Norbert Nopper, Freescale
  • Jeff Vigil, Qualcomm
  • Daniel Rakos, AMD
  • Field Details

  • Method Details

    • nvkGetPhysicalDeviceDisplayPropertiesKHR

      public static int nvkGetPhysicalDeviceDisplayPropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long pPropertyCount, long pProperties)
      Parameters:
      pPropertyCount - a pointer to an integer related to the number of display devices available or queried, as described below.
    • vkGetPhysicalDeviceDisplayPropertiesKHR

      public static int vkGetPhysicalDeviceDisplayPropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, IntBuffer pPropertyCount, @Nullable VkDisplayPropertiesKHR.Buffer pProperties)
      Query information about the available displays.
      C Specification

      Various functions are provided for enumerating the available display devices present on a Vulkan physical device. To query information about the available displays, call:

      
       VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
           VkPhysicalDevice                            physicalDevice,
           uint32_t*                                   pPropertyCount,
           VkDisplayPropertiesKHR*                     pProperties);
      Description

      If pProperties is NULL, then the number of display devices available for physicalDevice is returned in pPropertyCount. Otherwise, pPropertyCount must point to a variable set by the application to the number of elements in the pProperties array, and on return the variable is overwritten with the number of structures actually written to pProperties. If the value of pPropertyCount is less than the number of display devices for physicalDevice, at most pPropertyCount structures will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available properties were returned.

      Valid Usage (Implicit)
      • physicalDevice must be a valid VkPhysicalDevice handle
      • pPropertyCount must be a valid pointer to a uint32_t value
      • If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPropertiesKHR structures
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkDisplayPropertiesKHR

      Parameters:
      physicalDevice - a physical device.
      pPropertyCount - a pointer to an integer related to the number of display devices available or queried, as described below.
      pProperties - either NULL or a pointer to an array of VkDisplayPropertiesKHR structures.
    • nvkGetPhysicalDeviceDisplayPlanePropertiesKHR

      public static int nvkGetPhysicalDeviceDisplayPlanePropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long pPropertyCount, long pProperties)
      Parameters:
      pPropertyCount - a pointer to an integer related to the number of display planes available or queried, as described below.
    • vkGetPhysicalDeviceDisplayPlanePropertiesKHR

      public static int vkGetPhysicalDeviceDisplayPlanePropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, IntBuffer pPropertyCount, @Nullable VkDisplayPlanePropertiesKHR.Buffer pProperties)
      Query the plane properties.
      C Specification

      Images are presented to individual planes on a display. Devices must support at least one plane on each display. Planes can be stacked and blended to composite multiple images on one display. Devices may support only a fixed stacking order and fixed mapping between planes and displays, or they may allow arbitrary application-specified stacking orders and mappings between planes and displays. To query the properties of device display planes, call:

      
       VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
           VkPhysicalDevice                            physicalDevice,
           uint32_t*                                   pPropertyCount,
           VkDisplayPlanePropertiesKHR*                pProperties);
      Description

      If pProperties is NULL, then the number of display planes available for physicalDevice is returned in pPropertyCount. Otherwise, pPropertyCount must point to a variable set by the application to the number of elements in the pProperties array, and on return the variable is overwritten with the number of structures actually written to pProperties. If the value of pPropertyCount is less than the number of display planes for physicalDevice, at most pPropertyCount structures will be written.

      Valid Usage (Implicit)
      • physicalDevice must be a valid VkPhysicalDevice handle
      • pPropertyCount must be a valid pointer to a uint32_t value
      • If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayPlanePropertiesKHR structures
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkDisplayPlanePropertiesKHR

      Parameters:
      physicalDevice - a physical device.
      pPropertyCount - a pointer to an integer related to the number of display planes available or queried, as described below.
      pProperties - either NULL or a pointer to an array of VkDisplayPlanePropertiesKHR structures.
    • nvkGetDisplayPlaneSupportedDisplaysKHR

      public static int nvkGetDisplayPlaneSupportedDisplaysKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int planeIndex, long pDisplayCount, long pDisplays)
      Parameters:
      pDisplayCount - a pointer to an integer related to the number of displays available or queried, as described below.
    • vkGetDisplayPlaneSupportedDisplaysKHR

      public static int vkGetDisplayPlaneSupportedDisplaysKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int planeIndex, IntBuffer pDisplayCount, @Nullable LongBuffer pDisplays)
      Query the list of displays a plane supports.
      C Specification

      To determine which displays a plane is usable with, call

      
       VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
           VkPhysicalDevice                            physicalDevice,
           uint32_t                                    planeIndex,
           uint32_t*                                   pDisplayCount,
           VkDisplayKHR*                               pDisplays);
      Description

      If pDisplays is NULL, then the number of displays usable with the specified planeIndex for physicalDevice is returned in pDisplayCount. Otherwise, pDisplayCount must point to a variable set by the application to the number of elements in the pDisplays array, and on return the variable is overwritten with the number of handles actually written to pDisplays. If the value of pDisplayCount is less than the number of usable display-plane pairs for physicalDevice, at most pDisplayCount handles will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available pairs were returned.

      Valid Usage
      • planeIndex must be less than the number of display planes supported by the device as determined by calling vkGetPhysicalDeviceDisplayPlanePropertiesKHR
      Valid Usage (Implicit)
      • physicalDevice must be a valid VkPhysicalDevice handle
      • pDisplayCount must be a valid pointer to a uint32_t value
      • If the value referenced by pDisplayCount is not 0, and pDisplays is not NULL, pDisplays must be a valid pointer to an array of pDisplayCount VkDisplayKHR handles
      Return Codes
      On success, this command returns
      On failure, this command returns
      Parameters:
      physicalDevice - a physical device.
      planeIndex - the plane which the application wishes to use, and must be in the range [0, physical device plane count - 1].
      pDisplayCount - a pointer to an integer related to the number of displays available or queried, as described below.
      pDisplays - either NULL or a pointer to an array of VkDisplayKHR handles.
    • nvkGetDisplayModePropertiesKHR

      public static int nvkGetDisplayModePropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long display, long pPropertyCount, long pProperties)
      Unsafe version of: GetDisplayModePropertiesKHR
      Parameters:
      pPropertyCount - a pointer to an integer related to the number of display modes available or queried, as described below.
    • vkGetDisplayModePropertiesKHR

      public static int vkGetDisplayModePropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long display, IntBuffer pPropertyCount, @Nullable VkDisplayModePropertiesKHR.Buffer pProperties)
      Query the set of mode properties supported by the display.
      C Specification

      Each display has one or more supported modes associated with it by default. These built-in modes are queried by calling:

      
       VkResult vkGetDisplayModePropertiesKHR(
           VkPhysicalDevice                            physicalDevice,
           VkDisplayKHR                                display,
           uint32_t*                                   pPropertyCount,
           VkDisplayModePropertiesKHR*                 pProperties);
      Description

      If pProperties is NULL, then the number of display modes available on the specified display for physicalDevice is returned in pPropertyCount. Otherwise, pPropertyCount must point to a variable set by the application to the number of elements in the pProperties array, and on return the variable is overwritten with the number of structures actually written to pProperties. If the value of pPropertyCount is less than the number of display modes for physicalDevice, at most pPropertyCount structures will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available display modes were returned.

      Valid Usage (Implicit)
      • physicalDevice must be a valid VkPhysicalDevice handle
      • display must be a valid VkDisplayKHR handle
      • pPropertyCount must be a valid pointer to a uint32_t value
      • If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount VkDisplayModePropertiesKHR structures
      • display must have been created, allocated, or retrieved from physicalDevice
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkDisplayModePropertiesKHR

      Parameters:
      physicalDevice - the physical device associated with display.
      display - the display to query.
      pPropertyCount - a pointer to an integer related to the number of display modes available or queried, as described below.
      pProperties - either NULL or a pointer to an array of VkDisplayModePropertiesKHR structures.
    • nvkCreateDisplayModeKHR

      public static int nvkCreateDisplayModeKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long display, long pCreateInfo, long pAllocator, long pMode)
      Unsafe version of: CreateDisplayModeKHR
    • vkCreateDisplayModeKHR

      public static int vkCreateDisplayModeKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long display, VkDisplayModeCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pMode)
      Create a display mode.
      C Specification

      Additional modes may also be created by calling:

      
       VkResult vkCreateDisplayModeKHR(
           VkPhysicalDevice                            physicalDevice,
           VkDisplayKHR                                display,
           const VkDisplayModeCreateInfoKHR*           pCreateInfo,
           const VkAllocationCallbacks*                pAllocator,
           VkDisplayModeKHR*                           pMode);
      Valid Usage (Implicit)
      • physicalDevice must be a valid VkPhysicalDevice handle
      • display must be a valid VkDisplayKHR handle
      • pCreateInfo must be a valid pointer to a valid VkDisplayModeCreateInfoKHR structure
      • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
      • pMode must be a valid pointer to a VkDisplayModeKHR handle
      • display must have been created, allocated, or retrieved from physicalDevice
      Host Synchronization
      • Host access to display must be externally synchronized
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkAllocationCallbacks, VkDisplayModeCreateInfoKHR

      Parameters:
      physicalDevice - the physical device associated with display.
      display - the display to create an additional mode for.
      pCreateInfo - a pointer to a VkDisplayModeCreateInfoKHR structure describing the new mode to create.
      pAllocator - the allocator used for host memory allocated for the display mode object when there is no more specific allocator available (see Memory Allocation).
      pMode - a pointer to a VkDisplayModeKHR handle in which the mode created is returned.
    • nvkGetDisplayPlaneCapabilitiesKHR

      public static int nvkGetDisplayPlaneCapabilitiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long mode, int planeIndex, long pCapabilities)
    • vkGetDisplayPlaneCapabilitiesKHR

      public static int vkGetDisplayPlaneCapabilitiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long mode, int planeIndex, VkDisplayPlaneCapabilitiesKHR pCapabilities)
      Query capabilities of a mode and plane combination.
      C Specification

      Applications that wish to present directly to a display must select which layer, or “plane” of the display they wish to target, and a mode to use with the display. Each display supports at least one plane. The capabilities of a given mode and plane combination are determined by calling:

      
       VkResult vkGetDisplayPlaneCapabilitiesKHR(
           VkPhysicalDevice                            physicalDevice,
           VkDisplayModeKHR                            mode,
           uint32_t                                    planeIndex,
           VkDisplayPlaneCapabilitiesKHR*              pCapabilities);
      Valid Usage (Implicit)
      • physicalDevice must be a valid VkPhysicalDevice handle
      • mode must be a valid VkDisplayModeKHR handle
      • pCapabilities must be a valid pointer to a VkDisplayPlaneCapabilitiesKHR structure
      • mode must have been created, allocated, or retrieved from physicalDevice
      Host Synchronization
      • Host access to mode must be externally synchronized
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkDisplayPlaneCapabilitiesKHR

      Parameters:
      physicalDevice - the physical device associated with the display specified by mode
      mode - the display mode the application intends to program when using the specified plane. Note this parameter also implicitly specifies a display.
      planeIndex - the plane which the application intends to use with the display, and is less than the number of display planes supported by the device.
      pCapabilities - a pointer to a VkDisplayPlaneCapabilitiesKHR structure in which the capabilities are returned.
    • nvkCreateDisplayPlaneSurfaceKHR

      public static int nvkCreateDisplayPlaneSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, long pCreateInfo, long pAllocator, long pSurface)
      Unsafe version of: CreateDisplayPlaneSurfaceKHR
    • vkCreateDisplayPlaneSurfaceKHR

      public static int vkCreateDisplayPlaneSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, VkDisplaySurfaceCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, LongBuffer pSurface)
      Create a VkSurfaceKHR structure representing a display plane and mode.
      C Specification

      A complete display configuration includes a mode, one or more display planes and any parameters describing their behavior, and parameters describing some aspects of the images associated with those planes. Display surfaces describe the configuration of a single plane within a complete display configuration. To create a VkSurfaceKHR object for a display plane, call:

      
       VkResult vkCreateDisplayPlaneSurfaceKHR(
           VkInstance                                  instance,
           const VkDisplaySurfaceCreateInfoKHR*        pCreateInfo,
           const VkAllocationCallbacks*                pAllocator,
           VkSurfaceKHR*                               pSurface);
      Valid Usage (Implicit)
      • instance must be a valid VkInstance handle
      • pCreateInfo must be a valid pointer to a valid VkDisplaySurfaceCreateInfoKHR structure
      • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
      • pSurface must be a valid pointer to a VkSurfaceKHR handle
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkAllocationCallbacks, VkDisplaySurfaceCreateInfoKHR

      Parameters:
      instance - the instance corresponding to the physical device the targeted display is on.
      pCreateInfo - a pointer to a VkDisplaySurfaceCreateInfoKHR structure specifying which mode, plane, and other parameters to use, as described below.
      pAllocator - the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).
      pSurface - a pointer to a VkSurfaceKHR handle in which the created surface is returned.
    • vkGetPhysicalDeviceDisplayPropertiesKHR

      public static int vkGetPhysicalDeviceDisplayPropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int[] pPropertyCount, @Nullable VkDisplayPropertiesKHR.Buffer pProperties)
    • vkGetPhysicalDeviceDisplayPlanePropertiesKHR

      public static int vkGetPhysicalDeviceDisplayPlanePropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int[] pPropertyCount, @Nullable VkDisplayPlanePropertiesKHR.Buffer pProperties)
    • vkGetDisplayPlaneSupportedDisplaysKHR

      public static int vkGetDisplayPlaneSupportedDisplaysKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, int planeIndex, int[] pDisplayCount, long @Nullable [] pDisplays)
    • vkGetDisplayModePropertiesKHR

      public static int vkGetDisplayModePropertiesKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long display, int[] pPropertyCount, @Nullable VkDisplayModePropertiesKHR.Buffer pProperties)
      Array version of: GetDisplayModePropertiesKHR
    • vkCreateDisplayModeKHR

      public static int vkCreateDisplayModeKHR(org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, long display, VkDisplayModeCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pMode)
      Array version of: CreateDisplayModeKHR
    • vkCreateDisplayPlaneSurfaceKHR

      public static int vkCreateDisplayPlaneSurfaceKHR(org.lwjgl.vulkan.VkInstance instance, VkDisplaySurfaceCreateInfoKHR pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pSurface)