ShaderBindings class final
A map rather than a generated struct, because the binding contract is by
name: the engine writes bindUniformBlock(shader, 'FragInfo', {...}) and a
backend looks the members up. A Dart shader does the same lookup.
Constructors
-
ShaderBindings(Map<
String, Map< blocks, Map<String, Float32List> >String, BoundTexture> textures, {Map<String, ByteData> storage = const <String, ByteData>{}, Map<String, CpuStorageTexture> storageTextures = const <String, CpuStorageTexture>{}}) -
Bindings that look each member up afresh on every read; see
ShaderBindings.forDraw for the caching form a draw uses.
const
-
ShaderBindings.forDraw(Map<
String, Map< blocks, Map<String, Float32List> >String, BoundTexture> textures, {Map<String, ByteData> storage = const <String, ByteData>{}, Map<String, CpuStorageTexture> storageTextures = const <String, CpuStorageTexture>{}}) - The same bindings, remembering what read finds.
Properties
-
blocks
→ Map<
String, Map< String, Float32List> > -
Block name to member name to floats, exactly as the engine wrote them.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
storage
→ Map<
String, ByteData> -
Storage buffers a render stage was handed by name —
PassEncoder.bindStorageBuffer. The bytes themselves, a bound range of the buffer: a stage that writes them writes the buffer. Empty for every draw that binds none.final -
storageTextures
→ Map<
String, CpuStorageTexture> -
Storage textures a render stage was handed by name —
PassEncoder.bindStorageTexture.final -
textures
→ Map<
String, BoundTexture> -
Sampler slot name to what is bound there, with the sampler it came with.
final
Methods
-
mat4(
String block, String member, {int at = 0}) → Matrix4 -
memberofblockas a matrix, or the identity. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String block, String member) → Float32List? -
memberofblock, or null if the engine did not write it. -
toString(
) → String -
A string representation of this object.
inherited
-
vec4(
String block, String member, Vector4 fallback, {int at = 0}) → Vector4 -
memberofblockas a vector, orfallback.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited