[−][src]Struct vulkano::instance::PhysicalDevice
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>pub fn enumerate(instance: &'a Arc<Instance>) -> PhysicalDevicesIter<'a>
[src]
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()); }
pub fn from_index(
instance: &'a Arc<Instance>,
index: usize
) -> Option<PhysicalDevice<'a>>
[src]
instance: &'a Arc<Instance>,
index: usize
) -> Option<PhysicalDevice<'a>>
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();
pub fn instance(&self) -> &'a Arc<Instance>
[src]
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(); // ... }
pub fn index(&self) -> usize
[src]
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.
pub fn name(&self) -> String
[src]
Returns the human-readable name of the device.
pub fn ty(&self) -> PhysicalDeviceType
[src]
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()); }
pub fn api_version(&self) -> Version
[src]
Returns the version of Vulkan supported by this device.
pub fn supported_features(&self) -> &'a Features
[src]
Returns the Vulkan features that are supported by this physical device.
ⓘImportant traits for QueueFamiliesIter<'a>pub fn queue_families(&self) -> QueueFamiliesIter<'a>
[src]
Builds an iterator that enumerates all the queue families on this physical device.
pub fn queue_family_by_id(&self, id: u32) -> Option<QueueFamily<'a>>
[src]
Returns the queue family with the given index, or None
if out of range.
ⓘImportant traits for MemoryTypesIter<'a>pub fn memory_types(&self) -> MemoryTypesIter<'a>
[src]
Builds an iterator that enumerates all the memory types on this physical device.
pub fn memory_type_by_id(&self, id: u32) -> Option<MemoryType<'a>>
[src]
Returns the memory type with the given index, or None
if out of range.
ⓘImportant traits for MemoryHeapsIter<'a>pub fn memory_heaps(&self) -> MemoryHeapsIter<'a>
[src]
Builds an iterator that enumerates all the memory heaps on this physical device.
pub fn memory_heap_by_id(&self, id: u32) -> Option<MemoryHeap<'a>>
[src]
Returns the memory heap with the given index, or None
if out of range.
pub fn limits(&self) -> Limits<'a>
[src]
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.
pub fn driver_version(&self) -> u32
[src]
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.
pub fn pci_device_id(&self) -> u32
[src]
Returns the PCI ID of the device.
pub fn pci_vendor_id(&self) -> u32
[src]
Returns the PCI ID of the vendor.
pub fn uuid(&self) -> &[u8; 16]
[src]
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]
type Object = PhysicalDevice
The type of the object.
const TYPE: DebugReportObjectTypeEXT
[src]
fn internal_object(&self) -> PhysicalDevice
[src]
impl<'a> Clone for PhysicalDevice<'a>
[src]
fn clone(&self) -> PhysicalDevice<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for PhysicalDevice<'a>
[src]
impl<'a> Debug for PhysicalDevice<'a>
[src]
Auto Trait Implementations
impl<'a> Send for PhysicalDevice<'a>
impl<'a> Unpin for PhysicalDevice<'a>
impl<'a> Sync for PhysicalDevice<'a>
impl<'a> UnwindSafe for PhysicalDevice<'a>
impl<'a> RefUnwindSafe for PhysicalDevice<'a>
Blanket Implementations
impl<T> Content for T
[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
fn is_size_suitable(usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,