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

pub struct Options {
    pub config_path: PathBuf,
    pub theme_config_path: PathBuf,
    pub config_mode: ConfigMode,
    pub power_preference: PowerPreference,
    pub backends: Backends,
    pub wgpu_trace_path: Option<PathBuf>,
}
Expand description

Shell options

Fields

config_path: PathBuf

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

theme_config_path: PathBuf

Theme config path. Default: empty.

config_mode: ConfigMode

Config mode. Default: Read.

power_preference: PowerPreference

Adapter power preference. Default value: low power.

backends: Backends

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

wgpu_trace_path: Option<PathBuf>

WGPU’s API tracing path

Implementations

Construct a new instance, reading from environment variables

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

Config files

WARNING: file formats are not stable and may not be compatible across KAS versions (aside from patch versions)!

The KAS_CONFIG variable, if given, provides a path to the KAS config file, which is read or written according to KAS_CONFIG_MODE. If KAS_CONFIG is not specified, platform-default configuration is used without reading or writing. This may change to use a platform-specific default path in future versions.

The KAS_THEME_CONFIG variable, if given, provides a path to the theme config file, which is read or written according to KAS_CONFIG_MODE. If KAS_THEME_CONFIG is not specified, 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
  • ReadWrite: read on start-up, write on exit
  • WriteDefault: generate platform-default configuration and write it to the config path(s) specified, overwriting any existing config

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

Graphics options

The KAS_POWER_PREFERENCE variable supports:

  • Default
  • LowPower
  • HighPerformance

The KAS_BACKENDS variable supports:

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

WGPU has an API tracing feature for debugging. To use this, ensure the wgpu/trace feature is enabled and set the output path:

export KAS_WGPU_TRACE_PATH="api_trace"

Load/save theme config on start

Load/save KAS config on start

Save all config (on exit or after changes)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast from Self to T

Try converting from Self to T

Cast to integer, truncating Read more

Cast to the nearest integer Read more

Cast the floor to an integer Read more

Cast the ceiling to an integer Read more

Try converting to integer with truncation Read more

Try converting to the nearest integer Read more

Try converting the floor to an integer Read more

Try convert the ceiling to an integer Read more

Convert from T to Self

Try converting from T to Self

Returns true if the given item matches this filter

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.