A library a device built from bytes it was handed, and can rebuild.
What GraphicsDevice.loadShaders returns. It answers names like any
ShaderLibrary; what it adds is refresh, and the one promise that makes
reloading worth having: a handle already handed out keeps its identity
and keeps working. The renderer resolves its vertex stages once and holds
the handles for its lifetime, so a reload that answered the same names with
new handles would leave every pipeline the renderer builds afterwards
linking against stale objects. Each backend keeps the promise its own way —
flutter_gpu mutates the stage in place, WebGL swaps the compiled object
inside the handle, the software rasteriser never had anything to swap — and
the conformance suite checks it by identity.
Reloading does not rebuild pipelines. A pipeline is a pair of stages linked
on the backend, and the linked object is the caller's to drop:
Renderer.relinkShaders is the engine's half of the same gesture. Until
it is dropped it keeps drawing the code it was linked from, on every
backend — a frame between a refresh and a relink is the old picture, not
a missing one.
There is no dispose: a loaded library lives as long as the device that
built it, and GraphicsDevice.loadShaders says why.
- Implemented types
- Implementers
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
ByteData bytes) → void -
Reparses
bytesinto this library in place. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String name) → ShaderHandle? -
The stage called
name, or null if the bundle has none.inherited