All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.vulkan.KHRExternalMemoryWin32 Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.3.4
Show newest version
/*
 * 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.
 * 
 * 
*
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
  • *
*
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(); } static boolean isAvailable(VKCapabilitiesDevice caps) { return checkFunctions( caps.vkGetMemoryWin32HandleKHR, caps.vkGetMemoryWin32HandlePropertiesKHR ); } // --- [ 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(__functionAddress, device.address(), pGetWin32HandleInfo, pHandle); } /** * Get a Windows HANDLE for a memory object. * *
C Specification
* *

To export a Windows handle representing the underlying resources 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 {@link #vkGetMemoryWin32HandleKHR GetMemoryWin32HandleKHR} 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.

* *
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 an instance of the {@link VkMemoryGetWin32HandleInfoKHR} structure containing parameters of the export operation. * @param pHandle will return the Windows handle representing the underlying resources of the device memory object. */ @NativeType("VkResult") public static int vkGetMemoryWin32HandleKHR(VkDevice device, @NativeType("const VkMemoryGetWin32HandleInfoKHR *") 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(__functionAddress, device.address(), handleType, handle, pMemoryWin32HandleProperties); } /** * 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,
     *     VkExternalMemoryHandleTypeFlagBitsKHR       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 VkExternalMemoryHandleTypeFlagBitsKHR} 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 KHRExternalMemory#VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR ERROR_INVALID_EXTERNAL_HANDLE_KHR}
  • *
*
* *
See Also
* *

{@link VkMemoryWin32HandlePropertiesKHR}

* * @param device the logical device that will be importing {@code handle}. * @param handleType the type of the handle {@code handle}. * @param handle the handle which will be imported. * @param pMemoryWin32HandleProperties will return properties of {@code handle}. */ @NativeType("VkResult") public static int vkGetMemoryWin32HandlePropertiesKHR(VkDevice device, @NativeType("VkExternalMemoryHandleTypeFlagBitsKHR") int handleType, @NativeType("HANDLE") long handle, @NativeType("VkMemoryWin32HandlePropertiesKHR *") VkMemoryWin32HandlePropertiesKHR pMemoryWin32HandleProperties) { return nvkGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties.address()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy