Struct GraphContext
Carries all runtime state required to execute a graph or subgraph.
public struct GraphContext
- Inherited Members
Remarks
TerrainGraph builds one context per execution request. The context resolves the execution order for the requested target nodes, maps input slots to their upstream sources, tracks variable indirection, exposes external inputs, forwards argument values, and provides access to the shared DataPool.
Nodes do not inspect the serialized graph directly during execution. They query and mutate the runtime state exposed here.
Constructors
- GraphContext(GraphAsset, string[], DataPool, IDictionary<int, Args>, ExecutionProgress)
Creates a runtime execution context for a set of target nodes.
Methods
- AddExternalBuffer(string, ComputeBuffer)
Registers an external compute buffer input that can be resolved by name during execution.
- AddExternalTexture(string, RenderTexture)
Registers an external texture input that can be resolved by name during execution.
- CreateBuffer(BufferDescriptor, SlotRef, bool)
Allocates or reuses a pooled compute buffer for a node output slot.
- CreateRenderTarget(RtDescriptor, SlotRef, bool)
Allocates or reuses a pooled render texture for a node output slot.
- CreateTemporaryBuffer(BufferDescriptor, string, bool)
Allocates or reuses a temporary pooled compute buffer addressed by a caller-defined name.
- CreateTemporaryRT(RtDescriptor, string, bool)
Allocates or reuses a temporary pooled render texture addressed by a caller-defined name.
- GetArg(int)
Returns one execution argument by its well-known key.
- GetArgs()
Returns the argument table attached to this execution.
- GetBuffer(SlotRef)
Resolves a buffer-producing slot to either an external input or a pooled compute buffer.
- GetExecutionSequence()
Returns the execution sequence calculated for this context.
- GetInitialReferenceCount()
Returns the initial reference-count table computed for this execution.
- GetInputLink(SlotRef)
Resolves the upstream source for an input slot.
- GetInputLink(string, int)
Resolves the upstream source for a specific input slot identified by node and slot id.
- GetReferenceCount(SlotRef)
Returns the remaining tracked consumer count for a slot-bound pooled output.
- GetTexture(SlotRef)
Resolves a texture-producing slot to either an external input or a pooled render texture.
- GetVariable(string)
Resolves a named runtime variable to the slot that currently defines it.
- HasVariable(string)
Determines whether a named runtime variable has already been registered in this context.
- IsTargetNode(string)
Determines whether a node id belongs to the target set requested for this execution.
- LinkToInvalid(SlotRef)
Marks a slot as intentionally resolving to no valid upstream data.
- LinkToVariable(SlotRef, string)
Marks a slot as forwarding to a named variable instead of using its original upstream slot directly.
- ReleaseReference(SlotRef)
Releases one reference to the pooled output bound to a slot.
- ReleaseTemporary(string)
Releases one reference to a temporary resource identified by a custom name.
- SetCurrentProgress(float)
Updates the fine-grained progress of the node that is currently executing.
- SetExternal(SlotRef, string)
Marks a slot as reading from a named external resource instead of the internal data pool.
- SetVariable(string, SlotRef)
Registers a named variable and binds it to a slot output.