org.lwjgl.vulkan.KHRExternalFenceWin32 Maven / Gradle / Ivy
Show all versions of lwjgl-vulkan Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* An application using external memory may wish to synchronize access to that memory using fences. This extension enables an application to export fence payload to and import fence payload from Windows handles.
*
* VK_KHR_external_fence_win32
*
*
* - Name String
* - {@code VK_KHR_external_fence_win32}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 115
* - Revision
* - 1
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@link KHRExternalFence VK_KHR_external_fence}
*
* - Contact
*
* - Jesse Hall critsec
*
*
*
* Other Extension Metadata
*
*
* - Last Modified Date
* - 2017-05-08
* - IP Status
* - No known IP claims.
* - Contributors
*
* - Jesse Hall, Google
* - James Jones, NVIDIA
* - Jeff Juliano, NVIDIA
* - Cass Everitt, Oculus
* - Contributors to {@link KHRExternalSemaphoreWin32 VK_KHR_external_semaphore_win32}
*
*
*/
public class KHRExternalFenceWin32 {
/** The extension specification version. */
public static final int VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME = "VK_KHR_external_fence_win32";
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR}
*
*/
public static final int
VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000,
VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001,
VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002;
protected KHRExternalFenceWin32() {
throw new UnsupportedOperationException();
}
// --- [ vkImportFenceWin32HandleKHR ] ---
/** Unsafe version of: {@link #vkImportFenceWin32HandleKHR ImportFenceWin32HandleKHR} */
public static int nvkImportFenceWin32HandleKHR(VkDevice device, long pImportFenceWin32HandleInfo) {
long __functionAddress = device.getCapabilities().vkImportFenceWin32HandleKHR;
if (CHECKS) {
check(__functionAddress);
VkImportFenceWin32HandleInfoKHR.validate(pImportFenceWin32HandleInfo);
}
return callPPI(device.address(), pImportFenceWin32HandleInfo, __functionAddress);
}
/**
* Import a fence from a Windows HANDLE.
*
* C Specification
*
* To import a fence payload from a Windows handle, call:
*
*
* VkResult vkImportFenceWin32HandleKHR(
* VkDevice device,
* const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
*
* Description
*
* Importing a fence payload from Windows handles does not transfer ownership of the handle to the Vulkan implementation. For handle types defined as NT handles, the application must release ownership using the {@code CloseHandle} system call when the handle is no longer needed.
*
* Applications can import the same fence payload into multiple instances of Vulkan, into the same instance from which it was exported, and multiple times into a given Vulkan instance.
*
* Valid Usage
*
*
* - {@code fence} must not be associated with any queue command that has not yet completed execution on that queue
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pImportFenceWin32HandleInfo} must be a valid pointer to a valid {@link VkImportFenceWin32HandleInfoKHR} structure
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
* - {@link VK11#VK_ERROR_INVALID_EXTERNAL_HANDLE ERROR_INVALID_EXTERNAL_HANDLE}
*
*
*
* See Also
*
* {@link VkImportFenceWin32HandleInfoKHR}
*
* @param device the logical device that created the fence.
* @param pImportFenceWin32HandleInfo a pointer to a {@link VkImportFenceWin32HandleInfoKHR} structure specifying the fence and import parameters.
*/
@NativeType("VkResult")
public static int vkImportFenceWin32HandleKHR(VkDevice device, @NativeType("VkImportFenceWin32HandleInfoKHR const *") VkImportFenceWin32HandleInfoKHR pImportFenceWin32HandleInfo) {
return nvkImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo.address());
}
// --- [ vkGetFenceWin32HandleKHR ] ---
/** Unsafe version of: {@link #vkGetFenceWin32HandleKHR GetFenceWin32HandleKHR} */
public static int nvkGetFenceWin32HandleKHR(VkDevice device, long pGetWin32HandleInfo, long pHandle) {
long __functionAddress = device.getCapabilities().vkGetFenceWin32HandleKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPPI(device.address(), pGetWin32HandleInfo, pHandle, __functionAddress);
}
/**
* Get a Windows HANDLE for a fence.
*
* C Specification
*
* To export a Windows handle representing the state of a fence, call:
*
*
* VkResult vkGetFenceWin32HandleKHR(
* VkDevice device,
* const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
* HANDLE* pHandle);
*
* Description
*
* For handle types defined as NT handles, the handles returned by {@code vkGetFenceWin32HandleKHR} are owned by the application. To avoid leaking resources, the application must release ownership of them using the {@code CloseHandle} system call when they are no longer needed.
*
* Exporting a Windows handle from a fence may have side effects depending on the transference of the specified handle type, as described in Importing Fence Payloads.
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pGetWin32HandleInfo} must be a valid pointer to a valid {@link VkFenceGetWin32HandleInfoKHR} structure
* - {@code pHandle} must be a valid pointer to a {@code HANDLE} value
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_TOO_MANY_OBJECTS ERROR_TOO_MANY_OBJECTS}
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
*
*
*
* See Also
*
* {@link VkFenceGetWin32HandleInfoKHR}
*
* @param device the logical device that created the fence being exported.
* @param pGetWin32HandleInfo a pointer to a {@link VkFenceGetWin32HandleInfoKHR} structure containing parameters of the export operation.
* @param pHandle will return the Windows handle representing the fence state.
*/
@NativeType("VkResult")
public static int vkGetFenceWin32HandleKHR(VkDevice device, @NativeType("VkFenceGetWin32HandleInfoKHR const *") VkFenceGetWin32HandleInfoKHR pGetWin32HandleInfo, @NativeType("HANDLE *") PointerBuffer pHandle) {
if (CHECKS) {
check(pHandle, 1);
}
return nvkGetFenceWin32HandleKHR(device, pGetWin32HandleInfo.address(), memAddress(pHandle));
}
}