HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Core10.Device

  • 6 types
  • 3 values
  • Packagevulkan-3.27
  • Exports11
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceDevice.hs
valuecreateDevice
  1. :: (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io)
  2. => PhysicalDevice

    physicalDevice must be one of the device handles returned from a call to enumeratePhysicalDevices (see Physical Device Enumeration).

  3. -> DeviceCreateInfo a

    pCreateInfo is a pointer to a DeviceCreateInfo structure containing information about how to create the device.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io Device
#

vkCreateDevice - Create a new device instance

Description

createDevice verifies that extensions and features requested in the ppEnabledExtensionNames and pEnabledFeatures members of pCreateInfo, respectively, are supported by the implementation. If any requested extension is not supported, createDevice must return ERROR_EXTENSION_NOT_PRESENT. If any requested feature is not supported, createDevice must return ERROR_FEATURE_NOT_PRESENT. Support for extensions can be checked before creating a device by querying enumerateDeviceExtensionProperties. Support for features can similarly be checked by querying getPhysicalDeviceFeatures.

After verifying and enabling the extensions the Device object is created and returned to the application.

Multiple logical devices can be created from the same physical device. Logical device creation may fail due to lack of device-specific resources (in addition to other errors). If that occurs, createDevice will return ERROR_TOO_MANY_OBJECTS.

Valid Usage

Valid Usage (Implicit)

  • pCreateInfo must be a valid pointer to a valid DeviceCreateInfo structure

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • pDevice must be a valid pointer to a Device handle

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, DeviceCreateInfo, PhysicalDevice

valuedestroyDevice
  1. :: MonadIO io
  2. => Device

    device is the logical device to destroy.

  3. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  4. -> io ()
#

vkDestroyDevice - Destroy a logical device

Description

To ensure that no work is active on the device, deviceWaitIdle can be used to gate the destruction of the device. Prior to destroying a device, an application is responsible for destroying/freeing any Vulkan objects with explicit vkDestroy* or vkFree* commands that were created using that device as the first parameter of the corresponding vkCreate* or vkAllocate* command.

The lifetime of each of these objects is bound by the lifetime of the Device object. Therefore, to avoid resource leaks, it is critical that an application explicitly free all of these resources prior to calling destroyDevice.

Valid Usage

  • All child objects created on device that can be destroyed or freed must have been destroyed or freed prior to destroying device

  • If AllocationCallbacks were provided when device was created, a compatible set of callbacks must be provided here

  • If no AllocationCallbacks were provided when device was created, pAllocator must be NULL

Valid Usage (Implicit)

  • If device is not NULL, device must be a valid Device handle

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

Host Synchronization

  • Host access to device must be externally synchronized

  • Host access to all Queue objects created from device must be externally synchronized

See Also

VK_VERSION_1_0, AllocationCallbacks, Device

datadata DeviceQueueCreateInfo (es :: [Type])
#

VkDeviceQueueCreateInfo - Structure specifying parameters of a newly created device queue

Description

Some queue families support functionality which requires a device feature or extension to be enabled, as indicated by the QueueFamilyProperties::queueFlags member. Applications may create such queues and submit queue submission commands to them without enabling the corresponding feature or extension, but must not utilize the specific functionality that they did not enable.

For example, sparse memory management operations can be performed on queues from queue families exposing the QUEUE_SPARSE_BINDING_BIT bit, provided the sparseBinding feature is enabled. If a queue family supports both the QUEUE_SPARSE_BINDING_BIT and QUEUE_TRANSFER_BIT bits, applications may create a queue from this family and issue transfer operations without enabling the sparseBinding feature.

Valid Usage

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, DeviceCreateInfo, DeviceQueueCreateFlags, StructureType

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
datadata DeviceCreateInfo (es :: [Type])
#

VkDeviceCreateInfo - Structure specifying parameters of a newly created device

Valid Usage

  • The combination of the values in the queueFamilyIndex and flags members of each element of pQueueCreateInfos must be unique within pQueueCreateInfos

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, DeviceCreateFlags, DeviceQueueCreateInfo, PhysicalDeviceFeatures, StructureType, createDevice

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
datadata Device
#

VkDevice - Opaque handle to a device object

See Also

