vulkan-3.8.1: Bindings to the Vulkan graphics API.
Safe HaskellNone
LanguageHaskell2010

Vulkan.Extensions.VK_KHR_external_memory_fd

Description

Name

VK_KHR_external_memory_fd - device extension

VK_KHR_external_memory_fd

Name String
VK_KHR_external_memory_fd
Extension Type
Device extension
Registered Extension Number
75
Revision
1
Extension and Version Dependencies
  • Requires Vulkan 1.0
  • Requires 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

Description

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.

New Commands

New Structures

New Enum Constants

Issues

1) Does the application need to close the file descriptor returned by getMemoryFdKHR?

RESOLVED: Yes, unless it is passed back in to a driver instance to import the memory. A successful get call transfers ownership of the file descriptor to the application, and a successful import transfers it back to the driver. Destroying the original memory object will not close the file descriptor or remove its reference to the underlying memory resource associated with it.

2) Do drivers ever need to expose multiple file descriptors per memory object?

RESOLVED: No. This would indicate there are actually multiple memory objects, rather than a single memory object.

3) How should the valid size and memory type for POSIX file descriptor memory handles created outside of Vulkan be specified?

RESOLVED: The valid memory types are queried directly from the external handle. The size will be specified by future extensions that introduce such external memory handle types.

Version History

  • Revision 1, 2016-10-21 (James Jones)

    • Initial revision

See Also

ImportMemoryFdInfoKHR, MemoryFdPropertiesKHR, MemoryGetFdInfoKHR, getMemoryFdKHR, getMemoryFdPropertiesKHR

Document Notes

For more information, see the Vulkan Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

getMemoryFdKHR Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device that created the device memory being exported.

device must be a valid Device handle

-> MemoryGetFdInfoKHR

pGetFdInfo is a pointer to a MemoryGetFdInfoKHR structure containing parameters of the export operation.

pGetFdInfo must be a valid pointer to a valid MemoryGetFdInfoKHR structure

-> io ("fd" ::: Int32) 

vkGetMemoryFdKHR - Get a POSIX file descriptor for a memory object

Description

Each call to getMemoryFdKHR 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 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 execve system call is made.

Return Codes

Success
Failure

See Also

Device, MemoryGetFdInfoKHR

getMemoryFdPropertiesKHR Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device that will be importing fd.

device must be a valid Device handle

-> ExternalMemoryHandleTypeFlagBits

handleType is the type of the handle fd.

handleType must not be EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR

handleType must be a valid ExternalMemoryHandleTypeFlagBits value

-> ("fd" ::: Int32)

fd is the handle which will be imported.

fd must be an external memory handle created outside of the Vulkan API

-> io MemoryFdPropertiesKHR 

vkGetMemoryFdPropertiesKHR - Get Properties of External Memory File Descriptors

Return Codes

Success
Failure

See Also

Device, ExternalMemoryHandleTypeFlagBits, MemoryFdPropertiesKHR

data ImportMemoryFdInfoKHR Source #

VkImportMemoryFdInfoKHR - import memory created on the same physical device from a file descriptor

Description

Importing memory from a file descriptor transfers ownership of the file descriptor from the application to the Vulkan implementation. The application must not perform any operations on the file descriptor after a successful import. The imported memory object holds a reference to its payload.

Applications can import the same payload into multiple instances of Vulkan, into the same instance from which it was exported, and multiple times into a given Vulkan instance. In all cases, each import operation must create a distinct DeviceMemory object.

Valid Usage

Valid Usage (Implicit)

See Also

ExternalMemoryHandleTypeFlagBits, StructureType

Constructors

ImportMemoryFdInfoKHR 

Fields

Instances

Instances details
Eq ImportMemoryFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Show ImportMemoryFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Storable ImportMemoryFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

FromCStruct ImportMemoryFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

ToCStruct ImportMemoryFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Zero ImportMemoryFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

data MemoryFdPropertiesKHR Source #

VkMemoryFdPropertiesKHR - Properties of External Memory File Descriptors

Valid Usage (Implicit)

See Also

StructureType, getMemoryFdPropertiesKHR

Constructors

MemoryFdPropertiesKHR 

Fields

  • memoryTypeBits :: Word32

    memoryTypeBits is a bitmask containing one bit set for every memory type which the specified file descriptor can be imported as.

Instances

Instances details
Eq MemoryFdPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Show MemoryFdPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Storable MemoryFdPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

FromCStruct MemoryFdPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

ToCStruct MemoryFdPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Zero MemoryFdPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

data MemoryGetFdInfoKHR Source #

VkMemoryGetFdInfoKHR - Structure describing a POSIX FD semaphore export operation

Description

The properties of the file descriptor exported depend on the value of handleType. See ExternalMemoryHandleTypeFlagBits for a description of the properties of the defined external memory handle types.

Note

The size of the exported file may be larger than the size requested by MemoryAllocateInfo::allocationSize. If handleType is EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT, then the application can query the file’s actual size with lseek(2).

Valid Usage (Implicit)

See Also

DeviceMemory, ExternalMemoryHandleTypeFlagBits, StructureType, getMemoryFdKHR

Constructors

MemoryGetFdInfoKHR 

Fields

Instances

Instances details
Eq MemoryGetFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Show MemoryGetFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Storable MemoryGetFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

FromCStruct MemoryGetFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

ToCStruct MemoryGetFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

Zero MemoryGetFdInfoKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_external_memory_fd

type KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME = "VK_KHR_external_memory_fd" Source #

pattern KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #