vulkan-3.0.0.0: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core10.Device

Synopsis

Documentation

createDevice :: PokeChain a => PhysicalDevice -> DeviceCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO Device Source #

vkCreateDevice - Create a new device instance

Parameters

  • pCreateInfo is a pointer to a DeviceCreateInfo structure containing information about how to create the device.
  • pAllocator controls host memory allocation as described in the Memory Allocation chapter.
  • pDevice is a pointer to a handle in which the created Device is returned.

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

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 :: PokeChain a => PhysicalDevice -> DeviceCreateInfo a -> Maybe AllocationCallbacks -> (Device -> IO r) -> IO r Source #

A safe wrapper for createDevice and destroyDevice using bracket

The allocated value must not be returned from the provided computation

destroyDevice :: Device -> ("allocator" ::: Maybe AllocationCallbacks) -> IO () Source #

vkDestroyDevice - Destroy a logical device

Parameters

  • Device is the logical device to destroy.
  • pAllocator controls host memory allocation as described in the Memory Allocation chapter.

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

Valid Usage (Implicit)

  • 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

See Also

AllocationCallbacks, Device

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

VkDeviceQueueCreateInfo - Structure specifying parameters of a newly created device queue

Valid Usage

Valid Usage (Implicit)

See Also

DeviceCreateInfo, DeviceQueueCreateFlags, StructureType

Constructors

DeviceQueueCreateInfo 

Fields

Instances
Extensible DeviceQueueCreateInfo Source # 
Instance details

Defined in Graphics.Vulkan.Core10.Device

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

Defined in Graphics.Vulkan.Core10.Device

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

Defined in Graphics.Vulkan.Core10.Device

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

Defined in Graphics.Vulkan.Core10.Device

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

Defined in Graphics.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