pub struct LogicalDevice { /* private fields */ }
Expand description

The logical device and information about the backing physical device.

Basically everything done with Vulkan requires a logical device. This type helps with the creation of the logical device and keeps the relevant information about the underlying physical device at hand for debugging and referenc.

Implementations§

source§

impl LogicalDevice

source

pub fn physical_device(&self) -> &PhysicalDevice

Get the physical device being controlled by this logical device.

source

pub fn active_physical_device_extensions(&self) -> &[String]

Get all of the device extensions used when creating the device.

source

pub unsafe fn new( instance: &VulkanInstance, physical_device: PhysicalDevice, physical_device_extensions: &[String], queue_family_infos: &[QueueFamilyInfo] ) -> InstanceResult<Self>

Create a logical device for interfacing with a given physical device.

Params
  • instance - the Vulkan instance which provides access to the physical device.
  • physical_device - the actual physical device which this logical device will control.
  • physical_device_extensions - the extentions to enable for the physical device.
  • queue_family_infos - a slice of structs which control how many device queues to create.
Safety

Unsafe because the logical device must be dropped before the instance used to create it.

Trait Implementations§

source§

impl Debug for LogicalDevice

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LogicalDevice

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for LogicalDevice

source§

fn drop(&mut self)

Destroy the logical device.

Safety

Unsafe because:

  • The logical device must be dropped before the instance is destroyed.
source§

impl VulkanHandle for LogicalDevice

§

type Handle = Device

source§

unsafe fn raw(&self) -> &Self::Handle

Get the raw resource handle. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.