getParameter method
Effective value of a declared parameter, boxed as double, int,
Vector2, Vector3, Vector4, or Matrix4 matching its declared
type. For samplers use getTexture. Throws on an unknown name.
Implementation
Object getParameter(String name) {
final type = _slot(name, null).type;
return switch (type) {
FmatType.float_ => getFloat(name),
FmatType.int_ => getInt(name),
FmatType.vec2 => getVec2(name),
FmatType.vec3 => getVec3(name),
FmatType.vec4 => getVec4(name),
FmatType.mat4 => getMat4(name),
// Samplers are declared separately (see _samplers) and never appear in
// _layout, so _slot never returns one of these for a plain parameter.
FmatType.sampler2d ||
FmatType.samplerCube => throw StateError('unreachable: sampler type'),
};
}