Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- createDevice :: forall a io. (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io) => PhysicalDevice -> DeviceCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Device
- withDevice :: forall a io r. (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io) => PhysicalDevice -> DeviceCreateInfo a -> Maybe AllocationCallbacks -> (io Device -> (Device -> io ()) -> r) -> r
- destroyDevice :: forall io. MonadIO io => Device -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data DeviceQueueCreateInfo (es :: [Type]) = DeviceQueueCreateInfo {}
- data DeviceCreateInfo (es :: [Type]) = DeviceCreateInfo {}
Documentation
:: forall a io. (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io) | |
=> PhysicalDevice |
|
-> DeviceCreateInfo a |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> 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. If a requested extension is only supported by a layer, both
the layer and the extension need to be specified at
createInstance
time for the
creation to succeed.
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
- All
required extensions
for each extension in the
DeviceCreateInfo
::ppEnabledExtensionNames
list must also be present in that list
Valid Usage (Implicit)
physicalDevice
must be a validPhysicalDevice
handle
pCreateInfo
must be a valid pointer to a validDeviceCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure pDevice
must be a valid pointer to aDevice
handle
Return Codes
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 first argument.
To just extract the pair pass (,)
as the first argument.
:: forall io. MonadIO io | |
=> Device |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> 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 destroyingdevice
- If
AllocationCallbacks
were provided whendevice
was created, a compatible set of callbacks must be provided here - If no
AllocationCallbacks
were provided whendevice
was created,pAllocator
must beNULL
Valid Usage (Implicit)
- If
device
is notNULL
,device
must be a validDevice
handle
- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure
Host Synchronization
- Host access to
device
must be externally synchronized
- Host access to all
Queue
objects received fromdevice
must be externally synchronized
See Also
data DeviceQueueCreateInfo (es :: [Type]) Source #
VkDeviceQueueCreateInfo - Structure specifying parameters of a newly created device queue
Valid Usage
queueFamilyIndex
must be less thanpQueueFamilyPropertyCount
returned bygetPhysicalDeviceQueueFamilyProperties
queueCount
must be less than or equal to thequeueCount
member of theQueueFamilyProperties
structure, as returned bygetPhysicalDeviceQueueFamilyProperties
in thepQueueFamilyProperties
[queueFamilyIndex]- Each element of
pQueuePriorities
must be between0.0
and1.0
inclusive - If the
protected memory
feature is not enabled, the
DEVICE_QUEUE_CREATE_PROTECTED_BIT
bit offlags
must not be set
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
pNext
must beNULL
or a pointer to a valid instance ofDeviceQueueGlobalPriorityCreateInfoEXT
- The
sType
value of each struct in thepNext
chain must be unique flags
must be a valid combination ofDeviceQueueCreateFlagBits
valuespQueuePriorities
must be a valid pointer to an array ofqueueCount
float
valuesqueueCount
must be greater than0
See Also
DeviceQueueCreateInfo | |
|
Instances
data DeviceCreateInfo (es :: [Type]) Source #
VkDeviceCreateInfo - Structure specifying parameters of a newly created device
Valid Usage
- The
queueFamilyIndex
member of each element ofpQueueCreateInfos
must be unique withinpQueueCreateInfos
, except that two members can share the samequeueFamilyIndex
if one is a protected-capable queue and one is not a protected-capable queue
- If the
pNext
chain includes aPhysicalDeviceFeatures2
structure, thenpEnabledFeatures
must beNULL
ppEnabledExtensionNames
must not containVK_AMD_negative_viewport_height
ppEnabledExtensionNames
must not contain bothVK_KHR_buffer_device_address
andVK_EXT_buffer_device_address
- If the
pNext
chain includes aPhysicalDeviceVulkan11Features
structure, then it must not include aPhysicalDevice16BitStorageFeatures
,PhysicalDeviceMultiviewFeatures
,PhysicalDeviceVariablePointersFeatures
,PhysicalDeviceProtectedMemoryFeatures
,PhysicalDeviceSamplerYcbcrConversionFeatures
, orPhysicalDeviceShaderDrawParametersFeatures
structure - If the
pNext
chain includes aPhysicalDeviceVulkan12Features
structure, then it must not include aPhysicalDevice8BitStorageFeatures
,PhysicalDeviceShaderAtomicInt64Features
,PhysicalDeviceShaderFloat16Int8Features
,PhysicalDeviceDescriptorIndexingFeatures
,PhysicalDeviceScalarBlockLayoutFeatures
,PhysicalDeviceImagelessFramebufferFeatures
,PhysicalDeviceUniformBufferStandardLayoutFeatures
,PhysicalDeviceShaderSubgroupExtendedTypesFeatures
,PhysicalDeviceSeparateDepthStencilLayoutsFeatures
,PhysicalDeviceHostQueryResetFeatures
,PhysicalDeviceTimelineSemaphoreFeatures
,PhysicalDeviceBufferDeviceAddressFeatures
, orPhysicalDeviceVulkanMemoryModelFeatures
structure - If
ppEnabledExtensions
contains"VK_KHR_draw_indirect_count"
and thepNext
chain includes aPhysicalDeviceVulkan12Features
structure, thenPhysicalDeviceVulkan12Features
::drawIndirectCount
must beTRUE
- If
ppEnabledExtensions
contains"VK_KHR_sampler_mirror_clamp_to_edge"
and thepNext
chain includes aPhysicalDeviceVulkan12Features
structure, thenPhysicalDeviceVulkan12Features
::samplerMirrorClampToEdge
must beTRUE
- If
ppEnabledExtensions
contains"VK_EXT_descriptor_indexing"
and thepNext
chain includes aPhysicalDeviceVulkan12Features
structure, thenPhysicalDeviceVulkan12Features
::descriptorIndexing
must beTRUE
- If
ppEnabledExtensions
contains"VK_EXT_sampler_filter_minmax"
and thepNext
chain includes aPhysicalDeviceVulkan12Features
structure, thenPhysicalDeviceVulkan12Features
::samplerFilterMinmax
must beTRUE
- If
ppEnabledExtensions
contains"VK_EXT_shader_viewport_index_layer"
and thepNext
chain includes aPhysicalDeviceVulkan12Features
structure, thenPhysicalDeviceVulkan12Features
::shaderOutputViewportIndex
andPhysicalDeviceVulkan12Features
::shaderOutputLayer
must both beTRUE
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_DEVICE_CREATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofDeviceDiagnosticsConfigCreateInfoNV
,DeviceGroupDeviceCreateInfo
,DeviceMemoryOverallocationCreateInfoAMD
,PhysicalDevice16BitStorageFeatures
,PhysicalDevice8BitStorageFeatures
,PhysicalDeviceASTCDecodeFeaturesEXT
,PhysicalDeviceBlendOperationAdvancedFeaturesEXT
,PhysicalDeviceBufferDeviceAddressFeatures
,PhysicalDeviceBufferDeviceAddressFeaturesEXT
,PhysicalDeviceCoherentMemoryFeaturesAMD
,PhysicalDeviceComputeShaderDerivativesFeaturesNV
,PhysicalDeviceConditionalRenderingFeaturesEXT
,PhysicalDeviceCooperativeMatrixFeaturesNV
,PhysicalDeviceCornerSampledImageFeaturesNV
,PhysicalDeviceCoverageReductionModeFeaturesNV
,PhysicalDeviceCustomBorderColorFeaturesEXT
,PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV
,PhysicalDeviceDepthClipEnableFeaturesEXT
,PhysicalDeviceDescriptorIndexingFeatures
,PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
,PhysicalDeviceDiagnosticsConfigFeaturesNV
,PhysicalDeviceExclusiveScissorFeaturesNV
,PhysicalDeviceFeatures2
,PhysicalDeviceFragmentDensityMapFeaturesEXT
,PhysicalDeviceFragmentShaderBarycentricFeaturesNV
,PhysicalDeviceFragmentShaderInterlockFeaturesEXT
,PhysicalDeviceHostQueryResetFeatures
,PhysicalDeviceImagelessFramebufferFeatures
,PhysicalDeviceIndexTypeUint8FeaturesEXT
,PhysicalDeviceInlineUniformBlockFeaturesEXT
,PhysicalDeviceLineRasterizationFeaturesEXT
,PhysicalDeviceMemoryPriorityFeaturesEXT
,PhysicalDeviceMeshShaderFeaturesNV
,PhysicalDeviceMultiviewFeatures
,PhysicalDevicePerformanceQueryFeaturesKHR
,PhysicalDevicePipelineCreationCacheControlFeaturesEXT
,PhysicalDevicePipelineExecutablePropertiesFeaturesKHR
,PhysicalDeviceProtectedMemoryFeatures
,PhysicalDeviceRayTracingFeaturesKHR
,PhysicalDeviceRepresentativeFragmentTestFeaturesNV
,PhysicalDeviceRobustness2FeaturesEXT
,PhysicalDeviceSamplerYcbcrConversionFeatures
,PhysicalDeviceScalarBlockLayoutFeatures
,PhysicalDeviceSeparateDepthStencilLayoutsFeatures
,PhysicalDeviceShaderAtomicInt64Features
,PhysicalDeviceShaderClockFeaturesKHR
,PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT
,PhysicalDeviceShaderDrawParametersFeatures
,PhysicalDeviceShaderFloat16Int8Features
,PhysicalDeviceShaderImageFootprintFeaturesNV
,PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL
,PhysicalDeviceShaderSMBuiltinsFeaturesNV
,PhysicalDeviceShaderSubgroupExtendedTypesFeatures
,PhysicalDeviceShadingRateImageFeaturesNV
,PhysicalDeviceSubgroupSizeControlFeaturesEXT
,PhysicalDeviceTexelBufferAlignmentFeaturesEXT
,PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT
,PhysicalDeviceTimelineSemaphoreFeatures
,PhysicalDeviceTransformFeedbackFeaturesEXT
,PhysicalDeviceUniformBufferStandardLayoutFeatures
,PhysicalDeviceVariablePointersFeatures
,PhysicalDeviceVertexAttributeDivisorFeaturesEXT
,PhysicalDeviceVulkan11Features
,PhysicalDeviceVulkan12Features
,PhysicalDeviceVulkanMemoryModelFeatures
, orPhysicalDeviceYcbcrImageArraysFeaturesEXT
- The
sType
value of each struct in thepNext
chain must be unique flags
must be0
pQueueCreateInfos
must be a valid pointer to an array ofqueueCreateInfoCount
validDeviceQueueCreateInfo
structures- If
enabledLayerCount
is not0
,ppEnabledLayerNames
must be a valid pointer to an array ofenabledLayerCount
null-terminated UTF-8 strings - If
enabledExtensionCount
is not0
,ppEnabledExtensionNames
must be a valid pointer to an array ofenabledExtensionCount
null-terminated UTF-8 strings - If
pEnabledFeatures
is notNULL
,pEnabledFeatures
must be a valid pointer to a validPhysicalDeviceFeatures
structure queueCreateInfoCount
must be greater than0
See Also
DeviceCreateFlags
,
DeviceQueueCreateInfo
,
PhysicalDeviceFeatures
,
StructureType
, createDevice
DeviceCreateInfo | |
|