[][src]Struct vulkano::instance::PhysicalDevice

pub struct PhysicalDevice<'a> { /* fields omitted */ }

Represents one of the available devices on this machine.

This struct simply contains a pointer to an instance and a number representing the physical device. You are therefore encouraged to pass this around by value instead of by reference.

Example

use vulkano::instance::PhysicalDevice;

for physical_device in PhysicalDevice::enumerate(&instance) {
    print_infos(physical_device);
}

fn print_infos(dev: PhysicalDevice) {
    println!("Name: {}", dev.name());
}

Methods

impl<'a> PhysicalDevice<'a>
[src]

Important traits for PhysicalDevicesIter<'a>

Returns an iterator that enumerates the physical devices available.

Example

use vulkano::instance::PhysicalDevice;

for physical_device in PhysicalDevice::enumerate(&instance) {
    println!("Available device: {}", physical_device.name());
}

Returns a physical device from its index. Returns None if out of range.

Indices range from 0 to the number of devices.

Example

use vulkano::instance::Instance;
use vulkano::instance::InstanceExtensions;
use vulkano::instance::PhysicalDevice;

let instance = Instance::new(None, &InstanceExtensions::none(), None).unwrap();
let first_physical_device = PhysicalDevice::from_index(&instance, 0).unwrap();

Returns the instance corresponding to this physical device.

Example

use vulkano::instance::PhysicalDevice;

fn do_something(physical_device: PhysicalDevice) {
    let _loaded_extensions = physical_device.instance().loaded_extensions();
    // ...
}

Returns the index of the physical device in the physical devices list.

This index never changes and can be used later to retrieve a PhysicalDevice from an instance and an index.

Returns the human-readable name of the device.

Returns the type of the device.

Example

use vulkano::instance::PhysicalDevice;

for physical_device in PhysicalDevice::enumerate(&instance) {
    println!("Available device: {} (type: {:?})",
              physical_device.name(), physical_device.ty());
}

Returns the version of Vulkan supported by this device.

Returns the Vulkan features that are supported by this physical device.

Important traits for QueueFamiliesIter<'a>

Builds an iterator that enumerates all the queue families on this physical device.

Returns the queue family with the given index, or None if out of range.

Important traits for MemoryTypesIter<'a>

Builds an iterator that enumerates all the memory types on this physical device.

Returns the memory type with the given index, or None if out of range.

Important traits for MemoryHeapsIter<'a>

Builds an iterator that enumerates all the memory heaps on this physical device.

Returns the memory heap with the given index, or None if out of range.

Gives access to the limits of the physical device.

This function should be zero-cost in release mode. It only exists to not pollute the namespace of PhysicalDevice with all the limits-related getters.

Returns an opaque number representing the version of the driver of this device.

The meaning of this number is implementation-specific. It can be used in bug reports, for example.

Returns the PCI ID of the device.

Returns the PCI ID of the vendor.

Returns a unique identifier for the device.

Can be stored in a configuration file, so that you can retrieve the device again the next time the program is run.

Trait Implementations

impl<'a> VulkanObject for PhysicalDevice<'a>
[src]

The type of the object.

The DebugReportObjectTypeEXT of the internal Vulkan handle.

Returns a reference to the object.

impl<'a> Clone for PhysicalDevice<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Copy for PhysicalDevice<'a>
[src]

impl<'a> Debug for PhysicalDevice<'a>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for PhysicalDevice<'a>

impl<'a> Sync for PhysicalDevice<'a>

Blanket Implementations

impl<T> Content for T
[src]

Builds a pointer to this type from a raw pointer.

Returns true if the size is suitable to store a type like this.

Returns the size of an individual element.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T