Class KHRSurface
- java.lang.Object
-
- org.lwjgl.vulkan.KHRSurface
-
public class KHRSurface extends java.lang.ObjectTheVK_KHR_surfaceextension is an instance extension. It introducesVkSurfaceKHRobjects, 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
VkSurfaceKHRobjects, but once created they may be used in this and other platform-independent extensions, in particular theVK_KHR_swapchainextension.Examples
Note
The example code for the
VK_KHR_surfaceandVK_KHR_swapchainextensions 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 voidnvkDestroySurfaceKHR(VkInstance instance, long surface, long pAllocator)Unsafe version of:DestroySurfaceKHRstatic intnvkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceCapabilities)Unsafe version of:GetPhysicalDeviceSurfaceCapabilitiesKHRstatic intnvkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, long pSurfaceFormatCount, long pSurfaceFormats)Unsafe version of:GetPhysicalDeviceSurfaceFormatsKHRstatic intnvkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, long pPresentModeCount, long pPresentModes)Unsafe version of:GetPhysicalDeviceSurfacePresentModesKHRstatic intnvkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, long pSupported)Unsafe version of:GetPhysicalDeviceSurfaceSupportKHRstatic voidvkDestroySurfaceKHR(VkInstance instance, long surface, VkAllocationCallbacks pAllocator)Destroy a VkSurfaceKHR object.static intvkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, VkSurfaceCapabilitiesKHR pSurfaceCapabilities)Query surface capabilities.static intvkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, int[] pSurfaceFormatCount, VkSurfaceFormatKHR.Buffer pSurfaceFormats)Array version of:GetPhysicalDeviceSurfaceFormatsKHRstatic intvkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pSurfaceFormatCount, VkSurfaceFormatKHR.Buffer pSurfaceFormats)Query color formats supported by surface.static intvkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, int[] pPresentModeCount, int[] pPresentModes)Array version of:GetPhysicalDeviceSurfacePresentModesKHRstatic intvkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pPresentModeCount, java.nio.IntBuffer pPresentModes)Query supported presentation modes.static intvkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, int[] pSupported)Array version of:GetPhysicalDeviceSurfaceSupportKHRstatic intvkGetPhysicalDeviceSurfaceSupportKHR(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_KHRspecifies that image content is presented without being transformed.SURFACE_TRANSFORM_ROTATE_90_BIT_KHRspecifies that image content is rotated 90 degrees clockwise.SURFACE_TRANSFORM_ROTATE_180_BIT_KHRspecifies that image content is rotated 180 degrees clockwise.SURFACE_TRANSFORM_ROTATE_270_BIT_KHRspecifies that image content is rotated 270 degrees clockwise.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHRspecifies that image content is mirrored horizontally.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHRspecifies that image content is mirrored horizontally, then rotated 90 degrees clockwise.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHRspecifies that image content is mirrored horizontally, then rotated 180 degrees clockwise.SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHRspecifies that image content is mirrored horizontally, then rotated 270 degrees clockwise.SURFACE_TRANSFORM_INHERIT_BIT_KHRspecifies 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_KHRspecifies support for the sRGB color space.COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXTspecifies support for the Display-P3 color space to be displayed using an sRGB-like EOTF (defined below).COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXTspecifies support for the extended sRGB color space to be displayed using a linear EOTF.COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXTspecifies support for the extended sRGB color space to be displayed using an sRGB EOTF.COLOR_SPACE_DISPLAY_P3_LINEAR_EXTspecifies support for the Display-P3 color space to be displayed using a linear EOTF.COLOR_SPACE_DCI_P3_NONLINEAR_EXTspecifies 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_EXTspecifies support for the BT709 color space to be displayed using a linear EOTF.COLOR_SPACE_BT709_NONLINEAR_EXTspecifies support for the BT709 color space to be displayed using the SMPTE 170M EOTF.COLOR_SPACE_BT2020_LINEAR_EXTspecifies support for the BT2020 color space to be displayed using a linear EOTF.COLOR_SPACE_HDR10_ST2084_EXTspecifies support for the HDR10 (BT2020 color) space to be displayed using the SMPTE ST2084 Perceptual Quantizer (PQ) EOTF.COLOR_SPACE_DOLBYVISION_EXTspecifies support for the Dolby Vision (BT2020 color space), proprietary encoding, to be displayed using the SMPTE ST2084 EOTF.COLOR_SPACE_HDR10_HLG_EXTspecifies support for the HDR10 (BT2020 color space) to be displayed using the Hybrid Log Gamma (HLG) EOTF.COLOR_SPACE_ADOBERGB_LINEAR_EXTspecifies support for the AdobeRGB color space to be displayed using a linear EOTF.COLOR_SPACE_ADOBERGB_NONLINEAR_EXTspecifies support for the AdobeRGB color space to be displayed using the Gamma 2.2 EOTF.COLOR_SPACE_PASS_THROUGH_EXTspecifies 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_AMDspecifies 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_EXTwas 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
VkColorSpaceKHRthat 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,VkSwapchainCreateInfoKHREnum 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_KHRspecifies 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_KHRspecifies 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_KHRspecifies 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 ofpresentModethat is required: to be supported.PRESENT_MODE_FIFO_RELAXED_KHRspecifies 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_KHRspecifies 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_KHRspecifies 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
VkImageUsageFlagBitsof 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_KHRVkSurfaceCapabilitiesKHR::supportedUsageFlagsPRESENT_MODE_MAILBOX_KHRVkSurfaceCapabilitiesKHR::supportedUsageFlagsPRESENT_MODE_FIFO_KHRVkSurfaceCapabilitiesKHR::supportedUsageFlagsPRESENT_MODE_FIFO_RELAXED_KHRVkSurfaceCapabilitiesKHR::supportedUsageFlagsPRESENT_MODE_SHARED_DEMAND_REFRESH_KHRVkSharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlagsPRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHRVkSharedPresentSurfaceCapabilitiesKHR::sharedPresentSupportedUsageFlagsNote
For reference, the mode indicated by
PRESENT_MODE_FIFO_KHRis equivalent to the behavior of {wgl|glX|egl}SwapBuffers with a swap interval of 1, while the mode indicated byPRESENT_MODE_FIFO_RELAXED_KHRis 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
VkSurfaceKHRobject, call:void vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator);Description
Destroying a
VkSurfaceKHRmerely 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
VkSwapchainKHRobjects created forsurfacemust have been destroyed prior to destroyingsurface - If
VkAllocationCallbackswere provided whensurfacewas created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbackswere provided whensurfacewas created,pAllocatormust beNULL
Valid Usage (Implicit)
instancemust be a validVkInstancehandle- If
surfaceis notNULL_HANDLE,surfacemust be a validVkSurfaceKHRhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure - If
surfaceis a valid handle, it must have been created, allocated, or retrieved frominstance
Host Synchronization
- Host access to
surfacemust 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
queueFamilyIndexmust be less thanpQueueFamilyPropertyCountreturned byvkGetPhysicalDeviceQueueFamilyPropertiesfor the givenphysicalDevice
Valid Usage (Implicit)
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepSupportedmust be a valid pointer to aVkBool32value- Both of
physicalDevice, andsurfacemust 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)
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepSurfaceCapabilitiesmust be a valid pointer to aVkSurfaceCapabilitiesKHRstructure- Both of
physicalDevice, andsurfacemust 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 theVkSurfaceCapabilitiesKHRstructure 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
pSurfaceFormatsisNULL, then the number of format pairs supported for the givensurfaceis returned inpSurfaceFormatCount. Otherwise,pSurfaceFormatCountmust point to a variable set by the user to the number of elements in thepSurfaceFormatsarray, and on return the variable is overwritten with the number of structures actually written topSurfaceFormats. If the value ofpSurfaceFormatCountis less than the number of format pairs supported, at mostpSurfaceFormatCountstructures will be written. IfpSurfaceFormatCountis smaller than the number of format pairs supported for the givensurface,INCOMPLETEwill be returned instead ofSUCCESSto 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
surfacemust be supported byphysicalDevice, as reported byGetPhysicalDeviceSurfaceSupportKHRor an equivalent platform-specific mechanism.
Valid Usage (Implicit)
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepSurfaceFormatCountmust be a valid pointer to auint32_tvalue- If the value referenced by
pSurfaceFormatCountis not 0, andpSurfaceFormatsis notNULL,pSurfaceFormatsmust be a valid pointer to an array ofpSurfaceFormatCountVkSurfaceFormatKHRstructures - Both of
physicalDevice, andsurfacemust 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- eitherNULLor a pointer to an array ofVkSurfaceFormatKHRstructures.
-
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
pPresentModesisNULL, then the number of presentation modes supported for the givensurfaceis returned inpPresentModeCount. Otherwise,pPresentModeCountmust point to a variable set by the user to the number of elements in thepPresentModesarray, and on return the variable is overwritten with the number of values actually written topPresentModes. If the value ofpPresentModeCountis less than the number of presentation modes supported, at mostpPresentModeCountvalues will be written. IfpPresentModeCountis smaller than the number of presentation modes supported for the givensurface,INCOMPLETEwill be returned instead ofSUCCESSto indicate that not all the available values were returned.Valid Usage (Implicit)
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepPresentModeCountmust be a valid pointer to auint32_tvalue- If the value referenced by
pPresentModeCountis not 0, andpPresentModesis notNULL,pPresentModesmust be a valid pointer to an array ofpPresentModeCountVkPresentModeKHRvalues - Both of
physicalDevice, andsurfacemust 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- eitherNULLor a pointer to an array ofVkPresentModeKHRvalues, 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
-
-