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 each platform provide the mechanisms for creating
VkSurfaceKHRs, but once created they may be used in this and other platform-independent extensions, in particular theVK_KHR_swapchainextension.
-
-
Field Summary
Fields Modifier and Type Field and Description static intVK_COLOR_SPACE_SRGB_NONLINEAR_KHRThe presentation engine supports the sRGB colorspace.static intVK_COMPOSITE_ALPHA_INHERIT_BIT_KHRThe way in which the presentation engine treats the alpha channel in the images is unknown to the Vulkan API.static intVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHRThe alpha channel, if it exists, of the images is ignored in the compositing process.static intVK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHRThe alpha channel, if it exists, of the images is respected in the compositing process.static intVK_ERROR_NATIVE_WINDOW_IN_USE_KHRThe requested window is already connected to a VkSurfaceKHR, or to some other non-Vulkan API.static intVK_ERROR_SURFACE_LOST_KHRA surface is no longer available.static java.lang.StringVK_KHR_SURFACE_EXTENSION_NAMEThe extension name.static intVK_KHR_SURFACE_SPEC_VERSIONThe extension specification version.static intVK_PRESENT_MODE_FIFO_KHR
VK_PRESENT_MODE_FIFO_RELAXED_KHRThe presentation engine waits for the next vertical blanking period to update the current image.static intVK_PRESENT_MODE_IMMEDIATE_KHRThe presentation engine does not wait for a vertical blanking period to update the current image, meaning this mode may result in visible tearing.static intVK_PRESENT_MODE_MAILBOX_KHRThe presentation engine waits for the next vertical blanking period to update the current image.static intVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHRThe image content is mirrored horizontally.static intVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHRThe image content is mirrored horizontally, then rotated 180 degrees clockwise.static intVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHRThe image content is mirrored horizontally, then rotated 270 degrees clockwise.static intVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHRThe image content is mirrored horizontally, then rotated 90 degrees clockwise.static intVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHRThe image content is presented without being transformed.static intVK_SURFACE_TRANSFORM_INHERIT_BIT_KHRThe presentation transform is not specified, and is instead determined by platform-specific considerations and mechanisms outside Vulkan.static intVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHRThe image content is rotated 180 degrees clockwise.static intVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHRThe image content is rotated 270 degrees clockwise.static intVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHRThe image content is rotated 90 degrees clockwise.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidvkDestroySurfaceKHR(VkInstance instance, long surface, VkAllocationCallbacks pAllocator)Destroys aVkSurfaceKHRobject.static intvkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, VkSurfaceCapabilitiesKHR pSurfaceCapabilities)Queries the basic capabilities of a surface, needed in order to create a swapchain.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)Queries the supported swapchain format-colorspace pairs for a 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)Queries the supported presentation modes for a surface.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)Determines whether a queue family of a physical device supports presentation to a given surface.
-
-
-
Field Detail
-
VK_KHR_SURFACE_SPEC_VERSION
public static final int VK_KHR_SURFACE_SPEC_VERSION
The extension specification version.- See Also:
- Constant Field Values
-
VK_KHR_SURFACE_EXTENSION_NAME
public static final java.lang.String VK_KHR_SURFACE_EXTENSION_NAME
The extension name.- See Also:
- Constant Field Values
-
VK_ERROR_SURFACE_LOST_KHR
public static final int VK_ERROR_SURFACE_LOST_KHR
A surface is no longer available.- See Also:
- Constant Field Values
-
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR
public static final int VK_ERROR_NATIVE_WINDOW_IN_USE_KHR
The requested window is already connected to a VkSurfaceKHR, or to some other non-Vulkan API.- See Also:
- Constant Field Values
-
VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
public static final int VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
The presentation engine supports the sRGB colorspace.- See Also:
- Constant Field Values
-
VK_PRESENT_MODE_IMMEDIATE_KHR
public static final int VK_PRESENT_MODE_IMMEDIATE_KHR
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.- See Also:
- Constant Field Values
-
VK_PRESENT_MODE_MAILBOX_KHR
public static final int VK_PRESENT_MODE_MAILBOX_KHR
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.- See Also:
- Constant Field Values
-
VK_PRESENT_MODE_FIFO_KHR
public static final int VK_PRESENT_MODE_FIFO_KHR
The presentation engine waits for the next vertical blanking period to update the current image. Tearing cannot be observed. An internal queue containing(numSwapchainImages - 1)entries, wherenumSwapchainImagesis the number of presentable images in the swapchain, 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.- See Also:
- Constant Field Values
-
VK_PRESENT_MODE_FIFO_RELAXED_KHR
public static final int VK_PRESENT_MODE_FIFO_RELAXED_KHR
The presentation engine 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. An internal queue containingnumSwapchainImages − 1entries, wherenumSwapchainImagesis the number of presentable images in the swapchain, 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.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
The image content is presented without being transformed.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR
The image content is rotated 90 degrees clockwise.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR
The image content is rotated 180 degrees clockwise.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
The image content is rotated 270 degrees clockwise.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR
The image content is mirrored horizontally.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR
The image content is mirrored horizontally, then rotated 90 degrees clockwise.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR
The image content is mirrored horizontally, then rotated 180 degrees clockwise.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR
The image content is mirrored horizontally, then rotated 270 degrees clockwise.- See Also:
- Constant Field Values
-
VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
public static final int VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR
The presentation transform is not specified, and is instead determined by platform-specific considerations and mechanisms outside Vulkan.- See Also:
- Constant Field Values
-
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR
public static final int VK_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.- See Also:
- Constant Field Values
-
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
public static final int VK_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.- See Also:
- Constant Field Values
-
VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR
public static final int VK_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.- See Also:
- Constant Field Values
-
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
public static final int VK_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:
- Constant Field Values
-
-
Method Detail
-
vkDestroySurfaceKHR
public static void vkDestroySurfaceKHR(VkInstance instance, long surface, VkAllocationCallbacks pAllocator)
Destroys aVkSurfaceKHRobject.Several WSI functions return
ERROR_SURFACE_LOST_KHRif the surface becomes no longer available. After such an error, the surface (and any child swapchain, if one exists) should be destroyed, as there is no way to restore them to a not-lost state. Applications may attempt to create a newVkSurfaceKHRusing the same native platform window object, but whether such re-creation will succeed is platform-dependent and may depend on the reason the surface became unavailable. A lost surface does not otherwise cause devices to be lost.Destroying a
VkSurfaceKHRmerely severs the connection between Vulkan and the native surface, and doesn’t imply destroying the native surface, closing a window, or similar behavior.Valid Usage
instancemust be a validVkInstancehandle- If
surfaceis notNULL_HANDLE,surfacemust be a validVkSurfaceKHRhandle - If
pAllocatoris notNULL,pAllocatormust be a pointer to a validVkAllocationCallbacksstructure - If
surfaceis a valid handle, it must have been created, allocated or retrieved frominstance - 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
Host Synchronization
- Host access to
surfacemust be externally synchronized
- Parameters:
instance- the instance used to create the surfacesurface- the surface to destroypAllocator- controls host memory allocation
-
vkGetPhysicalDeviceSurfaceSupportKHR
public static int vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, int queueFamilyIndex, long surface, java.nio.IntBuffer pSupported)
Determines whether a queue family of a physical device supports presentation to a given surface.Valid Usage
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepSupportedmust be a pointer to aVkBool32value- Each of
physicalDeviceandsurfacemust have been created, allocated or retrieved from the sameVkInstance queueFamilyIndexmust be less thanpQueueFamilyPropertyCountreturned byGetPhysicalDeviceQueueFamilyPropertiesfor the givenphysicalDevice
-
vkGetPhysicalDeviceSurfaceCapabilitiesKHR
public static int vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, long surface, VkSurfaceCapabilitiesKHR pSurfaceCapabilities)
Queries the basic capabilities of a surface, needed in order to create a swapchain.Valid Usage
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepSurfaceCapabilitiesmust be a pointer to aVkSurfaceCapabilitiesKHRstructure- Each of
physicalDeviceandsurfacemust have been created, allocated or retrieved from the sameVkInstance
- Parameters:
physicalDevice- the physical device that will be associated with the swapchain to be createdsurface- the surface that will be associated with the swapchainpSurfaceCapabilities- a pointer to an instance of theVkSurfaceCapabilitiesKHRstructure that will be filled with information
-
vkGetPhysicalDeviceSurfaceFormatsKHR
public static int vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pSurfaceFormatCount, VkSurfaceFormatKHR.Buffer pSurfaceFormats)
Queries the supported swapchain format-colorspace pairs for a surface.If
pSurfaceFormatsisNULL, then the number of format pairs supported for the given surface is 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 queue families 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.Valid Usage
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepSurfaceFormatCountmust be a pointer to auint32_tvalue- If the value referenced by
pSurfaceFormatCountis not 0, andpSurfaceFormatsis notNULL,pSurfaceFormatsmust be a pointer to an array ofpSurfaceFormatCountVkSurfaceFormatKHRstructures - Each of
physicalDeviceandsurfacemust have been created, allocated or retrieved from the sameVkInstance
- Parameters:
physicalDevice- the physical device that will be associated with the swapchain to be createdsurface- the surface that will be associated with the swapchainpSurfaceFormatCount- a pointer to an integer related to the number of format pairs available or queriedpSurfaceFormats- eitherNULLor a pointer to an array ofVkSurfaceFormatKHRstructures
-
vkGetPhysicalDeviceSurfacePresentModesKHR
public static int vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, java.nio.IntBuffer pPresentModeCount, java.nio.IntBuffer pPresentModes)
Queries the supported presentation modes for a surface.If
pPresentModesisNULL, then the number of presentation modes supported for the given surface is 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 structures actually written topPresentModes. If the value ofpPresentModeCountis less than the number of presentation modes supported, at mostpPresentModeCountstructures 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
physicalDevicemust be a validVkPhysicalDevicehandlesurfacemust be a validVkSurfaceKHRhandlepPresentModeCountmust be a pointer to auint32_tvalue- If the value referenced by
pPresentModeCountis not 0, andpPresentModesis notNULL,pPresentModesmust be a pointer to an array ofpPresentModeCountVkPresentModeKHRvalues - Each of
physicalDeviceandsurfacemust have been created, allocated or retrieved from the sameVkInstance
- Parameters:
physicalDevice- the physical device that will be associated with the swapchain to be createdsurface- the surface that will be associated with the swapchainpPresentModeCount- a pointer to an integer related to the number of format pairs available or queriedpPresentModes- eitherNULLor a pointer to an array ofVkPresentModeKHRvalues
-
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, VkSurfaceFormatKHR.Buffer pSurfaceFormats)
Array version of:GetPhysicalDeviceSurfaceFormatsKHR
-
vkGetPhysicalDeviceSurfacePresentModesKHR
public static int vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, long surface, int[] pPresentModeCount, int[] pPresentModes)
Array version of:GetPhysicalDeviceSurfacePresentModesKHR
-
-