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

org.lwjgl.vulkan.KHRExternalMemoryFd 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 java.nio.*;

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 POSIX file descriptor handles from Vulkan memory objects and to import Vulkan memory objects from POSIX file descriptor handles exported from other Vulkan memory objects or from similar resources in other APIs.
 * 
 * 
*
Name String
*
{@code VK_KHR_external_memory_fd}
*
Extension Type
*
Device extension
*
Registered Extension Number
*
75
*
Revision
*
1
*
Extension and Version Dependencies
*
*
Contact
*
    *
  • James Jones @cubanismo
  • *
*
Last Modified Date
*
2016-10-21
*
IP Status
*
No known IP claims.
*
Contributors
*
    *
  • James Jones, NVIDIA
  • *
  • Jeff Juliano, NVIDIA
  • *
*
*/ public class KHRExternalMemoryFd { /** The extension specification version. */ public static final int VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION = 1; /** The extension name. */ public static final String VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME = "VK_KHR_external_memory_fd"; /** * Extends {@code VkStructureType}. * *
Enum values:
* *
    *
  • {@link #VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR}
  • *
  • {@link #VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR}
  • *
*/ public static final int VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR = 1000074000, VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR = 1000074001, VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR = 1000074002; protected KHRExternalMemoryFd() { throw new UnsupportedOperationException(); } static boolean isAvailable(VKCapabilitiesDevice caps) { return checkFunctions( caps.vkGetMemoryFdKHR, caps.vkGetMemoryFdPropertiesKHR ); } // --- [ vkGetMemoryFdKHR ] --- /** Unsafe version of: {@link #vkGetMemoryFdKHR GetMemoryFdKHR} */ public static int nvkGetMemoryFdKHR(VkDevice device, long pGetFdInfo, long pFd) { long __functionAddress = device.getCapabilities().vkGetMemoryFdKHR; if (CHECKS) { check(__functionAddress); } return callPPPI(__functionAddress, device.address(), pGetFdInfo, pFd); } /** * Get a POSIX file descriptor for a memory object. * *
C Specification
* *

To export a POSIX file descriptor representing the underlying resources of a Vulkan device memory object, call:

* *
     * VkResult vkGetMemoryFdKHR(
     *     VkDevice                                    device,
     *     const VkMemoryGetFdInfoKHR*                 pGetFdInfo,
     *     int*                                        pFd);
* *
Description
* *

Each call to {@link #vkGetMemoryFdKHR GetMemoryFdKHR} must create a new file descriptor and transfer ownership of it to the application. To avoid leaking resources, the application must release ownership of the file descriptor using the fname:close system call when it is no longer needed, or by importing a Vulkan memory object from it. Where supported by the operating system, the implementation must set the file descriptor to be closed automatically when an fname:execve system call is made.

* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code pGetFdInfo} must be a pointer to a valid {@link VkMemoryGetFdInfoKHR} structure
  • *
  • {@code pFd} must be a pointer to a {@code int} 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 VkMemoryGetFdInfoKHR}

* * @param device the logical device that created the device memory being exported. * @param pGetFdInfo a pointer to an instance of the {@link VkMemoryGetFdInfoKHR} structure containing parameters of the export operation. * @param pFd will return a file descriptor representing the underlying resources of the device memory object. */ @NativeType("VkResult") public static int vkGetMemoryFdKHR(VkDevice device, @NativeType("const VkMemoryGetFdInfoKHR *") VkMemoryGetFdInfoKHR pGetFdInfo, @NativeType("int *") IntBuffer pFd) { if (CHECKS) { check(pFd, 1); } return nvkGetMemoryFdKHR(device, pGetFdInfo.address(), memAddress(pFd)); } // --- [ vkGetMemoryFdPropertiesKHR ] --- /** Unsafe version of: {@link #vkGetMemoryFdPropertiesKHR GetMemoryFdPropertiesKHR} */ public static int nvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, long pMemoryFdProperties) { long __functionAddress = device.getCapabilities().vkGetMemoryFdPropertiesKHR; if (CHECKS) { check(__functionAddress); } return callPPI(__functionAddress, device.address(), handleType, fd, pMemoryFdProperties); } /** * Get Properties of External Memory File Descriptors. * *
C Specification
* *

POSIX file descriptor 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 vkGetMemoryFdPropertiesKHR(
     *     VkDevice                                    device,
     *     VkExternalMemoryHandleTypeFlagBitsKHR       handleType,
     *     int                                         fd,
     *     VkMemoryFdPropertiesKHR*                    pMemoryFdProperties);
* *
Valid Usage
* *
    *
  • {@code fd} 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 pMemoryFdProperties} must be a pointer to a {@link VkMemoryFdPropertiesKHR} 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 VkMemoryFdPropertiesKHR}

* * @param device the logical device that will be importing {@code fd}. * @param handleType the type of the handle {@code fd}. * @param fd the handle which will be imported. * @param pMemoryFdProperties will return properties of the handle {@code fd}. */ @NativeType("VkResult") public static int vkGetMemoryFdPropertiesKHR(VkDevice device, @NativeType("VkExternalMemoryHandleTypeFlagBitsKHR") int handleType, int fd, @NativeType("VkMemoryFdPropertiesKHR *") VkMemoryFdPropertiesKHR pMemoryFdProperties) { return nvkGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties.address()); } /** Array version of: {@link #vkGetMemoryFdKHR GetMemoryFdKHR} */ @NativeType("VkResult") public static int vkGetMemoryFdKHR(VkDevice device, @NativeType("const VkMemoryGetFdInfoKHR *") VkMemoryGetFdInfoKHR pGetFdInfo, @NativeType("int *") int[] pFd) { long __functionAddress = device.getCapabilities().vkGetMemoryFdKHR; if (CHECKS) { check(__functionAddress); check(pFd, 1); } return callPPPI(__functionAddress, device.address(), pGetFdInfo.address(), pFd); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy