Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_external_memory or Version 1.1
- 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
- getMemoryFdKHR :: forall io. MonadIO io => Device -> MemoryGetFdInfoKHR -> io ("fd" ::: Int32)
- getMemoryFdPropertiesKHR :: forall io. MonadIO io => Device -> ExternalMemoryHandleTypeFlagBits -> ("fd" ::: Int32) -> io MemoryFdPropertiesKHR
- data ImportMemoryFdInfoKHR = ImportMemoryFdInfoKHR {}
- data MemoryFdPropertiesKHR = MemoryFdPropertiesKHR {}
- data MemoryGetFdInfoKHR = MemoryGetFdInfoKHR {}
- type KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION = 1
- pattern KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION :: forall a. Integral a => a
- type KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME = "VK_KHR_external_memory_fd"
- pattern KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
:: forall io. MonadIO io | |
=> Device |
|
-> MemoryGetFdInfoKHR |
|
-> 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
See Also
getMemoryFdPropertiesKHR Source #
:: forall io. MonadIO io | |
=> Device |
|
-> ExternalMemoryHandleTypeFlagBits |
|
-> ("fd" ::: Int32) |
|
-> io MemoryFdPropertiesKHR |
vkGetMemoryFdPropertiesKHR - Get Properties of External Memory File Descriptors
Return Codes
See Also
VK_KHR_external_memory_fd,
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
- If
handleType
is not0
, it must be supported for import, as reported byExternalImageFormatProperties
orExternalBufferProperties
- The memory from which
fd
was exported must have been created on the same underlying physical device asdevice
- If
handleType
is not0
, it must beEXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT
orEXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT
- If
handleType
is not0
,fd
must be a valid handle of the type specified byhandleType
- The memory represented by
fd
must have been created from a physical device and driver that is compatible withdevice
andhandleType
, as described in https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#external-memory-handle-types-compatibility -
fd
must obey any requirements listed forhandleType
in external memory handle types compatibility
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR
- If
handleType
is not0
,handleType
must be a validExternalMemoryHandleTypeFlagBits
value
See Also
VK_KHR_external_memory_fd,
ExternalMemoryHandleTypeFlagBits
,
StructureType
ImportMemoryFdInfoKHR | |
|
Instances
data MemoryFdPropertiesKHR Source #
VkMemoryFdPropertiesKHR - Properties of External Memory File Descriptors
Valid Usage (Implicit)
See Also
VK_KHR_external_memory_fd,
StructureType
,
getMemoryFdPropertiesKHR
MemoryFdPropertiesKHR | |
|
Instances
data MemoryGetFdInfoKHR Source #
VkMemoryGetFdInfoKHR - Structure describing a POSIX FD memory 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.
Valid Usage (Implicit)
See Also
VK_KHR_external_memory_fd,
DeviceMemory
,
ExternalMemoryHandleTypeFlagBits
,
StructureType
, getMemoryFdKHR
MemoryGetFdInfoKHR | |
|
Instances
type KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION = 1 Source #
pattern KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION :: forall a. Integral a => a Source #
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 #