Class KHRSurface
- java.lang.Object
-
- org.lwjgl.vulkan.KHRSurface
-
public class KHRSurface extends java.lang.Object
TheVK_KHR_surface
extension is an instance extension. It introducesVkSurfaceKHR
objects, which abstract native platform surface or window objects for use with Vulkan. It also provides a way to determine whether a queue family in a physical device supports presenting to particular surface.Separate extensions for each platform provide the mechanisms for creating
VkSurfaceKHR
objects, but once created they may be used in this and other platform-independent extensions, in particular theVK_KHR_swapchain
extension.Examples
Note
The example code for the
VK_KHR_surface
andVK_KHR_swapchain
extensions was removed from the appendix after revision 1.0.29. This WSI 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/master/cube/cube.c).- Name String
VK_KHR_surface
- Extension Type
- Instance extension
- Registered Extension Number
- 1
- Revision
- 25
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Contact
- James Jones cubanismo
- Ian Elliott ianelliottus
- Last Modified Date
- 2016-08-25
- IP Status
- No known IP claims.
- Contributors
- Patrick Doane, Blizzard
- Ian Elliott, LunarG
- Jesse Hall, Google
- James Jones, NVIDIA
- David Mao, AMD
- Norbert Nopper, Freescale
- Alon Or-bach, Samsung
- Daniel Rakos, AMD
- Graham Sellers, AMD
- Jeff Vigil, Qualcomm
- Chia-I Wu, LunarG
- Jason Ekstrand, Intel
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
nvkDestroySurfaceKHR(VkInstance instance, long surface, long pAllocator)
Unsafe version of:DestroySurfaceKHR
static int
nvkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceCapabilities)
Unsafe version of:GetPhysicalDeviceSurfaceCapabilitiesKHR
static int
nvkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceFormatCount, long pSurfaceFormats)
Unsafe version of:GetPhysicalDeviceSurfaceFormatsKHR
static int
nvkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, long pPresentModeCount, long pPresentModes)
Unsafe version of:GetPhysicalDeviceSurfacePresentModesKHR
static int
nvkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, long pSupported)
Unsafe version of:GetPhysicalDeviceSurfaceSupportKHR
static void
vkDestroySurfaceKHR(VkInstance instance, long surface, VkAllocationCallbacks pAllocator)
Destroy a VkSurfaceKHR object.static int
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, VkSurfaceCapabilitiesKHR pSurfaceCapabilities)
Query surface capabilities.static int
vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, int[] pSurfaceFormatCount, VkSurfaceFormatKHR.Buffer pSurfaceFormats)
Array version of:GetPhysicalDeviceSurfaceFormatsKHR
static int
vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pSurfaceFormatCount, VkSurfaceFormatKHR.Buffer pSurfaceFormats)
Query color formats supported by surface.static int
vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, int[] pPresentModeCount, int[] pPresentModes)
Array version of:GetPhysicalDeviceSurfacePresentModesKHR
static int
vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pPresentModeCount, java.nio.IntBuffer pPresentModes)
Query supported presentation modes.static int
vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, int[] pSupported)
Array version of:GetPhysicalDeviceSurfaceSupportKHR
static int
vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, java.nio.IntBuffer pSupported)
Query if presentation is supported.
-
-
-
Field Detail
-
VK_KHR_SURFACE_SPEC_VERSION
The extension specification version.
-
VK_KHR_SURFACE_EXTENSION_NAME
The extension name.
-
VK_OBJECT_TYPE_SURFACE_KHR
ExtendsVkObjectType
.
-
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR, VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR, VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR, VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
VkSurfaceTransformFlagBitsKHR - presentation transforms supported on a deviceDescription
SURFACE_TRANSFORM_IDENTITY_BIT_KHR
specifies that image content is presented without being transformed.SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
specifies that image content is rotated 90 degrees clockwise.SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
specifies that image content is rotated 180 degrees clockwise.SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
specifies that image content is rotated 270 degrees clockwise.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
specifies that image content is mirrored horizontally.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
specifies that image content is mirrored horizontally, then rotated 90 degrees clockwise.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
specifies that image content is mirrored horizontally, then rotated 180 degrees clockwise.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
specifies that image content is mirrored horizontally, then rotated 270 degrees clockwise.SURFACE_TRANSFORM_INHERIT_BIT_KHR
specifies that the presentation transform is not specified, and is instead determined by platform-specific considerations and mechanisms outside Vulkan.
See Also
VkDisplaySurfaceCreateInfoKHR
,VkSurfaceCapabilities2EXT
,VkSurfaceCapabilitiesKHR
,VkSurfaceTransformFlagsKHR
,VkSwapchainCreateInfoKHR
-
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR, VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR, VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
VkCompositeAlphaFlagBitsKHR - alpha compositing modes supported on a deviceDescription
These values are described as follows:
COMPOSITE_ALPHA_OPAQUE_BIT_KHR
: The alpha channel, if it exists, of the images is ignored in the compositing process. Instead, the image is treated as if it has a constant alpha of 1.0.COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
: The alpha channel, if it exists, of the images is respected in the compositing process. The non-alpha channels of the image are expected to already be multiplied by the alpha channel by the application.COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
: The alpha channel, if it exists, of the images is respected in the compositing process. The non-alpha channels of the image are not expected to already be multiplied by the alpha channel by the application; instead, the compositor will multiply the non-alpha channels of the image by the alpha channel during compositing.COMPOSITE_ALPHA_INHERIT_BIT_KHR
: The way in which the presentation engine treats the alpha channel in the images is unknown to the Vulkan API. Instead, the application is responsible for setting the composite alpha blending mode using native window system commands. If the application does not set the blending mode using native window system commands, then a platform-specific default will be used.
See Also
VkCompositeAlphaFlagsKHR
,VkSwapchainCreateInfoKHR
-
VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, VK_COLORSPACE_SRGB_NONLINEAR_KHR
VkColorSpaceKHR - supported color space of the presentation engineDescription
COLOR_SPACE_SRGB_NONLINEAR_KHR
specifies support for the sRGB color space.COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT
specifies support for the Display-P3 color space to be displayed using an sRGB-like EOTF (defined below).COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT
specifies support for the extended sRGB color space to be displayed using a linear EOTF.COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT
specifies support for the extended sRGB color space to be displayed using an sRGB EOTF.COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
specifies support for the Display-P3 color space to be displayed using a linear EOTF.COLOR_SPACE_DCI_P3_NONLINEAR_EXT
specifies support for the DCI-P3 color space to be displayed using the DCI-P3 EOTF. Note that values in such an image are interpreted as XYZ encoded color data by the presentation engine.COLOR_SPACE_BT709_LINEAR_EXT
specifies support for the BT709 color space to be displayed using a linear EOTF.COLOR_SPACE_BT709_NONLINEAR_EXT
specifies support for the BT709 color space to be displayed using the SMPTE 170M EOTF.COLOR_SPACE_BT2020_LINEAR_EXT
specifies support for the BT2020 color space to be displayed using a linear EOTF.COLOR_SPACE_HDR10_ST2084_EXT
specifies support for the HDR10 (BT2020 color) space to be displayed using the SMPTE ST2084 Perceptual Quantizer (PQ) EOTF.COLOR_SPACE_DOLBYVISION_EXT
specifies support for the Dolby Vision (BT2020 color space), proprietary encoding, to be displayed using the SMPTE ST2084 EOTF.COLOR_SPACE_HDR10_HLG_EXT
specifies support for the HDR10 (BT2020 color space) to be displayed using the Hybrid Log Gamma (HLG) EOTF.COLOR_SPACE_ADOBERGB_LINEAR_EXT
specifies support for the AdobeRGB color space to be displayed using a linear EOTF.COLOR_SPACE_ADOBERGB_NONLINEAR_EXT
specifies support for the AdobeRGB color space to be displayed using the Gamma 2.2 EOTF.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.COLOR_SPACE_DISPLAY_NATIVE_AMD
specifies support for the display’s native color space. This matches the color space expectations of AMD’s FreeSync2 standard, for displays supporting it.
Note
In older versions of this extension
COLOR_SPACE_DISPLAY_P3_LINEAR_EXT
was misnamedCOLOR_SPACE_DCI_P3_LINEAR_EXT
. This has been updated to indicate that it uses RGB color encoding, not XYZ. The old name is deprecated but is maintained for backwards compatibility.The color components of non-linear color space swap chain images must have had the appropriate transfer function applied. The color space selected for the swap chain image will not affect the processing of data written into the image by the implementation. Vulkan requires that all implementations support the sRGB transfer function by use of an SRGB pixel format. Other transfer functions, such as SMPTE 170M or SMPTE2084, can be performed by the application shader. This extension defines enums for
VkColorSpaceKHR
that correspond to the following color spaces:Color Spaces and Attributes
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) ITU (SMPTE 170M) 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) extended sRGB HDR10_ST2084 0.708, 0.292 0.170, 0.797 0.131, 0.046 0.3127, 0.3290 (D65) ST2084 PQ DOLBYVISION 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 AdobeRGB 0.640, 0.330 0.210, 0.710 0.150, 0.060 0.3127, 0.3290 (D65) AdobeRGB The transfer functions are described in the "Transfer Functions" chapter of the Khronos Data Format Specification.
See Also
VkSurfaceFormatKHR
,VkSwapchainCreateInfoKHR
Enum values:
-
VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR
VkPresentModeKHR - presentation mode supported for a surfaceDescription
PRESENT_MODE_IMMEDIATE_KHR
specifies that the presentation engine does not wait for a vertical blanking period to update the current image, meaning this mode may result in visible tearing. No internal queuing of presentation requests is needed, as the requests are applied immediately.PRESENT_MODE_MAILBOX_KHR
specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal single-entry queue is used to hold pending presentation requests. If the queue is full when a new presentation request is received, the new request replaces the existing entry, and any images associated with the prior entry become available for re-use by the application. One request is removed from the queue and processed during each vertical blanking period in which the queue is non-empty.PRESENT_MODE_FIFO_KHR
specifies that the presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during each vertical blanking period in which the queue is non-empty. This is the only value ofpresentMode
that is required: to be supported.PRESENT_MODE_FIFO_RELAXED_KHR
specifies that the presentation engine generally waits for the next vertical blanking period to update the current image. If a vertical blanking period has already passed since the last update of the current image then the presentation engine does not wait for another vertical blanking period for the update, meaning this mode may result in visible tearing in this case. This mode is useful for reducing visual stutter with an application that will mostly present a new image before the next vertical blanking period, but may occasionally be late, and present a new image just after the next vertical blanking period. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during or after each vertical blanking period in which the queue is non-empty.PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR
specifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine is only required to update the current image after a new presentation request is received. Therefore the application must make a presentation request whenever an update is required. However, the presentation engine may update the current image at any point, meaning this mode may result in visible tearing.PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
specifies that the presentation engine and application have concurrent access to a single image, which is referred to as a shared presentable image. The presentation engine periodically updates the current image on its regular refresh cycle. The application is only required to make one initial presentation request, after which the presentation engine must update the current image without any need for further presentation requests. The application can indicate the image contents have been updated by making a presentation request, but this does not guarantee the timing of when it will be updated. This mode may result in visible tearing if rendering to the image is not timed correctly.
The supported
VkImageUsageFlagBits
of the presentable images of a swapchain created for a surface may differ depending on the presentation mode, and can be determined as per the table below:Presentable image usage queries
Presentation mode Image usage flags PRESENT_MODE_IMMEDIATE_KHR
VkSurfaceCapabilitiesKHR
::supportedUsageFlags
PRESENT_MODE_MAILBOX_KHR
VkSurfaceCapabilitiesKHR
::supportedUsageFlags
PRESENT_MODE_FIFO_KHR
VkSurfaceCapabilitiesKHR
::supportedUsageFlags
PRESENT_MODE_FIFO_RELAXED_KHR
VkSurfaceCapabilitiesKHR
::supportedUsageFlags
PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR
VkSharedPresentSurfaceCapabilitiesKHR
::sharedPresentSupportedUsageFlags
PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
VkSharedPresentSurfaceCapabilitiesKHR
::sharedPresentSupportedUsageFlags
Note
For reference, the mode indicated by
PRESENT_MODE_FIFO_KHR
is equivalent to the behavior of {wgl|glX|egl}SwapBuffers with a swap interval of 1, while the mode indicated byPRESENT_MODE_FIFO_RELAXED_KHR
is equivalent to the behavior of {wgl|glX}SwapBuffers with a swap interval of -1 (from the {WGL|GLX}_EXT_swap_control_tear extensions).See Also
VkSwapchainCreateInfoKHR
,GetPhysicalDeviceSurfacePresentModes2EXT
,GetPhysicalDeviceSurfacePresentModesKHR
-
-
Method Detail
-
nvkDestroySurfaceKHR
public static void nvkDestroySurfaceKHR(VkInstance instance, long surface, long pAllocator)
Unsafe version of:DestroySurfaceKHR
-
vkDestroySurfaceKHR
public static void vkDestroySurfaceKHR(VkInstance instance, long surface, @Nullable VkAllocationCallbacks pAllocator)
Destroy a VkSurfaceKHR object.C Specification
To destroy a
VkSurfaceKHR
object, call:void vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator);
Description
Destroying a
VkSurfaceKHR
merely severs the connection between Vulkan and the native surface, and does not imply destroying the native surface, closing a window, or similar behavior.Valid Usage
- All
VkSwapchainKHR
objects created forsurface
must have been destroyed prior to destroyingsurface
- If
VkAllocationCallbacks
were provided whensurface
was created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbacks
were provided whensurface
was created,pAllocator
must beNULL
Valid Usage (Implicit)
instance
must be a validVkInstance
handle- If
surface
is notNULL_HANDLE
,surface
must be a validVkSurfaceKHR
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validVkAllocationCallbacks
structure - If
surface
is a valid handle, it must have been created, allocated, or retrieved frominstance
Host Synchronization
- Host access to
surface
must be externally synchronized
See Also
- Parameters:
instance
- the instance used to create the surface.surface
- the surface to destroy.pAllocator
- the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).
- All
-
nvkGetPhysicalDeviceSurfaceSupportKHR
public static int nvkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, long pSupported)
Unsafe version of:GetPhysicalDeviceSurfaceSupportKHR
-
vkGetPhysicalDeviceSurfaceSupportKHR
public static int vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, java.nio.IntBuffer pSupported)
Query if presentation is supported.C Specification
To determine whether a queue family of a physical device supports presentation to a given surface, call:
VkResult vkGetPhysicalDeviceSurfaceSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported);
Valid Usage
queueFamilyIndex
must be less thanpQueueFamilyPropertyCount
returned byvkGetPhysicalDeviceQueueFamilyProperties
for the givenphysicalDevice
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlesurface
must be a validVkSurfaceKHR
handlepSupported
must be a valid pointer to aVkBool32
value- Both of
physicalDevice
, andsurface
must have been created, allocated, or retrieved from the sameVkInstance
Return Codes
- On success, this command returns
- On failure, this command returns
-
nvkGetPhysicalDeviceSurfaceCapabilitiesKHR
public static int nvkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceCapabilities)
Unsafe version of:GetPhysicalDeviceSurfaceCapabilitiesKHR
-
vkGetPhysicalDeviceSurfaceCapabilitiesKHR
public static int vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, VkSurfaceCapabilitiesKHR pSurfaceCapabilities)
Query surface capabilities.C Specification
To query the basic capabilities of a surface, needed in order to create a swapchain, call:
VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlesurface
must be a validVkSurfaceKHR
handlepSurfaceCapabilities
must be a valid pointer to aVkSurfaceCapabilitiesKHR
structure- Both of
physicalDevice
, andsurface
must have been created, allocated, or retrieved from the sameVkInstance
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
physicalDevice
- the physical device that will be associated with the swapchain to be created, as described forCreateSwapchainKHR
.surface
- the surface that will be associated with the swapchain.pSurfaceCapabilities
- a pointer to an instance of theVkSurfaceCapabilitiesKHR
structure in which the capabilities are returned.
-
nvkGetPhysicalDeviceSurfaceFormatsKHR
public static int nvkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceFormatCount, long pSurfaceFormats)
Unsafe version of:GetPhysicalDeviceSurfaceFormatsKHR
- Parameters:
pSurfaceFormatCount
- a pointer to an integer related to the number of format pairs available or queried, as described below.
-
vkGetPhysicalDeviceSurfaceFormatsKHR
public static int vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pSurfaceFormatCount, @Nullable VkSurfaceFormatKHR.Buffer pSurfaceFormats)
Query color formats supported by surface.C Specification
To query the supported swapchain format-color space pairs for a surface, call:
VkResult vkGetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats);
Description
If
pSurfaceFormats
isNULL
, then the number of format pairs supported for the givensurface
is returned inpSurfaceFormatCount
. Otherwise,pSurfaceFormatCount
must point to a variable set by the user to the number of elements in thepSurfaceFormats
array, and on return the variable is overwritten with the number of structures actually written topSurfaceFormats
. If the value ofpSurfaceFormatCount
is less than the number of format pairs supported, at mostpSurfaceFormatCount
structures will be written. IfpSurfaceFormatCount
is smaller than the number of format pairs supported for the givensurface
,INCOMPLETE
will be returned instead ofSUCCESS
to indicate that not all the available values were returned. The number of format pairs supported must be greater than or equal to 1.Valid Usage
surface
must be supported byphysicalDevice
, as reported byGetPhysicalDeviceSurfaceSupportKHR
or an equivalent platform-specific mechanism.
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlesurface
must be a validVkSurfaceKHR
handlepSurfaceFormatCount
must be a valid pointer to auint32_t
value- If the value referenced by
pSurfaceFormatCount
is not 0, andpSurfaceFormats
is notNULL
,pSurfaceFormats
must be a valid pointer to an array ofpSurfaceFormatCount
VkSurfaceFormatKHR
structures - Both of
physicalDevice
, andsurface
must have been created, allocated, or retrieved from the sameVkInstance
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
physicalDevice
- the physical device that will be associated with the swapchain to be created, as described forCreateSwapchainKHR
.surface
- the surface that will be associated with the swapchain.pSurfaceFormatCount
- a pointer to an integer related to the number of format pairs available or queried, as described below.pSurfaceFormats
- eitherNULL
or a pointer to an array ofVkSurfaceFormatKHR
structures.
-
nvkGetPhysicalDeviceSurfacePresentModesKHR
public static int nvkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, long pPresentModeCount, long pPresentModes)
Unsafe version of:GetPhysicalDeviceSurfacePresentModesKHR
- Parameters:
pPresentModeCount
- a pointer to an integer related to the number of presentation modes available or queried, as described below.
-
vkGetPhysicalDeviceSurfacePresentModesKHR
public static int vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pPresentModeCount, @Nullable java.nio.IntBuffer pPresentModes)
Query supported presentation modes.C Specification
To query the supported presentation modes for a surface, call:
VkResult vkGetPhysicalDeviceSurfacePresentModesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes);
Description
If
pPresentModes
isNULL
, then the number of presentation modes supported for the givensurface
is returned inpPresentModeCount
. Otherwise,pPresentModeCount
must point to a variable set by the user to the number of elements in thepPresentModes
array, and on return the variable is overwritten with the number of values actually written topPresentModes
. If the value ofpPresentModeCount
is less than the number of presentation modes supported, at mostpPresentModeCount
values will be written. IfpPresentModeCount
is smaller than the number of presentation modes supported for the givensurface
,INCOMPLETE
will be returned instead ofSUCCESS
to indicate that not all the available values were returned.Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlesurface
must be a validVkSurfaceKHR
handlepPresentModeCount
must be a valid pointer to auint32_t
value- If the value referenced by
pPresentModeCount
is not 0, andpPresentModes
is notNULL
,pPresentModes
must be a valid pointer to an array ofpPresentModeCount
VkPresentModeKHR
values - Both of
physicalDevice
, andsurface
must have been created, allocated, or retrieved from the sameVkInstance
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
physicalDevice
- the physical device that will be associated with the swapchain to be created, as described forCreateSwapchainKHR
.surface
- the surface that will be associated with the swapchain.pPresentModeCount
- a pointer to an integer related to the number of presentation modes available or queried, as described below.pPresentModes
- eitherNULL
or a pointer to an array ofVkPresentModeKHR
values, indicating the supported presentation modes.
-
vkGetPhysicalDeviceSurfaceSupportKHR
public static int vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, int[] pSupported)
Array version of:GetPhysicalDeviceSurfaceSupportKHR
-
vkGetPhysicalDeviceSurfaceFormatsKHR
public static int vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, int[] pSurfaceFormatCount, @Nullable VkSurfaceFormatKHR.Buffer pSurfaceFormats)
Array version of:GetPhysicalDeviceSurfaceFormatsKHR
-
vkGetPhysicalDeviceSurfacePresentModesKHR
public static int vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, int[] pPresentModeCount, @Nullable int[] pPresentModes)
Array version of:GetPhysicalDeviceSurfacePresentModesKHR
-
-