Skip to content
Project referenceDevelopmentEngine ccf7d03f
Authored
  • Language-neutral shader functions, graph lowering, typed stages and structured regions.

Language-neutral shader functions, graph lowering, typed stages and structured regions.

Start with rendering tasks and frame ownership.

Shader source functions, authored graphs and optional domain Targets feed one chain: expanded stage graph → typed Shader IR → adapter source generation → native compilation. This assembly owns neutral function interfaces, multi-implementation analysis, ports, lowering and typed regions/stages. It does not create GPU objects or depend on BGFX, rendering assets, Scene, Editor or a consumer’s 2D model.

Start with shader authoring, then source functions or reusable graph nodes. A domain-specific Target expands GraphDocument; it does not inject native shader strings or schedule the Scene render graph.

Catalogs are immutable owner-held registrations, not global singletons. The caller owns providers in direct composition. ShaderSourceFrontendRegistry uses the shared TypeRegistry for discovery, conflict rollback and provider retirement. Hold one operation scope for an entire multi-implementation analysis; do not switch generations between languages.

Missing language support produces a recoverable diagnostic. An empty candidate set or duplicate implementation key is a call error. Source diagnostics cannot swallow the shared retirement barrier. Preserve stable source-function identities so language support can recover without discarding author intent.

Target and Template providers live in generation snapshots. Persist stable IDs and neutral values, never frontend/resolver/parser/provider instances or live graph-definition objects. Menus contain immutable strings rather than provider references.

The actual manifest exports selected node/frontend descriptions and typed IR through InnoEditor.Rendering.Shaders, in Editor scope. Runtime scripts cannot use these authoring types. Registries, background compilation owners and backend implementations remain host-only.

Exported graph document/binding/template helpers use the host’s SerializationRegistry and complete reference context; scripts cannot construct a registry or capture a converter generation. Node drawing is a separate Editor.Shaders data contract, not a compiler callback.

Inputs, outputs, aggregate layouts and side effects retain explicit types and order. No implicit numeric conversion or hidden GPU global supplies missing data. Resource handles do not cross stage interfaces or become ordinary branch/loop merge values. Frozen Build results do not change when the builder is edited later.

Source calls remain conservatively ordered side effects, even with unused results. Stage input/resource requirements and nested control-flow legality are validated. See typed IR and input snapshots for exact arithmetic, stage, memory-order and default-value semantics, and shader extension boundaries for generation-safe expansion.

Supply live, explicitly owned dependencies as described above. These examples compile against the host contract; they do not initialize a complete product or verify a device.

using Inno.Rendering.Shaders;
public static class FrontendExample
{
public static ShaderSourceAnalysis Inspect(
IShaderSourceFrontend frontend,
string languageId,
ShaderSourceRequest request
) {
var frontends = new ShaderSourceFrontendCatalog([frontend]);
return frontends.Analyze(languageId, request);
}
}
using System.Collections.Generic;
using Inno.Rendering.Shaders;
public static class ShaderIrExample
{
public static ShaderIrBlock BuildBrightness()
{
var builder = new ShaderIrBuilder();
ShaderIrValue brightness = builder.Input("brightness", ShaderSourceType.Atomic("float"));
ShaderIrValue result = builder.Binary(ShaderIrOperation.Multiply, brightness, builder.Constant(2f));
return builder.Build(new Dictionary<string, ShaderIrValue> { ["brightness"] = result });
}
}

The source project defines the host declarations. Source API extraction does not establish script visibility, native behavior or completed generation retirement.

Browse types and members.

The compiler-selected script declarations are separate from this project’s host CLR surface. Read the script calling guide and the associated module contracts before using a projected member.

Project: Inno.Rendering.Shaders
Source: src/services/rendering/Inno.Rendering.Shaders/Inno.Rendering.Shaders.csproj

Type API Description
IShaderNodeCompiler engine Defines one shader node’s typed ports and lowering; drawing belongs to a separate editor extension.
IShaderSourceFrontend engine Parses one source language into canonical function interfaces; it does not create GPU objects.
IShaderSourceResolver engine Reads dependencies only from the current source candidate and records their import dependencies.
ShaderBinaryNodeCompiler engine Lowers an explicit arithmetic/comparison operation; operation IDs are node configuration, not backend code.
ShaderConstantNodeCompiler engine Lowers an exact scalar constant; its type/value are native graph properties.
ShaderConstructNodeCompiler engine Constructs a vector or column-major matrix from individually connected scalar components.
ShaderExtractNodeCompiler engine Extracts one statically selected component from a vector or matrix.
ShaderGraphBindings engine Keeps graph input edits and the material-visible parameter contract in one neutral document change.
ShaderGraphCallNodeCompiler engine Describes graph-authored node references before they are expanded or consumed by a Target.
ShaderGraphClipboard engine Copies and pastes shader structures as detached atomic candidates, including their parameter and Pass contracts.
ShaderGraphDiagnostic engine Identifies a graph compilation problem without retaining a node or compiler instance.
ShaderGraphDocument engine Defines the native graph document protocol shared by shader import, templates and the editor.
ShaderGraphInputSettings engine Stores a stage input node’s logical interface without native names or GPU handles.
ShaderGraphLiteral engine Stores an exact typed value for an unconnected node input, independently of source-language syntax.
ShaderGraphLoweringRequest engine Freezes one target-selected graph region and its externally resolved, neutral compilation inputs.
ShaderGraphLoweringResult engine Contains a detached typed region only after all graph, port and node lowering validation succeeds.
ShaderGraphNodeEffect engine Declares whether a graph-authored function is pure or intentionally emits ordered effects.
ShaderGraphNodeInputSettings engine Stores values supplied by callers to a graph-authored node.
ShaderGraphNodeInputsCompiler engine Describes the multi-port external inputs while editing a graph-authored node asset.
ShaderGraphNodeInterface engine Freezes the complete public interface resolved from one graph-authored node asset.
ShaderGraphNodeKind engine Chooses whether a graph-authored node is inlined or consumed by a domain Target.
ShaderGraphNodeOutputSettings engine Stores values returned by a graph-authored function node.
ShaderGraphNodeOutputsCompiler engine Describes the multi-port returned values while editing a graph-authored function node asset.
ShaderGraphNodePortDefinition engine Declares one stable, typed port on a graph-authored node interface.
ShaderGraphNodeSettings engine Stores graph-level identity and catalog metadata for a reusable Shader node.
ShaderGraphNodes engine Reads and expands reusable node graphs without retaining assets or provider instances.
ShaderGraphOutput engine Stores one stable output port’s destination, independent of adapter source syntax.
ShaderGraphPass engine Freezes the graph-lowered stages of one material-selectable GPU pass.
ShaderGraphPassProgram engine References shared stage output identities from a material-selectable pass.
ShaderGraphPasteResult engine Contains a detached paste candidate and its newly allocated node identities.
ShaderGraphProgramCompiler engine Partitions explicit GPU-stage regions and lowers them through registered node compilers.
ShaderGraphProgramResult engine Contains the result of lowering an entire shader graph, before target-native compilation.
ShaderGraphPrograms engine Edits pass-to-program references without copying computation or changing runtime render states.
ShaderGraphStageSettings engine Stores one stage’s explicit output interface and compute dimensions inside its output node.
ShaderGraphTemplate engine Contributes an ordinary shader graph to the shared asset creation workflow.
ShaderGraphTemplateAttribute engine Declares immutable creation metadata for a Shader graph template.
ShaderGraphTemplateInfo engine Describes a creation menu item without retaining a plugin instance.
ShaderGraphTemplateRegistry engine Owns generation-safe template discovery and invocation for editor asset creation.
ShaderGraphTemplates engine Provides small backend-neutral starting documents composed exclusively of ordinary graph nodes.
ShaderGraphType engine Persists a complete shader type as neutral native-serializable data, without extension instances.
ShaderIrBlock engine Contains immutable ordered instructions and nested structured regions without retaining builder callbacks.
ShaderIrBuilder engine Builds typed shader IR instructions for graph compilation.

Builds typed instructions and structured regions. No API accepts an arbitrary backend expression or complete stage source. This builder is transient and belongs to one lowering operation, never to a persisted document or runtime frame.

Builds typed shader IR instructions for graph compilation.
ShaderIrInputKind engine Identifies the GPU interface through which a stage receives a value.
ShaderIrInstruction engine Stores one immutable typed instruction without generated stage source or backend expressions.
ShaderIrOperation engine Defines backend-neutral value operations; graph node IDs are not instruction opcodes.
ShaderIrOutputKind engine Identifies where a typed stage output is written.
ShaderIrStage engine Freezes a typed GPU stage and its explicit interface. It contains no main function, varying declarations or source expressions. Targets own stage/resource layout; adapters translate these semantics into their native language.
ShaderIrStageInput engine Describes a stage input without embedding native declarations or expressions.
ShaderIrStageOutput engine Describes a named block output’s GPU destination.
ShaderIrValue engine Identifies a typed single-assignment value within one intermediate block.
ShaderNodeCompilerCatalog engine Owns an immutable compiler map; the common lowering algorithm never switches on concrete node identities.
ShaderNodeCompilerRegistry engine Owns reloadable shader node compilers through the shared candidate, rollback and retirement protocol.
ShaderNodeDescriptionContext engine Provides invocation-scoped property decoding through the complete owner serialization context.
ShaderNodeLoweringContext engine Supplies one node’s connected values and the region builder during lowering only.
ShaderNodePort engine Declares a typed shader port independently of editor presentation and backend source syntax.
ShaderRerouteNodeCompiler engine Forwards a typed connection without adding instructions or changing resource-effect order.
ShaderSampleNodeCompiler engine Samples a graph-connected texture with implicit derivatives or an explicit level of detail.
ShaderSelectNodeCompiler engine Selects between equal typed values; all producer effects remain evaluated before selection.
ShaderSourceAnalysis engine Returns a recoverable source analysis result and complete original-source dependencies.
ShaderSourceDiagnostic engine Reports a frontend problem without retaining a language-specific exception or parser.
ShaderSourceField engine Describes one immutable named structure field.
ShaderSourceFile engine Contains immutable source text supplied by the asset candidate’s controlled source resolver.
ShaderSourceFrontendCatalog engine Owns an immutable language registration snapshot for one authoring generation.
ShaderSourceFrontendRegistry engine Discovers source language providers through the shared type-generation transaction and owns their retirement.
ShaderSourceFunction engine Contains the single callable interface exported by a source asset.
ShaderSourceImplementationAnalysis engine Freezes a parsed implementation and its complete source inputs without retaining a frontend or resolver.
ShaderSourceImplementationRequest engine Identifies one explicitly selected implementation and preprocessing configuration of a source module.
ShaderSourceInclude engine Records an include resolution edge so compilation never reinterprets authoring paths against live files.
ShaderSourceModuleAnalysis engine Reports whether every supplied implementation and variant has the same callable graph interface.
ShaderSourceNodeCompiler engine Lowers a parsed function module with name-based ports and explicit aggregate/member connection alternatives.
ShaderSourceNodeDefinition engine Projects one resolved source interface into immutable graph ports without duplicating authored port declarations.
ShaderSourceParameter engine Describes one parameter parsed from a public source declaration.
ShaderSourceParameterDirection engine Declares value flow across a source function parameter.
ShaderSourcePosition engine Identifies an original source position, not a generated temporary compiler filename.
ShaderSourceRequest engine Carries the immutable inputs required to execute one shader source request.
ShaderSourceType engine Describes a language-independent function value, including aggregate members and fixed arrays.
ShaderStageInputNodeCompiler engine Reads one target-assigned stage/resource input without choosing a native variable name.
ShaderStorageType engine Describes typed storage without embedding a backend register, declaration or resource handle.
ShaderTarget engine Expands a domain’s surface contract into ordinary graph stages before source dependency capture.
ShaderTargetAttribute engine Declares the immutable identity used to select a Shader Target from an authored graph.
ShaderTargetContext engine Supplies neutral authoring data to a domain target without exposing an adapter or live asset.
ShaderTargetRegistry engine Resolves domain targets under the same generation lease as their graph expansion.
ShaderTargetUnavailableException engine Identifies an authored target that is absent from the current extension generation.
IShaderNodeCompiler Editor Defines one shader node’s typed ports and lowering; drawing belongs to a separate editor extension.
IShaderSourceFrontend Editor Parses one source language into canonical function interfaces; it does not create GPU objects.
IShaderSourceResolver Editor Reads dependencies only from the current source candidate and records their import dependencies.
ShaderGraphBindings Editor Keeps graph input edits and the material-visible parameter contract in one neutral document change.
ShaderGraphClipboard Editor Copies and pastes shader structures as detached atomic candidates, including their parameter and Pass contracts.
ShaderGraphDocument Editor Defines the native graph document protocol shared by shader import, templates and the editor.
ShaderGraphInputSettings Editor Stores a stage input node’s logical interface without native names or GPU handles.
ShaderGraphLiteral Editor Stores an exact typed value for an unconnected node input, independently of source-language syntax.
ShaderGraphNodeEffect Editor Declares whether a graph-authored function is pure or intentionally emits ordered effects.
ShaderGraphNodeInputSettings Editor Stores values supplied by callers to a graph-authored node.
ShaderGraphNodeInterface Editor Freezes the complete public interface resolved from one graph-authored node asset.
ShaderGraphNodeKind Editor Chooses whether a graph-authored node is inlined or consumed by a domain Target.
ShaderGraphNodeOutputSettings Editor Stores values returned by a graph-authored function node.
ShaderGraphNodePortDefinition Editor Declares one stable, typed port on a graph-authored node interface.
ShaderGraphNodeSettings Editor Stores graph-level identity and catalog metadata for a reusable Shader node.
ShaderGraphNodes Editor Reads and expands reusable node graphs without retaining assets or provider instances.
ShaderGraphOutput Editor Stores one stable output port’s destination, independent of adapter source syntax.
ShaderGraphPassProgram Editor References shared stage output identities from a material-selectable pass.
ShaderGraphPasteResult Editor Contains a detached paste candidate and its newly allocated node identities.
ShaderGraphPrograms Editor Edits pass-to-program references without copying computation or changing runtime render states.
ShaderGraphStageSettings Editor Stores one stage’s explicit output interface and compute dimensions inside its output node.
ShaderGraphTemplate Editor Contributes an ordinary shader graph to the shared asset creation workflow.
ShaderGraphTemplateAttribute Editor Declares immutable creation metadata for a Shader graph template.
ShaderGraphTemplates Editor Provides small backend-neutral starting documents composed exclusively of ordinary graph nodes.
ShaderGraphType Editor Persists a complete shader type as neutral native-serializable data, without extension instances.
ShaderIrBlock Editor Contains immutable ordered instructions and nested structured regions without retaining builder callbacks.
ShaderIrBuilder Editor Builds typed shader IR instructions for graph compilation.

Builds typed instructions and structured regions. No API accepts an arbitrary backend expression or complete stage source. This builder is transient and belongs to one lowering operation, never to a persisted document or runtime frame.

Builds typed shader IR instructions for graph compilation.
ShaderIrInputKind Editor Identifies the GPU interface through which a stage receives a value.
ShaderIrInstruction Editor Stores one immutable typed instruction without generated stage source or backend expressions.
ShaderIrOperation Editor Defines backend-neutral value operations; graph node IDs are not instruction opcodes.
ShaderIrOutputKind Editor Identifies where a typed stage output is written.
ShaderIrStage Editor Freezes a typed GPU stage and its explicit interface. It contains no main function, varying declarations or source expressions. Targets own stage/resource layout; adapters translate these semantics into their native language.
ShaderIrStageInput Editor Describes a stage input without embedding native declarations or expressions.
ShaderIrStageOutput Editor Describes a named block output’s GPU destination.
ShaderIrValue Editor Identifies a typed single-assignment value within one intermediate block.
ShaderNodeDescriptionContext Editor Provides invocation-scoped property decoding through the complete owner serialization context.
ShaderNodeLoweringContext Editor Supplies one node’s connected values and the region builder during lowering only.
ShaderNodePort Editor Declares a typed shader port independently of editor presentation and backend source syntax.
ShaderSourceAnalysis Editor Returns a recoverable source analysis result and complete original-source dependencies.
ShaderSourceDiagnostic Editor Reports a frontend problem without retaining a language-specific exception or parser.
ShaderSourceField Editor Describes one immutable named structure field.
ShaderSourceFile Editor Contains immutable source text supplied by the asset candidate’s controlled source resolver.
ShaderSourceFunction Editor Contains the single callable interface exported by a source asset.
ShaderSourceImplementationAnalysis Editor Freezes a parsed implementation and its complete source inputs without retaining a frontend or resolver.
ShaderSourceInclude Editor Records an include resolution edge so compilation never reinterprets authoring paths against live files.
ShaderSourceModuleAnalysis Editor Reports whether every supplied implementation and variant has the same callable graph interface.
ShaderSourceNodeDefinition Editor Projects one resolved source interface into immutable graph ports without duplicating authored port declarations.
ShaderSourceParameter Editor Describes one parameter parsed from a public source declaration.
ShaderSourceParameterDirection Editor Declares value flow across a source function parameter.
ShaderSourcePosition Editor Identifies an original source position, not a generated temporary compiler filename.
ShaderSourceRequest Editor Carries the immutable inputs required to execute one shader source request.
ShaderSourceType Editor Describes a language-independent function value, including aggregate members and fixed arrays.
ShaderStorageType Editor Describes typed storage without embedding a backend register, declaration or resource handle.
ShaderTarget Editor Expands a domain’s surface contract into ordinary graph stages before source dependency capture.
ShaderTargetAttribute Editor Declares the immutable identity used to select a Shader Target from an authored graph.
ShaderTargetContext Editor Supplies neutral authoring data to a domain target without exposing an adapter or live asset.
ShaderTargetUnavailableException Editor Identifies an authored target that is absent from the current extension generation.