vulkan-2.0.0.1: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core11.Promoted_from_VK_KHR_external_memory_capabilities

Synopsis

Documentation

newtype VkExternalMemoryHandleTypeFlagBits Source #

VkExternalMemoryHandleTypeFlagBits - Bit specifying external memory handle types

Description

  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT specifies a POSIX file descriptor handle that has only limited valid usage outside of Vulkan and other compatible APIs. It must be compatible with the POSIX system calls dup, dup2, close, and the non-standard system call dup3. Additionally, it must be transportable over a socket using an SCM_RIGHTS control message. It owns a reference to the underlying memory resource represented by its Vulkan memory object.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT specifies an NT handle that has only limited valid usage outside of Vulkan and other compatible APIs. It must be compatible with the functions DuplicateHandle, CloseHandle, CompareObjectHandles, GetHandleInformation, and SetHandleInformation. It owns a reference to the underlying memory resource represented by its Vulkan memory object.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT specifies a global share handle that has only limited valid usage outside of Vulkan and other compatible APIs. It is not compatible with any native APIs. It does not own a reference to the underlying memory resource represented its Vulkan memory object, and will therefore become invalid when all Vulkan memory objects associated with it are destroyed.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT specifies an NT handle returned by IDXGIResource1::CreateSharedHandle referring to a Direct3D 10 or 11 texture resource. It owns a reference to the memory used by the Direct3D resource.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT specifies a global share handle returned by IDXGIResource::GetSharedHandle referring to a Direct3D 10 or 11 texture resource. It does not own a reference to the underlying Direct3D resource, and will therefore become invalid when all Vulkan memory objects and Direct3D resources associated with it are destroyed.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT specifies an NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 heap resource. It owns a reference to the resources used by the Direct3D heap.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT specifies an NT handle returned by ID3D12Device::CreateSharedHandle referring to a Direct3D 12 committed resource. It owns a reference to the memory used by the Direct3D resource.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT specifies a host pointer returned by a host memory allocation command. It does not own a reference to the underlying memory resource, and will therefore become invalid if the host memory is freed.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT specifies a host pointer to host mapped foreign memory. It does not own a reference to the underlying memory resource, and will therefore become invalid if the foreign memory is unmapped or otherwise becomes no longer available.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT is a file descriptor for a Linux dma_buf. It owns a reference to the underlying memory resource represented by its Vulkan memory object.
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID specifies an AHardwareBuffer object defined by the Android NDK. See Android Hardware Buffers for more details of this handle type.

Some external memory handle types can only be shared within the same underlying physical device and/or the same driver version, as defined in the following table:

Handle type VkPhysicalDeviceIDProperties::driverUUID VkPhysicalDeviceIDProperties::deviceUUID
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT Must match Must match
VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT No restriction No restriction
VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT No restriction No restriction
VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT No restriction No restriction
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID No restriction No restriction

External memory handle types compatibility

Note

The above table does not restrict the drivers and devices with which VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT and VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT may be shared, as these handle types inherently mean memory that does not come from the same device, as they import memory from the host or a foreign device, respectively.

Note

Even though the above table does not restrict the drivers and devices with which VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT may be shared, query mechanisms exist in the Vulkan API that prevent the import of incompatible dma-bufs (such as vkGetMemoryFdPropertiesKHR) and that prevent incompatible usage of dma-bufs (such as VkPhysicalDeviceExternalBufferInfoKHR and VkPhysicalDeviceExternalImageFormatInfoKHR).

See Also

VkExternalMemoryHandleTypeFlags, VkImportMemoryFdInfoKHR, VkImportMemoryHostPointerInfoEXT, VkImportMemoryWin32HandleInfoKHR, VkMemoryGetFdInfoKHR, VkMemoryGetWin32HandleInfoKHR, VkPhysicalDeviceExternalBufferInfo, VkPhysicalDeviceExternalImageFormatInfo, vkGetMemoryFdPropertiesKHR, vkGetMemoryHostPointerPropertiesEXT, vkGetMemoryWin32HandlePropertiesKHR

