Macro vulkanology::physical_device [] [src]

macro_rules! physical_device {
    ($instance:ident, $($feature:ident),+) => { ... };
    ($instance:ident) => { ... };
}

This macro generates code for loading a PhysicalDevice. It takes the instance variable name and an optional list of features which the device should support. All available features are defined here.

Panics

Panics if no device matching the requirements has been found.

Example

// First initialize a `vulkano::Instance`.
let instance = instance!();

// Select the first physical device which supports compute shaders.
{
    // With no explicitly required features:
    let physical_device = physical_device!(instance);
}
{
    // With some features:
    let physical_device = physical_device!(
        instance,
        robust_buffer_access,
        full_draw_index_uint32);
}