API Reference · Renderers

BackendOption

Namespace: Ava3D

public sealed record class BackendOption

One entry in RenderInfo.AvailableBackends: a renderer, whether it can be selected, and a plain-language reason when it cannot.

The reason is the point. "Metal" greyed out with no explanation invites the guess that the feature is broken; "Metal exists only on macOS and iOS" ends the question.

Properties

MemberDescription
required BackendAvailability Availability { get; set; }

Whether it can be selected right now, after a restart, or not at all.

bool CanSelect { get; }

Whether a UI should let the user pick this.

required RenderBackendKind Kind { get; set; }

Which renderer this entry describes.

IReadOnlyList<MissingComponent> MissingComponents { get; set; }

What this renderer needs that is not on the machine — empty when nothing is, which is almost always.

Separate from BackendOption.Reason because the two answer different questions and a UI treats them differently. Most unavailable rows are permanent facts about the platform: Metal does not exist on Windows, the browser has WebGL 2 and nothing else, and there is no button anybody could press. These are the rows somebody can act on, and each entry carries what to do rather than a sentence that has to be read and interpreted first.

A list because a renderer can want more than one thing — a Linux box may be short both a Vulkan loader and a driver for its card — even though today there is exactly one entry anywhere: MoltenVK, which is how Vulkan runs on a Mac. Test whether it is empty rather than testing for that name; the whole point is that a UI can offer to help without knowing what is being asked for.

required string Name { get; set; }

Display name, e.g. "OpenGL" or "Software (CPU)".

string Reason { get; set; }

Why this backend is unavailable or needs a restart. Null when it can just be selected.

See also