Skip to content

Troubleshooting

Diggory Hardy edited this page Dec 14, 2023 · 2 revisions

Troubleshooting

Graphics

At the time of writing, KAS only supports GPU-accelerated rendering via WGPU (see also #287).

WGPU targets Vulkan and OpenGL on Linux and Android, Vulkan, DX12 and DX11 on Windows, and finally Metal on MacOS and iOS. This should satisfy most devices, albeit support may be incomplete (refer to WGPU documentation).

To force use of a specific backend, set KAS_BACKENDS, for example:

export KAS_BACKENDS=GL

To prefer use of a discrete GPU over integrated graphics, set:

export KAS_POWER_PREFERENCE=HighPerformance

Invalid widget Id

If you see an error like this when the mouse is moved over a widget:

thread 'main' panicked at 'Id::eq: invalid id', crates/kas-core/src/core/widget_id.rs:544:62
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The most likely cause is that this widget is stored as a field of a parent widget, and should have #[widget] on that field.

Why: Id identifiers are assigned during configuration. In debug builds, attempting to compare against an unassigned Id will panic with the above message. Configuration happens on child widgets automatically, but in order to know that this field is a child widget, the #[widget] attribute is required. (Note: it is valid for non-widgets to appear in a widget's layout, and these need only implement the Layout trait.)

Clone this wiki locally