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.
*
*
* - 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 {@code VK_KHR_external_fence}
*
* - Contact
*
* - Jesse Hall @jessehall
*
* - 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 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();
}
static boolean isAvailable(VKCapabilitiesDevice caps) {
return checkFunctions(
caps.vkImportFenceWin32HandleKHR, caps.vkGetFenceWin32HandleKHR
);
}
// --- [ 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(__functionAddress, device.address(), pImportFenceWin32HandleInfo);
}
/**
* 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 fname: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 (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pImportFenceWin32HandleInfo} must be a 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 KHRExternalMemory#VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR ERROR_INVALID_EXTERNAL_HANDLE_KHR}
*
*
*
* See Also
*
* {@link VkImportFenceWin32HandleInfoKHR}
*
* @param device the logical device that created the fence.
* @param pImportFenceWin32HandleInfo points to a {@link VkImportFenceWin32HandleInfoKHR} structure specifying the fence and import parameters.
*/
@NativeType("VkResult")
public static int vkImportFenceWin32HandleKHR(VkDevice device, @NativeType("const VkImportFenceWin32HandleInfoKHR *") 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(__functionAddress, device.address(), pGetWin32HandleInfo, pHandle);
}
/**
* 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 {@link #vkGetFenceWin32HandleKHR GetFenceWin32HandleKHR} are owned by the application. To avoid leaking resources, the application must release ownership of them using the fname: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 pointer to a valid {@link VkFenceGetWin32HandleInfoKHR} structure
* - {@code pHandle} must be a 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 an instance of the {@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("const VkFenceGetWin32HandleInfoKHR *") VkFenceGetWin32HandleInfoKHR pGetWin32HandleInfo, @NativeType("HANDLE *") PointerBuffer pHandle) {
if (CHECKS) {
check(pHandle, 1);
}
return nvkGetFenceWin32HandleKHR(device, pGetWin32HandleInfo.address(), memAddress(pHandle));
}
}