vulkan-3.8.1: Bindings to the Vulkan graphics API.
Safe HaskellNone
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 the 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

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 received from device must be externally synchronized

See Also

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

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

  • queueFamilyIndex :: Word32

    queueFamilyIndex is an unsigned integer indicating the index of the queue family to create 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]). 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 is a protected-capable queue and one is not a protected-capable queue

Valid Usage (Implicit)

See Also

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]). 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

acquireFullScreenExclusiveModeEXT, acquireNextImage2KHR, acquireNextImageKHR, acquirePerformanceConfigurationINTEL, acquireProfilingLockKHR, allocateCommandBuffers, allocateDescriptorSets, allocateMemory, bindAccelerationStructureMemoryNV, bindBufferMemory, bindBufferMemory2, bindBufferMemory2KHR, bindImageMemory, bindImageMemory2, bindImageMemory2KHR, buildAccelerationStructuresKHR, compileDeferredNV, copyAccelerationStructureKHR, copyAccelerationStructureToMemoryKHR, copyMemoryToAccelerationStructureKHR, createAccelerationStructureKHR, createAccelerationStructureNV, createBuffer, createBufferView, createCommandPool, createComputePipelines, createDeferredOperationKHR, createDescriptorPool, createDescriptorSetLayout, createDescriptorUpdateTemplate, createDescriptorUpdateTemplateKHR, createDevice, createEvent, createFence, createFramebuffer, createGraphicsPipelines, createImage, createImageView, createIndirectCommandsLayoutNV, createPipelineCache, createPipelineLayout, createPrivateDataSlotEXT, createQueryPool, createRayTracingPipelinesKHR, createRayTracingPipelinesNV, createRenderPass, createRenderPass2, createRenderPass2KHR, createSampler, createSamplerYcbcrConversion, createSamplerYcbcrConversionKHR, createSemaphore, createShaderModule, createSharedSwapchainsKHR, createSwapchainKHR, createValidationCacheEXT, debugMarkerSetObjectNameEXT, debugMarkerSetObjectTagEXT, deferredOperationJoinKHR, destroyAccelerationStructureKHR, destroyAccelerationStructureNV, destroyBuffer, destroyBufferView, destroyCommandPool, destroyDeferredOperationKHR, destroyDescriptorPool, destroyDescriptorSetLayout, destroyDescriptorUpdateTemplate, destroyDescriptorUpdateTemplateKHR, destroyDevice, destroyEvent, destroyFence, destroyFramebuffer, destroyImage, destroyImageView, destroyIndirectCommandsLayoutNV, destroyPipeline, destroyPipelineCache, destroyPipelineLayout, destroyPrivateDataSlotEXT, destroyQueryPool, destroyRenderPass, destroySampler, destroySamplerYcbcrConversion, destroySamplerYcbcrConversionKHR, destroySemaphore, destroyShaderModule, destroySwapchainKHR, destroyValidationCacheEXT, deviceWaitIdle, displayPowerControlEXT, flushMappedMemoryRanges, freeCommandBuffers, freeDescriptorSets, freeMemory, getAccelerationStructureBuildSizesKHR, getAccelerationStructureDeviceAddressKHR, getAccelerationStructureHandleNV, getAccelerationStructureMemoryRequirementsNV, getAndroidHardwareBufferPropertiesANDROID, getBufferDeviceAddress, getBufferDeviceAddressEXT, getBufferDeviceAddressKHR, getBufferMemoryRequirements, getBufferMemoryRequirements2, getBufferMemoryRequirements2KHR, getBufferOpaqueCaptureAddress, getBufferOpaqueCaptureAddressKHR, getCalibratedTimestampsEXT, getDeferredOperationMaxConcurrencyKHR, getDeferredOperationResultKHR, getDescriptorSetLayoutSupport, getDescriptorSetLayoutSupportKHR, getDeviceAccelerationStructureCompatibilityKHR, getDeviceGroupPeerMemoryFeatures, getDeviceGroupPeerMemoryFeaturesKHR, getDeviceGroupPresentCapabilitiesKHR, getDeviceGroupSurfacePresentModes2EXT, getDeviceGroupSurfacePresentModesKHR, getDeviceMemoryCommitment, getDeviceMemoryOpaqueCaptureAddress, getDeviceMemoryOpaqueCaptureAddressKHR, getDeviceProcAddr, getDeviceQueue, getDeviceQueue2, getEventStatus, getFenceFdKHR, getFenceStatus, getFenceWin32HandleKHR, getGeneratedCommandsMemoryRequirementsNV, getImageDrmFormatModifierPropertiesEXT, getImageMemoryRequirements, getImageMemoryRequirements2, getImageMemoryRequirements2KHR, getImageSparseMemoryRequirements, getImageSparseMemoryRequirements2, getImageSparseMemoryRequirements2KHR, getImageSubresourceLayout, getImageViewAddressNVX, getImageViewHandleNVX, getMemoryAndroidHardwareBufferANDROID, getMemoryFdKHR, getMemoryFdPropertiesKHR, getMemoryHostPointerPropertiesEXT, getMemoryWin32HandleKHR, getMemoryWin32HandleNV, getMemoryWin32HandlePropertiesKHR, getPastPresentationTimingGOOGLE, getPerformanceParameterINTEL, getPipelineCacheData, getPipelineExecutableInternalRepresentationsKHR, getPipelineExecutablePropertiesKHR, getPipelineExecutableStatisticsKHR, getPrivateDataEXT, getQueryPoolResults, getRayTracingCaptureReplayShaderGroupHandlesKHR, getRayTracingShaderGroupHandlesKHR, getRayTracingShaderGroupHandlesNV, getRayTracingShaderGroupStackSizeKHR, getRefreshCycleDurationGOOGLE, getRenderAreaGranularity, getSemaphoreCounterValue, getSemaphoreCounterValueKHR, getSemaphoreFdKHR, getSemaphoreWin32HandleKHR, getShaderInfoAMD, getSwapchainCounterEXT, getSwapchainImagesKHR, getSwapchainStatusKHR, getValidationCacheDataEXT, importFenceFdKHR, importFenceWin32HandleKHR, importSemaphoreFdKHR, importSemaphoreWin32HandleKHR, initializePerformanceApiINTEL, invalidateMappedMemoryRanges, mapMemory, mergePipelineCaches, mergeValidationCachesEXT, registerDeviceEventEXT, registerDisplayEventEXT, releaseFullScreenExclusiveModeEXT, releasePerformanceConfigurationINTEL, releaseProfilingLockKHR, resetCommandPool, resetDescriptorPool, resetEvent, resetFences, resetQueryPool, resetQueryPoolEXT, setDebugUtilsObjectNameEXT, setDebugUtilsObjectTagEXT, setEvent, setHdrMetadataEXT, setLocalDimmingAMD, setPrivateDataEXT, signalSemaphore, signalSemaphoreKHR, trimCommandPool, trimCommandPoolKHR, uninitializePerformanceApiINTEL, unmapMemory, updateDescriptorSetWithTemplate, updateDescriptorSetWithTemplateKHR, updateDescriptorSets, waitForFences, waitSemaphores, waitSemaphoresKHR, writeAccelerationStructuresPropertiesKHR

Constructors

Device 

Instances

Instances details
Eq Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

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

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

Show Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Zero Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

zero :: Device Source #

HasObjectType Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

IsHandle Device Source # 
Instance details

Defined in Vulkan.Core10.Handles

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

DeviceCreateInfo

Constructors

DeviceCreateFlags Flags 

Instances

Instances details
Eq DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

Ord 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

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

Zero DeviceCreateFlags Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceCreateFlags

newtype DeviceQueueCreateFlagBits Source #

VkDeviceQueueCreateFlagBits - Bitmask specifying behavior of the queue

See Also

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
Eq DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits

Ord 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

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

Zero DeviceQueueCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.DeviceQueueCreateFlagBits