Instances
Eq VkExternalMemoryHandleTypeFlagBits Source # 
Instance details
Ord VkExternalMemoryHandleTypeFlagBits Source # 
Instance details
Read VkExternalMemoryHandleTypeFlagBits Source # 
Instance details
Show VkExternalMemoryHandleTypeFlagBits Source # 
Instance details
Storable VkExternalMemoryHandleTypeFlagBits Source # 
Instance details
Bits VkExternalMemoryHandleTypeFlagBits Source # 
Instance details

Methods

(.&.) :: VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits #

(.|.) :: VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits #

xor :: VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits #

complement :: VkExternalMemoryHandleTypeFlagBits -> VkExternalMemoryHandleTypeFlagBits #

shift :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

rotate :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

zeroBits :: VkExternalMemoryHandleTypeFlagBits #

bit :: Int -> VkExternalMemoryHandleTypeFlagBits #

setBit :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

clearBit :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

complementBit :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

testBit :: VkExternalMemoryHandleTypeFlagBits -> Int -> Bool #

bitSizeMaybe :: VkExternalMemoryHandleTypeFlagBits -> Maybe Int #

bitSize :: VkExternalMemoryHandleTypeFlagBits -> Int #

isSigned :: VkExternalMemoryHandleTypeFlagBits -> Bool #

shiftL :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

unsafeShiftL :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

shiftR :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

unsafeShiftR :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

rotateL :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

rotateR :: VkExternalMemoryHandleTypeFlagBits -> Int -> VkExternalMemoryHandleTypeFlagBits #

popCount :: VkExternalMemoryHandleTypeFlagBits -> Int #

FiniteBits VkExternalMemoryHandleTypeFlagBits Source # 
Instance details

newtype VkExternalMemoryFeatureFlagBits Source #

VkExternalMemoryFeatureFlagBits - Bitmask specifying features of an external memory handle type

Description

  • VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT specifies that images or buffers created with the specified parameters and handle type must use the mechanisms defined in the {html_spec_relative}#VK_NV_dedicated_allocation extension to create (or import) a dedicated allocation for the image or buffer.
  • VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT specifies that handles of this type can be exported from Vulkan memory objects.
  • VK_INTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT specifies that handles of this type can be imported as Vulkan memory objects.

Because their semantics in external APIs roughly align with that of an image or buffer with a dedicated allocation in Vulkan, implementations are required to report VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT for the following external handle types:

  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT
  • VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID for images only

Implementations must not report VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT for buffers with external handle type VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID.

See Also

VkExternalMemoryFeatureFlags

Instances
Eq VkExternalMemoryFeatureFlagBits Source # 
Instance details
Ord VkExternalMemoryFeatureFlagBits Source # 
Instance details
Read VkExternalMemoryFeatureFlagBits Source # 
Instance details
Show VkExternalMemoryFeatureFlagBits Source # 
Instance details
Storable VkExternalMemoryFeatureFlagBits Source # 
Instance details
Bits VkExternalMemoryFeatureFlagBits Source # 
Instance details

Methods

(.&.) :: VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits #

(.|.) :: VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits #

xor :: VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits #

complement :: VkExternalMemoryFeatureFlagBits -> VkExternalMemoryFeatureFlagBits #

shift :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

rotate :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

zeroBits :: VkExternalMemoryFeatureFlagBits #

bit :: Int -> VkExternalMemoryFeatureFlagBits #

setBit :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

clearBit :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

complementBit :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

testBit :: VkExternalMemoryFeatureFlagBits -> Int -> Bool #

bitSizeMaybe :: VkExternalMemoryFeatureFlagBits -> Maybe Int #

bitSize :: VkExternalMemoryFeatureFlagBits -> Int #

isSigned :: VkExternalMemoryFeatureFlagBits -> Bool #

shiftL :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

unsafeShiftL :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

shiftR :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

unsafeShiftR :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

rotateL :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

rotateR :: VkExternalMemoryFeatureFlagBits -> Int -> VkExternalMemoryFeatureFlagBits #

popCount :: VkExternalMemoryFeatureFlagBits -> Int #

FiniteBits VkExternalMemoryFeatureFlagBits Source # 
Instance details

