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.
 * 
 * 
VK_KHR_external_memory_fd
* *
*
Name String
*
{@code VK_KHR_external_memory_fd}
*
Extension Type
*
Device extension
*
Registered Extension Number
*
75
*
Revision
*
1
*
Extension and Version Dependencies
*
    *
  • Requires Vulkan 1.0
  • *
  • Requires {@link KHRExternalMemory VK_KHR_external_memory}
  • *
*
Contact
*
*
* *
Other Extension Metadata
* *
*
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(); } // --- [ 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(device.address(), pGetFdInfo, pFd, __functionAddress); } /** * Get a POSIX file descriptor for a memory object. * *
C Specification
* *

To export a POSIX file descriptor referencing the payload of a Vulkan device memory object, call:

* *

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

Each call to {@code vkGetMemoryFdKHR} must create a new file descriptor holding a reference to the memory object’s payload and transfer ownership of the file descriptor to the application. To avoid leaking resources, the application must release ownership of the file descriptor using the {@code 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 {@code execve} system call is made.

* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code pGetFdInfo} must be a valid pointer to a valid {@link VkMemoryGetFdInfoKHR} structure
  • *
  • {@code pFd} must be a valid pointer to an {@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 a {@link VkMemoryGetFdInfoKHR} structure containing parameters of the export operation. * @param pFd will return a file descriptor referencing the payload of the device memory object. */ @NativeType("VkResult") public static int vkGetMemoryFdKHR(VkDevice device, @NativeType("VkMemoryGetFdInfoKHR const *") 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(device.address(), handleType, fd, pMemoryFdProperties, __functionAddress); } /** * 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,
     *     VkExternalMemoryHandleTypeFlagBits          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 {@link VK11#VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code device} must be a valid {@code VkDevice} handle
  • *
  • {@code handleType} must be a valid {@code VkExternalMemoryHandleTypeFlagBits} value
  • *
  • {@code pMemoryFdProperties} must be a valid pointer to a {@link VkMemoryFdPropertiesKHR} 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 VkMemoryFdPropertiesKHR}

* * @param device the logical device that will be importing {@code fd}. * @param handleType a {@code VkExternalMemoryHandleTypeFlagBits} value specifying the type of the handle {@code fd}. * @param fd the handle which will be imported. * @param pMemoryFdProperties a pointer to a {@link VkMemoryFdPropertiesKHR} structure in which the properties of the handle {@code fd} are returned. */ @NativeType("VkResult") public static int vkGetMemoryFdPropertiesKHR(VkDevice device, @NativeType("VkExternalMemoryHandleTypeFlagBits") 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("VkMemoryGetFdInfoKHR const *") VkMemoryGetFdInfoKHR pGetFdInfo, @NativeType("int *") int[] pFd) { long __functionAddress = device.getCapabilities().vkGetMemoryFdKHR; if (CHECKS) { check(__functionAddress); check(pFd, 1); } return callPPPI(device.address(), pGetFdInfo.address(), pFd, __functionAddress); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy