pub struct InstanceCreateInfo {
    pub application_name: Option<String>,
    pub application_version: Version,
    pub enabled_extensions: InstanceExtensions,
    pub enabled_layers: Vec<String>,
    pub engine_name: Option<String>,
    pub engine_version: Version,
    pub max_api_version: Option<Version>,
    pub enumerate_portability: bool,
    pub enabled_validation_features: Vec<ValidationFeatureEnable>,
    pub disabled_validation_features: Vec<ValidationFeatureDisable>,
    pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new Instance.

Fields§

§application_name: Option<String>

A string of your choice stating the name of your application.

The default value is None.

§application_version: Version

A version number of your choice specifying the version of your application.

The default value is zero.

§enabled_extensions: InstanceExtensions

The extensions to enable on the instance.

The default value is InstanceExtensions::empty().

§enabled_layers: Vec<String>

The layers to enable on the instance.

The default value is empty.

§engine_name: Option<String>

A string of your choice stating the name of the engine used to power the application.

§engine_version: Version

A version number of your choice specifying the version of the engine used to power the application.

The default value is zero.

§max_api_version: Option<Version>

The highest Vulkan API version that the application will use with the instance.

Usually, you will want to leave this at the default.

The default value is Version::HEADER_VERSION, but if the supported instance version is 1.0, then it will be 1.0.

§enumerate_portability: bool

Include portability subset devices when enumerating physical devices.

If you enable this flag, you must ensure that your program is prepared to handle the non-conformant aspects of these devices.

If this flag is not enabled, and there are no fully-conformant devices on the system, then Instance::new will return an IncompatibleDriver error.

The default value is false.

Notes

If this flag is enabled, and the khr_portability_enumeration extension is supported, it will be enabled automatically when creating the instance. If the extension is not supported, this flag will be ignored.

§enabled_validation_features: Vec<ValidationFeatureEnable>

Features of the validation layer to enable.

If not empty, the ext_validation_features extension must be enabled on the instance.

§disabled_validation_features: Vec<ValidationFeatureDisable>

Features of the validation layer to disable.

If not empty, the ext_validation_features extension must be enabled on the instance.

§_ne: NonExhaustive

Implementations§

source§

impl InstanceCreateInfo

source

pub fn application_from_cargo_toml() -> Self

Returns an InstanceCreateInfo with the application_name and application_version set from information in your crate’s Cargo.toml file.

Panics
  • Panics if the required environment variables are missing, which happens if the project wasn’t built by Cargo.

Trait Implementations§

source§

impl Debug for InstanceCreateInfo

source§

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

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

impl Default for InstanceCreateInfo

source§

fn default() -> Self

Returns the “default value” for a type. 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, 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.