org.lwjgl.vulkan.NVExternalMemoryWin32 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwjgl-vulkan Show documentation
Show all versions of lwjgl-vulkan Show documentation
A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.
/*
* 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 static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/** Applications may wish to export memory to other Vulkan instances or other APIs, or import memory from other Vulkan instances or other APIs to enable Vulkan workloads to be split up across application module, process, or API boundaries. This extension enables win32 applications to export win32 handles from Vulkan memory objects such that the underlying resources can be referenced outside the Vulkan instance that created them, and import win32 handles created in the Direct3D API to Vulkan memory objects. */
public class NVExternalMemoryWin32 {
/** The extension specification version. */
public static final int VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION = 1;
/** The extension name. */
public static final String VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME = "VK_NV_external_memory_win32";
/**
* Extends {@code VkStructureType}.
*
* Enum values:
*
*
* - {@link #VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV}
* - {@link #VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV}
*
*/
public static final int
VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001;
protected NVExternalMemoryWin32() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(VKCapabilities caps) {
return checkFunctions(
caps.vkGetMemoryWin32HandleNV
);
}
// --- [ vkGetMemoryWin32HandleNV ] ---
/** Unsafe version of: {@link #vkGetMemoryWin32HandleNV GetMemoryWin32HandleNV} */
public static int nvkGetMemoryWin32HandleNV(VkDevice device, long memory, int handleType, long pHandle) {
long __functionAddress = device.getCapabilities().vkGetMemoryWin32HandleNV;
if ( CHECKS )
check(__functionAddress);
return callPJPI(__functionAddress, device.address(), memory, handleType, pHandle);
}
/**
* retrieve Win32 handle to a device memory object.
*
* C Specification
*
* To retrieve the handle corresponding to a device memory object created with {@link VkExportMemoryAllocateInfoNV}{@code ::handleTypes} set to include {@link NVExternalMemoryCapabilities#VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV} or {@link NVExternalMemoryCapabilities#VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV}, call:
*
* VkResult vkGetMemoryWin32HandleNV(
VkDevice device,
VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle);
*
* Valid Usage
*
*
* - {@code handleType} must be a flag specified in {@link VkExportMemoryAllocateInfoNV}{@code ::handleTypes} when allocating {@code memory}
*
*
* Valid Usage (Implicit)
*
*
* - {@code device} must be a valid {@code VkDevice} handle
* - {@code memory} must be a valid {@code VkDeviceMemory} handle
* - {@code handleType} must be a valid combination of {@code VkExternalMemoryHandleTypeFlagBitsNV} values
* - {@code handleType} must not be 0
* - {@code pHandle} must be a pointer to a {@code HANDLE} value
* - {@code memory} must have been created, allocated, or retrieved from {@code device}
*
*
* 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}
*
*
*
* @param device the logical device that owns the memory.
* @param memory the {@code VkDeviceMemory} object.
* @param handleType a bitmask of {@code VkExternalMemoryHandleTypeFlagBitsNV} containing a single bit specifying the type of handle requested.
* @param pHandle
*/
public static int vkGetMemoryWin32HandleNV(VkDevice device, long memory, int handleType, PointerBuffer pHandle) {
if ( CHECKS )
check(pHandle, 1);
return nvkGetMemoryWin32HandleNV(device, memory, handleType, memAddress(pHandle));
}
}