pattern VK_LUID_SIZE :: Integral a => a Source #

vkGetPhysicalDeviceExternalBufferProperties :: ("physicalDevice" ::: VkPhysicalDevice) -> ("pExternalBufferInfo" ::: Ptr VkPhysicalDeviceExternalBufferInfo) -> ("pExternalBufferProperties" ::: Ptr VkExternalBufferProperties) -> IO () Source #

vkGetPhysicalDeviceExternalBufferProperties - Query external handle types supported by buffers

Parameters

  • physicalDevice is the physical device from which to query the buffer capabilities.

Valid Usage (Implicit)

  • physicalDevice must be a valid VkPhysicalDevice handle
  • pExternalBufferInfo must be a valid pointer to a valid VkPhysicalDeviceExternalBufferInfo structure
  • pExternalBufferProperties must be a valid pointer to a VkExternalBufferProperties structure

See Also

VkExternalBufferProperties, VkPhysicalDevice, VkPhysicalDeviceExternalBufferInfo

data VkExternalMemoryProperties Source #

VkExternalMemoryProperties - Structure specifying external memory handle type capabilities

Description

compatibleHandleTypes must include at least handleType. Inclusion of a handle type in compatibleHandleTypes does not imply the values returned in VkImageFormatProperties2 will be the same when VkPhysicalDeviceExternalImageFormatInfo::handleType is set to that type. The application is responsible for querying the capabilities of all handle types intended for concurrent use in a single image and intersecting them to obtain the compatible set of capabilities.

See Also

VkExternalBufferProperties, VkExternalImageFormatProperties, VkExternalMemoryFeatureFlags, VkExternalMemoryHandleTypeFlags

Constructors

VkExternalMemoryProperties 

Fields

data VkPhysicalDeviceExternalImageFormatInfo Source #

VkPhysicalDeviceExternalImageFormatInfo - Structure specifying external image creation parameters

Description

If handleType is 0, vkGetPhysicalDeviceImageFormatProperties2 will behave as if VkPhysicalDeviceExternalImageFormatInfo was not present, and VkExternalImageFormatProperties will be ignored.

If handleType is not compatible with the format, type, tiling, usage, and flags specified in VkPhysicalDeviceImageFormatInfo2, then vkGetPhysicalDeviceImageFormatProperties2 returns VK_ERROR_FORMAT_NOT_SUPPORTED.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO

See Also

VkExternalMemoryHandleTypeFlagBits, VkStructureType

Constructors

VkPhysicalDeviceExternalImageFormatInfo 

Fields

data VkExternalImageFormatProperties Source #

VkExternalImageFormatProperties - Structure specifying supported external handle properties

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES

See Also

VkExternalMemoryProperties, VkStructureType

Constructors

VkExternalImageFormatProperties 

Fields

data VkPhysicalDeviceExternalBufferInfo Source #

VkPhysicalDeviceExternalBufferInfo - Structure specifying buffer creation parameters

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO

See Also

VkBufferCreateFlags, VkBufferUsageFlags, VkExternalMemoryHandleTypeFlagBits, VkStructureType, vkGetPhysicalDeviceExternalBufferProperties, vkGetPhysicalDeviceExternalBufferPropertiesKHR

Constructors

VkPhysicalDeviceExternalBufferInfo 

Fields

data VkExternalBufferProperties Source #

VkExternalBufferProperties - Structure specifying supported external handle capabilities

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES
  • pNext must be NULL

See Also

VkExternalMemoryProperties, VkStructureType, vkGetPhysicalDeviceExternalBufferProperties, vkGetPhysicalDeviceExternalBufferPropertiesKHR

Constructors

VkExternalBufferProperties 

Fields

data VkPhysicalDeviceIDProperties Source #

VkPhysicalDeviceIDProperties - Structure specifying IDs related to the physical device

Description

deviceUUID must be immutable for a given device across instances, processes, driver APIs, driver versions, and system reboots.

Applications can compare the driverUUID value across instance and process boundaries, and can make similar queries in external APIs to determine whether they are capable of sharing memory objects and resources using them with the device.

