Skip to main content

PhysicalDevice

Struct PhysicalDevice 

Source
pub struct PhysicalDevice {
Show 21 fields pub depth_stencil_resolve_properties: DepthStencilResolveProperties, pub features_v1_0: Vulkan10Features, pub features_v1_1: Vulkan11Features, pub features_v1_2: Vulkan12Features, pub handle: PhysicalDevice, pub instance: Instance, pub memory_properties: PhysicalDeviceMemoryProperties, pub properties_v1_0: Vulkan10Properties, pub properties_v1_1: Vulkan11Properties, pub properties_v1_2: Vulkan12Properties, pub queue_families: Box<[QueueFamilyProperties]>, pub vk_khr_ray_tracing_pipeline: Option<RayTracingPipeline>, pub sampler_filter_minmax_properties: SamplerFilterMinmaxProperties, pub vk_ext_index_type_uint8: bool, pub vk_ext_private_data: bool, pub vk_khr_acceleration_structure: Option<AccelerationStructure>, pub vk_khr_present_id: Option<PresentId>, pub vk_khr_present_wait: Option<PresentWait>, pub vk_khr_ray_query: bool, pub vk_khr_swapchain: bool, pub vk_khr_synchronization2: bool, /* private fields */
}
Expand description

Structure which holds data about a physical device.

Extension support is exposed through fields named after Vulkan extension names. Extensions that only need a support check are booleans, such as Self::vk_ext_private_data and Self::vk_khr_swapchain. Extensions with feature or property data are Option fields, such as Self::vk_khr_acceleration_structure and Self::vk_khr_ray_tracing_pipeline.

Use Device::physical for the selected physical device of a logical device.

See VkPhysicalDevice.

Fields§

§depth_stencil_resolve_properties: DepthStencilResolveProperties

Describes the properties of the device which relate to depth/stencil resolve operations.

Note: This field is read-only.

§features_v1_0: Vulkan10Features

Describes the features of the physical device which are part of the Vulkan 1.0 base feature set.

Note: This field is read-only.

§features_v1_1: Vulkan11Features

Describes the features of the physical device which are part of the Vulkan 1.1 base feature set.

Note: This field is read-only.

§features_v1_2: Vulkan12Features

Describes the features of the physical device which are part of the Vulkan 1.2 base feature set.

Note: This field is read-only.

§handle: PhysicalDevice

The native Vulkan resource handle of this physical device.

Note: This field is read-only.

§instance: Instance

The Vulkan instance which owns this device.

Note: This field is read-only.

§memory_properties: PhysicalDeviceMemoryProperties

Memory properties of the physical device.

Note: This field is read-only.

§properties_v1_0: Vulkan10Properties

Device properties of the physical device which are part of the Vulkan 1.0 base property set.

Note: This field is read-only.

§properties_v1_1: Vulkan11Properties

Describes the properties of the physical device which are part of the Vulkan 1.1 base property set.

Note: This field is read-only.

§properties_v1_2: Vulkan12Properties

Describes the properties of the physical device which are part of the Vulkan 1.2 base property set.

Note: This field is read-only.

§queue_families: Box<[QueueFamilyProperties]>

Describes the queues offered by this physical device.

Note: This field is read-only.

§vk_khr_ray_tracing_pipeline: Option<RayTracingPipeline>

VK_KHR_ray_tracing_pipeline features and properties, when supported.

Note: This field is read-only.

§sampler_filter_minmax_properties: SamplerFilterMinmaxProperties

Describes the properties of the device which relate to min/max sampler filtering.

Note: This field is read-only.

§vk_ext_index_type_uint8: bool

Whether VK_EXT_index_type_uint8 support is available.

Note: This field is read-only.

§vk_ext_private_data: bool

Whether VK_EXT_private_data support is available.

Note: This field is read-only.

§vk_khr_acceleration_structure: Option<AccelerationStructure>

VK_KHR_acceleration_structure features and properties, when supported.

Note: This field is read-only.

§vk_khr_present_id: Option<PresentId>

VK_KHR_present_id features, when supported.

Note: This field is read-only.

§vk_khr_present_wait: Option<PresentWait>

VK_KHR_present_wait features, when supported.

Note: This field is read-only.

§vk_khr_ray_query: bool

Whether VK_KHR_ray_query support is available.

Note: This field is read-only.

§vk_khr_swapchain: bool

Whether VK_KHR_swapchain support is available.

Note: This field is read-only.

§vk_khr_synchronization2: bool

Whether synchronization2 support is available through Vulkan 1.3 core or VK_KHR_synchronization2.

Note: This field is read-only.

Implementations§

Source§

impl PhysicalDevice

Source

pub unsafe fn create_ash_device<F>(&self, create_fn: F) -> VkResult<Device>

Prepares device creation information and calls the provided callback to allow an application to control the device creation process.

Note: This is only useful for interoperating with other libraries as device creation is normally handled by the Device::try_from_display and Device::create functions.

§Safety

This comes with all the caveats of using ash builder types, which are inherently dangerous. Use with extreme caution.

See VkDeviceCreateInfo.

Source

pub fn format_properties(&self, format: Format) -> FormatProperties

Lists the capabilities of a given format.

See vkGetPhysicalDeviceFormatProperties.

Source

pub fn image_format_properties( &self, format: Format, image_type: ImageType, tiling: ImageTiling, usage: ImageUsageFlags, flags: ImageCreateFlags, ) -> Result<Option<ImageFormatProperties>, DriverError>

Lists the physical device’s image format capabilities.

A result of None indicates the format is not supported.

See vkGetPhysicalDeviceImageFormatProperties.

Source

pub unsafe fn try_from_ash( instance: &Instance, physical_device: PhysicalDevice, ) -> Result<Self, DriverError>

Creates a physical device wrapper which reports features and properties.

§Safety

physical_device must be a valid handle enumerated from instance, and it must remain valid for the lifetime of the returned wrapper.

Source

pub fn try_into_device(self) -> Result<Device, DriverError>

Creates a logical Device from this selected physical device.

Trait Implementations§

Source§

impl Clone for PhysicalDevice

Source§

fn clone(&self) -> PhysicalDevice

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PhysicalDevice

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.