RuntimeShaders constructor
RuntimeShaders({
- required String? backend,
- required Future<
LoadedShaderLibrary> loadShaders(- ByteData bundle
- required Registration addMaterials(
- ShaderLibrary library
- Map<
String, String> ? engineSources, - PackedStage? webGpuHost,
- int? webGpuFullscreenUvLocation,
- MaterialCompilerRegistry? compilers,
- Future<
ByteData?> prebuilt(- String material
A registry building shaders for backend (normalised, see
RuntimeBackends.normalize), loading each with loadShaders and
adding the materials to the renderer with addMaterials.
engineSources, webGpuHost, webGpuFullscreenUvLocation and
compilers are what runtimeMaterialBundle takes for WebGL2, WebGPU
and a backend's own compiler; a build that needs one and lacks it
switches the material off with the reason. prebuilt finds the
bundle the build compiled for a material, or for a render step's
stage, on Impeller by the stage's name, null where the build made none.
Implementation
RuntimeShaders({
required String? backend,
required Future<LoadedShaderLibrary> Function(ByteData bundle) loadShaders,
required Registration Function(ShaderLibrary library) addMaterials,
Map<String, String>? engineSources,
PackedStage? webGpuHost,
int? webGpuFullscreenUvLocation,
MaterialCompilerRegistry? compilers,
Future<ByteData?> Function(String material)? prebuilt,
}) : _store = _ShaderStore(
RuntimeBackends.normalize(backend),
loadShaders,
addMaterials,
engineSources,
webGpuHost,
webGpuFullscreenUvLocation,
compilers,
prebuilt,
),
_scope = null;