logo
pub struct Device { /* private fields */ }
Expand description

Represents a Vulkan context.

Implementations

Creates a new Device.

Panics
  • Panics if create_info.queues is empty.
  • Panics if one of the queue families in create_info.queues doesn’t belong to the given physical device.
  • Panics if create_info.queues contains multiple elements for the same queue family.
  • Panics if create_info.queues contains an element where queues is empty.
  • Panics if create_info.queues contains an element where queues contains a value that is not between 0.0 and 1.0 inclusive.

Returns the Vulkan version supported by the device.

This is the lower of the physical device’s supported version and the instance’s max_api_version.

Returns pointers to the raw Vulkan functions of the device.

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

Returns the instance used to create this device.

Returns the queue family indices that this device uses.

Returns the extensions that have been enabled on the device.

Returns the features that have been enabled on the device.

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

Gives you access to the standard descriptor pool that is used by default if you don’t provide any other pool.

Pools are stored in thread-local storage to avoid locks, which means that a pool is only dropped once both the thread exits and all descriptor sets allocated from it are dropped. A pool is created lazily for each thread.

Panics
  • Panics if called again from within the callback.

Gives you access to the standard command buffer pool used by default if you don’t provide any other pool.

Pools are stored in thread-local storage to avoid locks, which means that a pool is only dropped once both the thread exits and all command buffers allocated from it are dropped. A pool is created lazily for each thread, device and queue family combination as needed, which is why this function might return an OomError.

Panics
  • Panics if the device and the queue family don’t belong to the same physical device.
  • Panics if called again from within the callback.

Retrieves the properties of an external file descriptor when imported as a given external handle type.

An error will be returned if the khr_external_memory_fd extension was not enabled on the device, or if handle_type is ExternalMemoryHandleType::OpaqueFd.

Safety
  • file must be a handle to external memory that was created outside the Vulkan API.

Assigns a human-readable name to object for debugging purposes.

If object_name is None, a previously set object name is removed.

Panics
  • If object is not owned by this device.

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.

Note: This is the Vulkan equivalent of OpenGL’s glFinish.

Safety

This function is not thread-safe. You must not submit anything to any of the queue of the device (either explicitly or implicitly, for example with a future’s destructor) while this function is waiting.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type of the object.
Returns a reference to the object.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.