org.lwjgl.vulkan.KHRExternalMemoryWin32 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 may wish to reference device memory in multiple Vulkan logical devices or instances, in multiple processes, and/or in multiple APIs. This extension enables an application to export Windows handles from Vulkan memory objects and to import Vulkan memory objects from Windows handles exported from other Vulkan memory objects or from similar resources in other APIs.
*
* VK_KHR_external_memory_win32
*
*
* - Name String
* - {@code VK_KHR_external_memory_win32}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 74
* - Revision
* - 1
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@link KHRExternalMemory VK_KHR_external_memory}
*
* - Contact
*
* - James Jones cubanismo
*
*
*
* Other Extension Metadata
*
*
* - Last Modified Date
* - 2016-10-21
* - IP Status
* - No known IP claims.
* - Contributors
*
* - James Jones, NVIDIA
* - Jeff Juliano, NVIDIA
* - Carsten Rohde, NVIDIA
*
*
*/
public class KHRExternalMemoryWin32 {
/** The extension specification version. */
public static final int VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME = "VK_KHR_external_memory_win32";
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR}
* - {@link #VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR}
* - {@link #VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR}
*
*/
public static final int
VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000,
VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001,
VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002,
VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = 1000073003;
protected KHRExternalMemoryWin32() {
throw new UnsupportedOperationException();
}
// --- [ vkGetMemoryWin32HandleKHR ] ---
/** Unsafe version of: {@link #vkGetMemoryWin32HandleKHR GetMemoryWin32HandleKHR} */
public static int nvkGetMemoryWin32HandleKHR(VkDevice device, long pGetWin32HandleInfo, long pHandle) {
long __functionAddress = device.getCapabilities().vkGetMemoryWin32HandleKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPPI(device.address(), pGetWin32HandleInfo, pHandle, __functionAddress);
}
/**
* Get a Windows HANDLE for a memory object.
*
* C Specification
*
* To export a Windows handle representing the payload of a Vulkan device memory object, call:
*
*
* VkResult vkGetMemoryWin32HandleKHR(
* VkDevice device,
* const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
* HANDLE* pHandle);
*
* Description
*
* For handle types defined as NT handles, the handles returned by {@code vkGetMemoryWin32HandleKHR} are owned by the application and hold a reference to their payload. To avoid leaking resources, the application must release ownership of them using the {@code CloseHandle} system call when they are no longer needed.
*
* Note
*
* Non-NT handle types do not add a reference to their associated payload. If the original object owning the payload is destroyed, all resources and handles sharing that payload will become invalid.
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code pGetWin32HandleInfo} must be a valid pointer to a valid {@link VkMemoryGetWin32HandleInfoKHR} 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 VkMemoryGetWin32HandleInfoKHR}
*
* @param device the logical device that created the device memory being exported.
* @param pGetWin32HandleInfo a pointer to a {@link VkMemoryGetWin32HandleInfoKHR} structure containing parameters of the export operation.
* @param pHandle will return the Windows handle representing the payload of the device memory object.
*/
@NativeType("VkResult")
public static int vkGetMemoryWin32HandleKHR(VkDevice device, @NativeType("VkMemoryGetWin32HandleInfoKHR const *") VkMemoryGetWin32HandleInfoKHR pGetWin32HandleInfo, @NativeType("HANDLE *") PointerBuffer pHandle) {
if (CHECKS) {
check(pHandle, 1);
}
return nvkGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo.address(), memAddress(pHandle));
}
// --- [ vkGetMemoryWin32HandlePropertiesKHR ] ---
/** Unsafe version of: {@link #vkGetMemoryWin32HandlePropertiesKHR GetMemoryWin32HandlePropertiesKHR} */
public static int nvkGetMemoryWin32HandlePropertiesKHR(VkDevice device, int handleType, long handle, long pMemoryWin32HandleProperties) {
long __functionAddress = device.getCapabilities().vkGetMemoryWin32HandlePropertiesKHR;
if (CHECKS) {
check(__functionAddress);
check(handle);
}
return callPPPI(device.address(), handleType, handle, pMemoryWin32HandleProperties, __functionAddress);
}
/**
* Get Properties of External Memory Win32 Handles.
*
* C Specification
*
* Windows memory handles compatible with Vulkan may also be created by non-Vulkan APIs using methods beyond the scope of this specification. To determine the correct parameters to use when importing such handles, call:
*
*
* VkResult vkGetMemoryWin32HandlePropertiesKHR(
* VkDevice device,
* VkExternalMemoryHandleTypeFlagBits handleType,
* HANDLE handle,
* VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
*
* Valid Usage
*
*
* - {@code handle} must be an external memory handle created outside of the Vulkan API
* - {@code handleType} must not be one of the handle types defined as opaque
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code handleType} must be a valid {@code VkExternalMemoryHandleTypeFlagBits} value
* - {@code pMemoryWin32HandleProperties} must be a valid pointer to a {@link VkMemoryWin32HandlePropertiesKHR} 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 VkMemoryWin32HandlePropertiesKHR}
*
* @param device the logical device that will be importing {@code handle}.
* @param handleType a {@code VkExternalMemoryHandleTypeFlagBits} value specifying the type of the handle {@code handle}.
* @param handle the handle which will be imported.
* @param pMemoryWin32HandleProperties a pointer to a {@link VkMemoryWin32HandlePropertiesKHR} structure in which properties of {@code handle} are returned.
*/
@NativeType("VkResult")
public static int vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, @NativeType("VkExternalMemoryHandleTypeFlagBits") int handleType, @NativeType("HANDLE") long handle, @NativeType("VkMemoryWin32HandlePropertiesKHR *") VkMemoryWin32HandlePropertiesKHR pMemoryWin32HandleProperties) {
return nvkGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties.address());
}
}