Struct kas_wgpu::options::Options[][src]

pub struct Options {
    pub config_path: PathBuf,
    pub config_mode: ConfigMode,
    pub power_preference: PowerPreference,
    pub backends: BackendBit,
}

Shell options

Fields

config_path: PathBuf

Config file path. Default: empty. See KAS_CONFIG doc.

config_mode: ConfigMode

Config mode. Default: Read.

power_preference: PowerPreference

Adapter power preference. Default value: low power.

backends: BackendBit

Adapter backend. Default value: PRIMARY (Vulkan/Metal/DX12).

Implementations

impl Options[src]

pub fn from_env() -> Self[src]

Construct a new instance, reading from environment variables

The following environment variables are read, in case-insensitive mode.

Config

The KAS_CONFIG variable, if given, provides a path to the KAS config file, where configuration can be read and/or written.

WARNING: file formats are unstable!

If KAS_CONFIG is not set, platform-default configuration is used without reading or writing. This may change to use a platform-specific default path in future versions.

The KAS_CONFIG_MODE variable determines the read/write mode:

  • Read (default): read-only
  • WriteDefault: generate platform-default configuration, and write it to the config path, overwriting any existing config

Note: in the future, the default will likely change to a read-write mode, allowing changes to be written out.

Power preference

The KAS_POWER_PREFERENCE variable supports:

  • Default
  • LowPower
  • HighPerformance

Backend

The KAS_BACKENDS variable supports:

  • Vulkan
  • GL
  • Metal
  • DX11
  • DX12
  • PRIMARY: any of Vulkan, Metal or DX12
  • SECONDARY: any of GL or DX11

pub fn config(&self) -> Result<Config, Error>[src]

Load KAS config

Trait Implementations

impl Clone for Options[src]

impl Default for Options[src]

impl Hash for Options[src]

impl PartialEq<Options> for Options[src]

impl StructuralPartialEq for Options[src]

Auto Trait Implementations

impl RefUnwindSafe for Options

impl Send for Options

impl Sync for Options

impl Unpin for Options

impl UnwindSafe for Options

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash

impl<S, T> Cast<T> for S where
    T: Conv<S>, 

impl<S, T> CastFloat<T> for S where
    T: ConvFloat<S>, 

impl<T> Conv<T> for T

impl<T> Downcast<T> for T

impl<'a, T, X> Filter<&'a T> for X where
    T: Clone,
    X: Filter<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,