VK_DEFINE_HANDLE, VK_VERSION_1_0, acquireFullScreenExclusiveModeEXT, acquireNextImage2KHR, acquireNextImageKHR, acquirePerformanceConfigurationINTEL, acquireProfilingLockKHR, allocateCommandBuffers, allocateDescriptorSets, allocateMemory, antiLagUpdateAMD, bindAccelerationStructureMemoryNV, bindBufferMemory, bindBufferMemory2, bindBufferMemory2, bindDataGraphPipelineSessionMemoryARM, bindImageMemory, bindImageMemory2, bindImageMemory2, bindOpticalFlowSessionImageNV, bindTensorMemoryARM, vkBindVideoSessionMemoryKHR, buildAccelerationStructuresKHR, buildMicromapsEXT, clearShaderInstrumentationMetricsARM, compileDeferredNV, convertCooperativeVectorMatrixNV, copyAccelerationStructureKHR, copyAccelerationStructureToMemoryKHR, copyImageToImage, copyImageToImage, copyImageToMemory, copyImageToMemory, copyMemoryToAccelerationStructureKHR, copyMemoryToImage, copyMemoryToImage, copyMemoryToMicromapEXT, copyMicromapEXT, copyMicromapToMemoryEXT, createAccelerationStructure2KHR, createAccelerationStructureKHR, createAccelerationStructureNV, createBuffer, createBufferCollectionFUCHSIA, createBufferView, createCommandPool, createComputePipelines, createCuFunctionNVX, createCuModuleNVX, createCudaFunctionNV, createCudaModuleNV, createDataGraphPipelineSessionARM, createDataGraphPipelinesARM, createDeferredOperationKHR, createDescriptorPool, createDescriptorSetLayout, createDescriptorUpdateTemplate, createDescriptorUpdateTemplate, createDevice, createEvent, createExecutionGraphPipelinesAMDX, createExternalComputeQueueNV, createFence, createFramebuffer, createGpaSessionAMD, createGraphicsPipelines, createImage, createImageView, createIndirectCommandsLayoutEXT, createIndirectCommandsLayoutNV, createIndirectExecutionSetEXT, createMicromapEXT, createOpticalFlowSessionNV, createPipelineBinariesKHR, createPipelineCache, createPipelineLayout, createPrivateDataSlot, createPrivateDataSlot, createQueryPool, createRayTracingPipelinesKHR, createRayTracingPipelinesNV, createRenderPass, createRenderPass2, createRenderPass2, createSampler, createSamplerYcbcrConversion, createSamplerYcbcrConversion, createSemaphore, createShaderInstrumentationARM, createShaderModule, createShadersEXT, createSharedSwapchainsKHR, createSwapchainKHR, createTensorARM, createTensorViewARM, createValidationCacheEXT, vkCreateVideoSessionKHR, vkCreateVideoSessionParametersKHR, debugMarkerSetObjectNameEXT, debugMarkerSetObjectTagEXT, deferredOperationJoinKHR, destroyAccelerationStructureKHR, destroyAccelerationStructureNV, destroyBuffer, destroyBufferCollectionFUCHSIA, destroyBufferView, destroyCommandPool, destroyCuFunctionNVX, destroyCuModuleNVX, destroyCudaFunctionNV, destroyCudaModuleNV, destroyDataGraphPipelineSessionARM, destroyDeferredOperationKHR, destroyDescriptorPool, destroyDescriptorSetLayout, destroyDescriptorUpdateTemplate, destroyDescriptorUpdateTemplate, destroyDevice, destroyEvent, destroyExternalComputeQueueNV, destroyFence, destroyFramebuffer, destroyGpaSessionAMD, destroyImage, destroyImageView, destroyIndirectCommandsLayoutEXT, destroyIndirectCommandsLayoutNV, destroyIndirectExecutionSetEXT, destroyMicromapEXT, destroyOpticalFlowSessionNV, destroyPipeline, destroyPipelineBinaryKHR, destroyPipelineCache, destroyPipelineLayout, destroyPrivateDataSlot, destroyPrivateDataSlot, destroyQueryPool, destroyRenderPass, destroySampler, destroySamplerYcbcrConversion, destroySamplerYcbcrConversion, destroySemaphore, destroyShaderEXT, destroyShaderInstrumentationARM, destroyShaderModule, destroySwapchainKHR, destroyTensorARM, destroyTensorViewARM, destroyValidationCacheEXT, vkDestroyVideoSessionKHR, vkDestroyVideoSessionParametersKHR, deviceWaitIdle, displayPowerControlEXT, exportMetalObjectsEXT, flushMappedMemoryRanges, freeCommandBuffers, freeDescriptorSets, freeMemory, getAccelerationStructureBuildSizesKHR, getAccelerationStructureDeviceAddressKHR, getAccelerationStructureHandleNV, getAccelerationStructureMemoryRequirementsNV, getAccelerationStructureOpaqueCaptureDescriptorDataEXT, getAndroidHardwareBufferPropertiesANDROID, getBufferCollectionPropertiesFUCHSIA, getBufferDeviceAddress, getBufferDeviceAddress, getBufferDeviceAddress, getBufferMemoryRequirements, getBufferMemoryRequirements2, getBufferMemoryRequirements2, getBufferOpaqueCaptureAddress, getBufferOpaqueCaptureAddress, getBufferOpaqueCaptureDescriptorDataEXT, getCalibratedTimestampsKHR, getCalibratedTimestampsKHR, vkGetClusterAccelerationStructureBuildSizesNV, getCudaModuleCacheNV, getDataGraphPipelineAvailablePropertiesARM, getDataGraphPipelinePropertiesARM, getDataGraphPipelineSessionBindPointRequirementsARM, getDataGraphPipelineSessionMemoryRequirementsARM, getDeferredOperationMaxConcurrencyKHR, getDeferredOperationResultKHR, getDescriptorEXT, getDescriptorSetHostMappingVALVE, getDescriptorSetLayoutBindingOffsetEXT, getDescriptorSetLayoutHostMappingInfoVALVE, getDescriptorSetLayoutSizeEXT, getDescriptorSetLayoutSupport, getDescriptorSetLayoutSupport, getDeviceAccelerationStructureCompatibilityKHR, getDeviceBufferMemoryRequirements, getDeviceBufferMemoryRequirements, getDeviceCombinedImageSamplerIndexNVX, getDeviceFaultDebugInfoKHR, getDeviceFaultInfoEXT, getDeviceFaultReportsKHR, getDeviceGroupPeerMemoryFeatures, getDeviceGroupPeerMemoryFeatures, getDeviceGroupPresentCapabilitiesKHR, getDeviceGroupSurfacePresentModes2EXT, getDeviceGroupSurfacePresentModesKHR, getDeviceImageMemoryRequirements, getDeviceImageMemoryRequirements, getDeviceImageSparseMemoryRequirements, getDeviceImageSparseMemoryRequirements, getDeviceImageSubresourceLayout, getDeviceImageSubresourceLayout, getDeviceMemoryCommitment, getDeviceMemoryOpaqueCaptureAddress, getDeviceMemoryOpaqueCaptureAddress, getDeviceMicromapCompatibilityEXT, getDeviceProcAddr, getDeviceQueue, getDeviceQueue2, getDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, getDeviceTensorMemoryRequirementsARM, getDynamicRenderingTilePropertiesQCOM, vkGetEncodedVideoSessionParametersKHR, getEventStatus, getExecutionGraphPipelineNodeIndexAMDX, getExecutionGraphPipelineScratchSizeAMDX, getFenceFdKHR, getFenceStatus, getFenceWin32HandleKHR, getFramebufferTilePropertiesQCOM, getGeneratedCommandsMemoryRequirementsEXT, getGeneratedCommandsMemoryRequirementsNV, getGpaDeviceClockInfoAMD, getGpaSessionResultsAMD, getGpaSessionStatusAMD, getImageDrmFormatModifierPropertiesEXT, getImageMemoryRequirements, getImageMemoryRequirements2, getImageMemoryRequirements2, getImageOpaqueCaptureDataEXT, getImageOpaqueCaptureDescriptorDataEXT, getImageSparseMemoryRequirements, getImageSparseMemoryRequirements2, getImageSparseMemoryRequirements2, getImageSubresourceLayout, getImageSubresourceLayout2, getImageSubresourceLayout2, getImageSubresourceLayout2, getImageViewAddressNVX, getImageViewHandle64NVX, getImageViewHandleNVX, getImageViewOpaqueCaptureDescriptorDataEXT, getLatencyTimingsNV, getMemoryAndroidHardwareBufferANDROID, getMemoryFdKHR, getMemoryFdPropertiesKHR, getMemoryHostPointerPropertiesEXT, getMemoryMetalHandleEXT, getMemoryMetalHandlePropertiesEXT, vkGetMemoryNativeBufferOHOS, getMemoryRemoteAddressNV, getMemoryWin32HandleKHR, getMemoryWin32HandleNV, getMemoryWin32HandlePropertiesKHR, getMemoryZirconHandleFUCHSIA, getMemoryZirconHandlePropertiesFUCHSIA, getMicromapBuildSizesEXT, vkGetNativeBufferPropertiesOHOS, vkGetPartitionedAccelerationStructuresBuildSizesNV, getPastPresentationTimingEXT, getPastPresentationTimingGOOGLE, getPerformanceParameterINTEL, getPipelineBinaryDataKHR, getPipelineCacheData, getPipelineExecutableInternalRepresentationsKHR, getPipelineExecutablePropertiesKHR, getPipelineExecutableStatisticsKHR, getPipelineIndirectDeviceAddressNV, getPipelineIndirectMemoryRequirementsNV, getPipelineKeyKHR, getPipelinePropertiesEXT, getPrivateData, getPrivateData, getQueryPoolResults, getRayTracingCaptureReplayShaderGroupHandlesKHR, getRayTracingShaderGroupHandlesKHR, getRayTracingShaderGroupHandlesKHR, getRayTracingShaderGroupStackSizeKHR, getRefreshCycleDurationGOOGLE, getRenderAreaGranularity, getRenderingAreaGranularity, getRenderingAreaGranularity, getSamplerOpaqueCaptureDescriptorDataEXT, getScreenBufferPropertiesQNX, getSemaphoreCounterValue, getSemaphoreCounterValue, getSemaphoreFdKHR, getSemaphoreWin32HandleKHR, getSemaphoreZirconHandleFUCHSIA, getShaderBinaryDataEXT, getShaderInfoAMD, getShaderInstrumentationValuesARM, getShaderModuleCreateInfoIdentifierEXT, getShaderModuleIdentifierEXT, getSwapchainCounterEXT, getSwapchainImagesKHR, getSwapchainStatusKHR, getSwapchainTimeDomainPropertiesEXT, getSwapchainTimingPropertiesEXT, getTensorMemoryRequirementsARM, getTensorOpaqueCaptureDataARM, getTensorOpaqueCaptureDescriptorDataARM, getTensorViewOpaqueCaptureDescriptorDataARM, getValidationCacheDataEXT, vkGetVideoSessionMemoryRequirementsKHR, importFenceFdKHR, importFenceWin32HandleKHR, importSemaphoreFdKHR, importSemaphoreWin32HandleKHR, importSemaphoreZirconHandleFUCHSIA, initializePerformanceApiINTEL, invalidateMappedMemoryRanges, latencySleepNV, mapMemory, mapMemory2, mapMemory2, mergePipelineCaches, mergeValidationCachesEXT, registerCustomBorderColorEXT, registerDeviceEventEXT, registerDisplayEventEXT, releaseCapturedPipelineDataKHR, releaseFullScreenExclusiveModeEXT, releasePerformanceConfigurationINTEL, releaseProfilingLockKHR, releaseSwapchainImagesKHR, releaseSwapchainImagesKHR, resetCommandPool, resetDescriptorPool, resetEvent, resetFences, resetGpaSessionAMD, resetQueryPool, resetQueryPool, setBufferCollectionBufferConstraintsFUCHSIA, setBufferCollectionImageConstraintsFUCHSIA, setDebugUtilsObjectNameEXT, setDebugUtilsObjectTagEXT, setDeviceMemoryPriorityEXT, setEvent, setGpaDeviceClockModeAMD, setHdrMetadataEXT, setLatencyMarkerNV, setLatencySleepModeNV, setLocalDimmingAMD, setPrivateData, setPrivateData, setSwapchainPresentTimingQueueSizeEXT, signalSemaphore, signalSemaphore, transitionImageLayout, transitionImageLayout, trimCommandPool, trimCommandPool, uninitializePerformanceApiINTEL, unmapMemory, unmapMemory2, unmapMemory2, unregisterCustomBorderColorEXT, updateDescriptorSetWithTemplate, updateDescriptorSetWithTemplate, updateDescriptorSets, updateIndirectExecutionSetPipelineEXT, updateIndirectExecutionSetShaderEXT, vkUpdateVideoSessionParametersKHR, waitForFences, waitForPresent2KHR, waitForPresentKHR, waitSemaphores, waitSemaphores, writeAccelerationStructuresPropertiesKHR, writeMicromapsPropertiesEXT, writeResourceDescriptorsEXT, writeSamplerDescriptorsEXT

Instances5Eq, Show, HasObjectType, IsHandle, Zero
newtypenewtype DeviceCreateFlags
#

VkDeviceCreateFlags - Reserved for future use

Description

DeviceCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VK_VERSION_1_0, DeviceCreateInfo, Flags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …
newtypenewtype DeviceQueueCreateFlagBits
#

VkDeviceQueueCreateFlagBits - Bitmask specifying behavior of the queue

Description

See Also

VK_VERSION_1_1, DeviceQueueCreateFlags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …