How one backend turns a .f3dmat source into its section of a
material's shader bundle (D26).
What lets a fifth backend draw the material language. The build
hook that compiles a project's materials, and the run time that compiles
a data plugin's (RuntimeShaders), find a backend's compiler in a
MaterialCompilerRegistry by the backend's name, rather than switching
over the four the engine ships. A backend package exports one and an
application registers it, beside the device it opens.
Extendable outside this package, and stays so through 1.x: a member added later arrives with a default, and compile takes one growing request rather than a list of parameters.
Constructors
- MaterialCompiler()
-
const
Properties
- backend → String
-
The backend's id, exactly as its
GraphicsDevice.backendIdgives it:webgpu,vulkan. MaterialCompilerRegistry.forBackend compares it as written; the engine's four arecpu,webgl,webgpuandimpeller.no setter - bundleSection → String
-
The key of the section this compiler writes in a
ShaderBundle, and that the backend's device reads back.no setter - compilesAtRunTime → bool
-
Whether compile can run while a game runs, with no toolchain beside
it. False by default: what needs glslang, naga or impellerc runs in
the build only.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isSectionWrittenByBuild → bool
-
Whether a build writes this backend's section with a tool of its own
rather than through compile: Impeller's, which
impellercwrites in the build. False by default.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
compile(
MaterialCompileRequest request) → MaterialCompileResult -
The section
requestcompiles to. Throws a MaterialCompileException for a source this backend cannot draw, saying why. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited