GlassHardware enum Cost and policy

The device family whose measurements apply.

One declaration, two questions. Declaring the wrong one is not a crash: it makes the package quote a price that belongs to another device. The choices — the proxy's divisor, whether slots merge — do not depend on it: they are made on quality, and the lever they pull has the same sign on every family measured.

Handed to GlassHost.hardware; null there means detect. The same value reads the glass ledger through surfaceCostModel:

final GlassHardware hardware = GlassHardware.detect();
final GlassLoad? load = GlassScope.maybeOf(context)?.read(
  viewSize: MediaQuery.sizeOf(context),
  model: hardware.surfaceCostModel,
);

A host that knows it runs on an Adreno 830 says so, because nothing in Dart can tell it:

GlassHost(hardware: GlassHardware.adrenoVulkan, child: const MyScreen())

See also:

Inheritance
Available extensions

Values

adrenoVulkan → const GlassHardware

Adreno 830 / Impeller-Vulkan, where every cycle number in this package was measured (Galaxy S25 Ultra SM-S938B, Snapdragon 8 Elite, Android 16, cycles read off kgsl as busy × frequency).

Declaring this on another Adreno is an extrapolation the host owns: the laws were fitted on one chip. Declaring it on a Mali or an Xclipse is wrong in a way that shows up as a proxy recorded at a quarter of the resolution for a saving nobody has seen.

appleMetal → const GlassHardware

Apple Metal, measured on an M2 iPad Pro (11" 4th generation, iPad14,3) on iPadOS 26.6.1.

The one family where the whole route was measured end to end rather than assembled from per-pass estimates.

unmeasured → const GlassHardware

Anything else, which is most things — every Android device a silent host runs on. Every price refuses; the choices do not.

The conservative end of the divisor lever is the pulled end, because its sign is the same on every device measured: on a Galaxy S22 Ultra (Xclipse 920), full resolution ran at 37 fps where a quarter ran at 115.

Properties

captureCostModel → ProxyCostModel
How this hardware charges for a capture — the input ProxyResolutionPolicy.choose needs.
no setter
hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
maxTextureSide → int
The largest texture this family is guaranteed to allocate, in device pixels a side — the bound the atlas is checked against before it is recorded (AtlasLayout.fitsTexture).
no setter
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
surfaceCostModel → GlassSurfaceCostModel
Which measurements the glass ledger reads itself against — the model GlassLedger.read takes.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

detect() → GlassHardware
What can be told without the host saying anything.

Constants

values → const List<GlassHardware>
A constant List of the values in this enum, in order of their declaration.