Struct vulkano::device::Device [] [src]

pub struct Device {
    // some fields omitted
}

Represents a Vulkan context.

Methods

impl Device
[src]

fn new<'a, I, L>(phys: &'a PhysicalDevice, requested_features: &Features, extensions: &DeviceExtensions, layers: L, queue_families: I) -> Result<(Arc<Device>, Vec<Arc<Queue>>)DeviceCreationError> where I: IntoIterator<Item=(QueueFamily<'a>, f32)>, L: IntoIterator<Item=&'a &'a str>

Builds a new Vulkan device for the given physical device.

You must pass two things when creating a logical device:

  • A list of optional Vulkan features that must be enabled on the device. Note that if a feature is not enabled at device creation, you can't use it later even it it's supported by the physical device.

  • An iterator to a list of queues to create. Each element of the iterator must indicate the family whose queue belongs to and a priority between 0.0 and 1.0 to assign to it. A queue with a higher value indicates that the commands will execute faster than on a queue with a lower value. Note however that no guarantee can be made on the way the priority value is handled by the implementation.

Panic

  • Panicks if one of the requested features is not supported by the physical device.
  • Panicks if one of the queue families doesn't belong to the given device.
  • Panicks if you request more queues from a family than available.
  • Panicks if one of the priorities is outside of the [0.0 ; 1.0] range.

fn wait_raw(&self) -> Result<()OomError>

See the docs of wait().

fn wait(&self)

Waits until all work on this device has finished. You should never need to call this function, but it can be useful for debugging or benchmarking purposes.

This is the Vulkan equivalent of glFinish.

Panic

  • Panicks if the device or host ran out of memory.

fn instance(&self) -> &Arc<Instance>

Returns the instance used to create this device.

fn physical_device(&self) -> PhysicalDevice

Returns the physical device that was used to create this device.

fn enabled_features(&self) -> &Features

Returns the features that are enabled in the device.

fn loaded_extensions(&self) -> &DeviceExtensions

Returns the list of extensions that have been loaded.

fn standard_pool(&self) -> Arc<StdMemoryPool>

Returns the standard memory pool used by default if you don't provide any other pool.

Trait Implementations

impl Debug for Device
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.

impl VulkanObject for Device
[src]

type Object = Device

The type of the object.

fn internal_object(&self) -> Device

Returns a reference to the object.

impl Drop for Device
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more