vulkan-3.3: Bindings to the Vulkan graphics API.
Safe HaskellNone
LanguageHaskell2010

Vulkan.Core10.Device

Synopsis

Documentation

createDevice :: forall a io. (Extendss DeviceCreateInfo a, PokeChain a, MonadIO io) => 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 :: 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.

destroyDevice :: forall io. MonadIO io => 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
  • 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

Instances

Instances details
Extensible DeviceQueueCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.Device

Methods

extensibleType :: StructureType 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

extensibleType :: StructureType 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