deviceUUID and/or driverUUID must be used to determine whether a particular external object can be shared between driver components, where such a restriction exists as defined in the compatibility table for the particular object type:

If deviceLUIDValid is VK_FALSE, the contents of deviceLUID and deviceNodeMask are undefined. If deviceLUIDValid is VK_TRUE and Vulkan is running on the Windows operating system, the contents of deviceLUID can be cast to an LUID object and must be equal to the locally unique identifier of a IDXGIAdapter1 object that corresponds to physicalDevice. If deviceLUIDValid is VK_TRUE, deviceNodeMask must contain exactly one bit. If Vulkan is running on an operating system that supports the Direct3D 12 API and physicalDevice corresponds to an individual device in a linked device adapter, deviceNodeMask identifies the Direct3D 12 node corresponding to physicalDevice. Otherwise, deviceNodeMask must be 1.

Note

Although they have identical descriptions, VkPhysicalDeviceIDProperties::deviceUUID may differ from VkPhysicalDeviceProperties2::pipelineCacheUUID. The former is intended to identify and correlate devices across API and driver boundaries, while the latter is used to identify a compatible device and driver combination to use when serializing and de-serializing pipeline state.

Note

While VkPhysicalDeviceIDProperties::deviceUUID is specified to remain consistent across driver versions and system reboots, it is not intended to be usable as a serializable persistent identifier for a device. It may change when a device is physically added to, removed from, or moved to a different connector in a system while that system is powered down. Further, there is no reasonable way to verify with conformance testing that a given device retains the same UUID in a given system across all driver versions supported in that system. While implementations should make every effort to report consistent device UUIDs across driver versions, applications should avoid relying on the persistence of this value for uses other than identifying compatible devices for external object sharing purposes.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES

See Also

VkBool32, VkStructureType

Constructors

VkPhysicalDeviceIDProperties 

Fields

  • vkSType :: VkStructureType

    sType is the type of this structure.

  • vkPNext :: Ptr ()

    pNext is NULL or a pointer to an extension-specific structure.

  • vkDeviceUUID :: Vector VK_UUID_SIZE Word8

    deviceUUID is an array of size VK_UUID_SIZE, containing 8-bit values that represent a universally unique identifier for the device.

  • vkDriverUUID :: Vector VK_UUID_SIZE Word8

    driverUUID is an array of size VK_UUID_SIZE, containing 8-bit values that represent a universally unique identifier for the driver build in use by the device.

  • vkDeviceLUID :: Vector VK_LUID_SIZE Word8

    deviceLUID is an array of size VK_LUID_SIZE, containing 8-bit values that represent a locally unique identifier for the device.

  • vkDeviceNodeMask :: Word32

    deviceNodeMask is a bitfield identifying the node within a linked device adapter corresponding to the device.

  • vkDeviceLUIDValid :: VkBool32

    deviceLUIDValid is a boolean value that will be VK_TRUE if deviceLUID contains a valid LUID and deviceNodeMask contains a valid node mask, and VK_FALSE if they do not.

type VkExternalMemoryHandleTypeFlags = VkExternalMemoryHandleTypeFlagBits Source #

VkExternalMemoryHandleTypeFlags - Bitmask of VkExternalMemoryHandleTypeFlagBits

Description

VkExternalMemoryHandleTypeFlags is a bitmask type for setting a mask of zero or more VkExternalMemoryHandleTypeFlagBits.

See Also

VkExportMemoryAllocateInfo, VkExternalMemoryBufferCreateInfo, VkExternalMemoryHandleTypeFlagBits, VkExternalMemoryImageCreateInfo, VkExternalMemoryProperties

type VkExternalMemoryFeatureFlags = VkExternalMemoryFeatureFlagBits Source #

VkExternalMemoryFeatureFlags - Bitmask of VkExternalMemoryFeatureFlagBits

Description

VkExternalMemoryFeatureFlags is a bitmask type for setting a mask of zero or more VkExternalMemoryFeatureFlagBits.

See Also

VkExternalMemoryFeatureFlagBits, VkExternalMemoryProperties