vulkan-3.3.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. 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 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

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

Generic (DeviceQueueCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

Associated Types

type Rep (DeviceQueueCreateInfo es) :: Type -> Type #

(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

type Rep (DeviceQueueCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

type Rep (DeviceQueueCreateInfo es) = D1 ('MetaData "DeviceQueueCreateInfo" "Vulkan.Core10.Device" "vulkan-3.3.1-inplace" 'False) (C1 ('MetaCons "DeviceQueueCreateInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "next") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Chain es)) :*: S1 ('MetaSel ('Just "flags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DeviceQueueCreateFlags)) :*: (S1 ('MetaSel ('Just "queueFamilyIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "queuePriorities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Vector Float)))))

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

Generic (DeviceCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device

Associated Types

type Rep (DeviceCreateInfo es) :: Type -> Type #

(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

type Rep (DeviceCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Device