vulkan-3.24.4: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Core10.Device

Synopsis

Documentation

createDevice Source #

Arguments

:: forall a io. (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io) 
=> PhysicalDevice

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

-> DeviceCreateInfo a

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

-> ("allocator" ::: Maybe AllocationCallbacks)

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

-> 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

withDevice :: forall a io r. (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io) => PhysicalDevice -> DeviceCreateInfo a -> Maybe AllocationCallbacks -> (io Device -> (Device -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createDevice and destroyDevice

To ensure that destroyDevice is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

destroyDevice Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device to destroy.

-> ("allocator" ::: Maybe AllocationCallbacks)

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

-> 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 that were created using that device as the first parameter of the corresponding vkCreate* or vkAllocate* command.

Note

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 must have been destroyed 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

data DeviceQueueCreateInfo (es :: [Type]) Source #

VkDeviceQueueCreateInfo - Structure specifying parameters of a newly created device queue

Valid Usage

Valid Usage (Implicit)

  • pNext must be NULL or a pointer to a valid instance of DeviceQueueGlobalPriorityCreateInfoKHR
  • The sType value of each struct in the pNext chain must be unique
  • flags must be a valid combination of DeviceQueueCreateFlagBits values
  • pQueuePriorities must be a valid pointer to an array of queueCount float values
  • queueCount must be greater than 0

See Also

VK_VERSION_1_0, DeviceCreateInfo, DeviceQueueCreateFlags, StructureType

Constructors

DeviceQueueCreateInfo 

Fields

  • next :: Chain es

    pNext is NULL or a pointer to a structure extending this structure.

  • flags :: DeviceQueueCreateFlags

    flags is a bitmask indicating behavior of the queues.

  • queueFamilyIndex :: Word32

    queueFamilyIndex is an unsigned integer indicating the index of the queue family in which to create the queues on this device. This index corresponds to the index of an element of the pQueueFamilyProperties array that was returned by getPhysicalDeviceQueueFamilyProperties.

  • queuePriorities :: Vector Float

    pQueuePriorities is a pointer to an array of queueCount normalized floating point values, specifying priorities of work that will be submitted to each created queue. See Queue Priority for more information.

Instances

Instances details
Extensible DeviceQueueCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.Device

Methods

extensibleTypeName :: String Source #

getNext :: forall (es :: [Type]). DeviceQueueCreateInfo es -> Chain es Source #

setNext :: forall (ds :: [Type]) (es :: [TYPE LiftedRep]). DeviceQueueCreateInfo ds -> Chain es -> DeviceQueueCreateInfo es Source #

extends :: forall e b proxy. Typeable e => proxy e -> (Extends DeviceQueueCreateInfo e => b) -> Maybe b Source #

Show (Chain es) => Show (DeviceQueueCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

(Extendss DeviceQueueCreateInfo es, PeekChain es) => FromCStruct (DeviceQueueCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

(Extendss DeviceQueueCreateInfo es, PokeChain es) => ToCStruct (DeviceQueueCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

es ~ ('[] :: [Type]) => Zero (DeviceQueueCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

data DeviceCreateInfo (es :: [Type]) Source #

VkDeviceCreateInfo - Structure specifying parameters of a newly created device

Valid Usage

  • The queueFamilyIndex member of each element of pQueueCreateInfos must be unique within pQueueCreateInfos, except that two members can share the same queueFamilyIndex if one describes protected-capable queues and one describes queues that are not protected-capable

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, DeviceCreateFlags, DeviceQueueCreateInfo, PhysicalDeviceFeatures, StructureType, createDevice

Constructors

DeviceCreateInfo 

Fields

Instances

Instances details
Extensible DeviceCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.Device

Methods

extensibleTypeName :: String Source #

getNext :: forall (es :: [Type]). DeviceCreateInfo es -> Chain es Source #

setNext :: forall (ds :: [Type]) (es :: [TYPE LiftedRep]). DeviceCreateInfo ds -> Chain es -> DeviceCreateInfo es Source #

extends :: forall e b proxy. Typeable e => proxy e -> (Extends DeviceCreateInfo e => b) -> Maybe b Source #

Show (Chain es) => Show (DeviceCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

(Extendss DeviceCreateInfo es, PeekChain es) => FromCStruct (DeviceCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

(Extendss DeviceCreateInfo es, PokeChain es) => ToCStruct (DeviceCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

es ~ ('[] :: [Type]) => Zero (DeviceCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

data Device Source #

VkDevice - Opaque handle to a device object

See Also

VK_VERSION_1_0, acquireFullScreenExclusiveModeEXT, acquireNextImage2KHR, acquireNextImageKHR, acquirePerformanceConfigurationINTEL, acquireProfilingLockKHR, allocateCommandBuffers, allocateDescriptorSets, allocateMemory, bindAccelerationStructureMemoryNV, bindBufferMemory, bindBufferMemory2, bindBufferMemory2KHR, bindImageMemory, bindImageMemory2, bindImageMemory2KHR, bindOpticalFlowSessionImageNV, vkBindVideoSessionMemoryKHR, buildAccelerationStructuresKHR, buildMicromapsEXT, compileDeferredNV, copyAccelerationStructureKHR, copyAccelerationStructureToMemoryKHR, copyMemoryToAccelerationStructureKHR, copyMemoryToMicromapEXT, copyMicromapEXT, copyMicromapToMemoryEXT, createAccelerationStructureKHR, createAccelerationStructureNV, createBuffer, createBufferCollectionFUCHSIA, createBufferView, createCommandPool, createComputePipelines, createCuFunctionNVX, createCuModuleNVX, createDeferredOperationKHR, createDescriptorPool, createDescriptorSetLayout, createDescriptorUpdateTemplate, createDescriptorUpdateTemplateKHR, createDevice, createEvent, createFence, createFramebuffer, createGraphicsPipelines, createImage, createImageView, createIndirectCommandsLayoutNV, createMicromapEXT, createOpticalFlowSessionNV, createPipelineCache, createPipelineLayout, createPrivateDataSlot, createPrivateDataSlotEXT, createQueryPool, createRayTracingPipelinesKHR, createRayTracingPipelinesNV, createRenderPass, createRenderPass2, createRenderPass2KHR, createSampler, createSamplerYcbcrConversion, createSamplerYcbcrConversionKHR, createSemaphore, createShaderModule, createSharedSwapchainsKHR, createSwapchainKHR, createValidationCacheEXT, vkCreateVideoSessionKHR, vkCreateVideoSessionParametersKHR, debugMarkerSetObjectNameEXT, debugMarkerSetObjectTagEXT, deferredOperationJoinKHR, destroyAccelerationStructureKHR, destroyAccelerationStructureNV, destroyBuffer, destroyBufferCollectionFUCHSIA, destroyBufferView, destroyCommandPool, destroyCuFunctionNVX, destroyCuModuleNVX, destroyDeferredOperationKHR, destroyDescriptorPool, destroyDescriptorSetLayout, destroyDescriptorUpdateTemplate, destroyDescriptorUpdateTemplateKHR, destroyDevice, destroyEvent, destroyFence, destroyFramebuffer, destroyImage, destroyImageView, destroyIndirectCommandsLayoutNV, destroyMicromapEXT, destroyOpticalFlowSessionNV, destroyPipeline, destroyPipelineCache, destroyPipelineLayout, destroyPrivateDataSlot, destroyPrivateDataSlotEXT, destroyQueryPool, destroyRenderPass, destroySampler, destroySamplerYcbcrConversion, destroySamplerYcbcrConversionKHR, destroySemaphore, destroyShaderModule, destroySwapchainKHR, destroyValidationCacheEXT, vkDestroyVideoSessionKHR, vkDestroyVideoSessionParametersKHR, deviceWaitIdle, displayPowerControlEXT, exportMetalObjectsEXT, flushMappedMemoryRanges, freeCommandBuffers, freeDescriptorSets, freeMemory, getAccelerationStructureBuildSizesKHR, getAccelerationStructureDeviceAddressKHR, getAccelerationStructureHandleNV, getAccelerationStructureMemoryRequirementsNV, getAccelerationStructureOpaqueCaptureDescriptorDataEXT, getAndroidHardwareBufferPropertiesANDROID, getBufferCollectionPropertiesFUCHSIA, getBufferDeviceAddress, getBufferDeviceAddressEXT, getBufferDeviceAddressKHR, getBufferMemoryRequirements, getBufferMemoryRequirements2, getBufferMemoryRequirements2KHR, getBufferOpaqueCaptureAddress, getBufferOpaqueCaptureAddressKHR, getBufferOpaqueCaptureDescriptorDataEXT, getCalibratedTimestampsEXT, getDeferredOperationMaxConcurrencyKHR, getDeferredOperationResultKHR, getDescriptorEXT, getDescriptorSetHostMappingVALVE, getDescriptorSetLayoutBindingOffsetEXT, getDescriptorSetLayoutHostMappingInfoVALVE, getDescriptorSetLayoutSizeEXT, getDescriptorSetLayoutSupport, getDescriptorSetLayoutSupportKHR, getDeviceAccelerationStructureCompatibilityKHR, getDeviceBufferMemoryRequirements, getDeviceBufferMemoryRequirementsKHR, getDeviceFaultInfoEXT, getDeviceGroupPeerMemoryFeatures, getDeviceGroupPeerMemoryFeaturesKHR, getDeviceGroupPresentCapabilitiesKHR, getDeviceGroupSurfacePresentModes2EXT, getDeviceGroupSurfacePresentModesKHR, getDeviceImageMemoryRequirements, getDeviceImageMemoryRequirementsKHR, getDeviceImageSparseMemoryRequirements, getDeviceImageSparseMemoryRequirementsKHR, getDeviceMemoryCommitment, getDeviceMemoryOpaqueCaptureAddress, getDeviceMemoryOpaqueCaptureAddressKHR, getDeviceMicromapCompatibilityEXT, getDeviceProcAddr, getDeviceQueue, getDeviceQueue2, getDeviceSubpassShadingMaxWorkgroupSizeHUAWEI, getDynamicRenderingTilePropertiesQCOM, getEventStatus, getFenceFdKHR, getFenceStatus, getFenceWin32HandleKHR, getFramebufferTilePropertiesQCOM, getGeneratedCommandsMemoryRequirementsNV, getImageDrmFormatModifierPropertiesEXT, getImageMemoryRequirements, getImageMemoryRequirements2, getImageMemoryRequirements2KHR, getImageOpaqueCaptureDescriptorDataEXT, getImageSparseMemoryRequirements, getImageSparseMemoryRequirements2, getImageSparseMemoryRequirements2KHR, getImageSubresourceLayout, getImageSubresourceLayout2EXT, getImageViewAddressNVX, getImageViewHandleNVX, getImageViewOpaqueCaptureDescriptorDataEXT, getMemoryAndroidHardwareBufferANDROID, getMemoryFdKHR, getMemoryFdPropertiesKHR, getMemoryHostPointerPropertiesEXT, getMemoryRemoteAddressNV, getMemoryWin32HandleKHR, getMemoryWin32HandleNV, getMemoryWin32HandlePropertiesKHR, getMemoryZirconHandleFUCHSIA, getMemoryZirconHandlePropertiesFUCHSIA, getMicromapBuildSizesEXT, getPastPresentationTimingGOOGLE, getPerformanceParameterINTEL, getPipelineCacheData, getPipelineExecutableInternalRepresentationsKHR, getPipelineExecutablePropertiesKHR, getPipelineExecutableStatisticsKHR, getPipelinePropertiesEXT, getPrivateData, getPrivateDataEXT, getQueryPoolResults, getRayTracingCaptureReplayShaderGroupHandlesKHR, getRayTracingShaderGroupHandlesKHR, getRayTracingShaderGroupHandlesNV, getRayTracingShaderGroupStackSizeKHR, getRefreshCycleDurationGOOGLE, getRenderAreaGranularity, getSamplerOpaqueCaptureDescriptorDataEXT, getSemaphoreCounterValue, getSemaphoreCounterValueKHR, getSemaphoreFdKHR, getSemaphoreWin32HandleKHR, getSemaphoreZirconHandleFUCHSIA, getShaderInfoAMD, getShaderModuleCreateInfoIdentifierEXT, getShaderModuleIdentifierEXT, getSwapchainCounterEXT, getSwapchainImagesKHR, getSwapchainStatusKHR, getValidationCacheDataEXT, vkGetVideoSessionMemoryRequirementsKHR, importFenceFdKHR, importFenceWin32HandleKHR, importSemaphoreFdKHR, importSemaphoreWin32HandleKHR, importSemaphoreZirconHandleFUCHSIA, initializePerformanceApiINTEL, invalidateMappedMemoryRanges, mapMemory, mergePipelineCaches, mergeValidationCachesEXT, registerDeviceEventEXT, registerDisplayEventEXT, releaseFullScreenExclusiveModeEXT, releasePerformanceConfigurationINTEL, releaseProfilingLockKHR, releaseSwapchainImagesEXT, resetCommandPool, resetDescriptorPool, resetEvent, resetFences, resetQueryPool, resetQueryPoolEXT, setBufferCollectionBufferConstraintsFUCHSIA, setBufferCollectionImageConstraintsFUCHSIA, setDebugUtilsObjectNameEXT, setDebugUtilsObjectTagEXT, setDeviceMemoryPriorityEXT, setEvent, setHdrMetadataEXT, setLocalDimmingAMD, setPrivateData, setPrivateDataEXT, signalSemaphore, signalSemaphoreKHR, trimCommandPool, trimCommandPoolKHR, uninitializePerformanceApiINTEL, unmapMemory, updateDescriptorSetWithTemplate, updateDescriptorSetWithTemplateKHR, updateDescriptorSets, vkUpdateVideoSessionParametersKHR, waitForFences, waitForPresentKHR, waitSemaphores, waitSemaphoresKHR, writeAccelerationStructuresPropertiesKHR, writeMicromapsPropertiesEXT

Constructors

Device 

Instances

Instances details
Show Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Eq Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

(==) :: Device -> Device -> Bool #

(/=) :: Device -> Device -> Bool #

HasObjectType Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

IsHandle Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Zero Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

zero :: Device Source #

newtype DeviceCreateFlags Source #

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

Constructors

DeviceCreateFlags Flags 

Instances

Instances details
Storable DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Bits DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

FiniteBits DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Read DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Show DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Eq DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Ord DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Zero DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

newtype DeviceQueueCreateFlagBits Source #

VkDeviceQueueCreateFlagBits - Bitmask specifying behavior of the queue

See Also

VK_VERSION_1_1, DeviceQueueCreateFlags

Bundled Patterns

pattern DEVICE_QUEUE_CREATE_PROTECTED_BIT :: DeviceQueueCreateFlagBits

DEVICE_QUEUE_CREATE_PROTECTED_BIT specifies that the device queue is a protected-capable queue.

Instances

Instances details
Storable DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Bits DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Methods

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

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

xor :: DeviceQueueCreateFlagBits -> DeviceQueueCreateFlagBits -> DeviceQueueCreateFlagBits #

complement :: DeviceQueueCreateFlagBits -> DeviceQueueCreateFlagBits #

shift :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

rotate :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

zeroBits :: DeviceQueueCreateFlagBits #

bit :: Int -> DeviceQueueCreateFlagBits #

setBit :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

clearBit :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

complementBit :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

testBit :: DeviceQueueCreateFlagBits -> Int -> Bool #

bitSizeMaybe :: DeviceQueueCreateFlagBits -> Maybe Int #

bitSize :: DeviceQueueCreateFlagBits -> Int #

isSigned :: DeviceQueueCreateFlagBits -> Bool #

shiftL :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

unsafeShiftL :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

shiftR :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

unsafeShiftR :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

rotateL :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

rotateR :: DeviceQueueCreateFlagBits -> Int -> DeviceQueueCreateFlagBits #

popCount :: DeviceQueueCreateFlagBits -> Int #

FiniteBits DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Read DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Show DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Eq DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Ord DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Zero DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits