vulkan-utils-0.3: Utils for the vulkan package
Safe HaskellNone
LanguageHaskell2010

Vulkan.Utils.Initialization

Synopsis

Documentation

createDebugInstanceWithExtensions Source #

Arguments

:: forall es m. (Extendss InstanceCreateInfo es, PokeChain es, MonadResource m) 
=> [ByteString]

Required layers

-> [ByteString]

Optional layers

-> [ByteString]

Required extensions

-> [ByteString]

Optional extensions

-> InstanceCreateInfo es 
-> m Instance 

Like createInstanceWithExtensions except it will create a debug utils messenger (from the VK_EXT_debug_utils extension).

If the VK_EXT_validation_features extension (from the VK_LAYER_KHRONOS_validation layer) is available is it will be enabled and best practices messages enabled.

createInstanceWithExtensions Source #

Arguments

:: forall es m. (Extendss InstanceCreateInfo es, PokeChain es, MonadResource m) 
=> [ByteString]

Required layers

-> [ByteString]

Optional layers

-> [ByteString]

Required extensions

-> [ByteString]

Optional extensions

-> InstanceCreateInfo es 
-> m Instance 

Create an Instance with some layers and extensions, the layers and extensions will be added to the provided InstanceCreateInfo.

Will throw an 'IOError in the case of missing layers or extensions. Details on missing layers and extensions will be reported in stderr.

pickPhysicalDevice Source #

Arguments

:: (MonadIO m, Ord b) 
=> Instance 
-> (PhysicalDevice -> m (Maybe a))

A suitability funcion for a PhysicalDevice, Nothing if it is not to be chosen.

-> (a -> b)

Scoring function to rate this result

-> m (Maybe (a, PhysicalDevice))

The score and the device

Get a single PhysicalDevice deciding with a scoring function

Pass a function which will extract any required values from a device in the spirit of parse-don't-validate. Also provide a function to compare these results for sorting multiple suitable devices.

As an example, the suitability function could return a tuple of device memory and the compute queue family index, and the scoring function could be fst to select devices based on their memory capacity. Consider using assignQueues to find your desired queues in the suitability function.

If no devices are deemed suitable then a NoSuchThing IOError is thrown.

createDeviceWithExtensions Source #

Arguments

:: forall es m. (Extendss DeviceCreateInfo es, PokeChain es, MonadResource m) 
=> PhysicalDevice 
-> [ByteString]

Required extensions

-> [ByteString]

Optional extensions

-> DeviceCreateInfo es 
-> m Device 

Create a Device with some extensions, the extensions will be added to the provided DeviceCreateInfo.

Will throw an 'IOError in the case of missing extensions. Missing extensions will be listed on stderr.