CmdRenderGraphSet
Sets a host-defined render graph for a window. The core validates the
graph and compiles an execution plan. If validation fails and fallback=true,
the core uses the default fallback graph.
Arguments
| Field | Type | Description |
|---|---|---|
windowId |
u32 |
Target window ID |
graph |
RenderGraphDesc |
Graph description payload |
Example
javascript
engine.send({
type: 'CmdRenderGraphSet',
windowId: 1,
graph: {
graphId: 'main_render',
nodes: [
{ nodeId: 'shadow_pass', passId: 'shadow', inputs: [], outputs: ['shadow_atlas'] },
{ nodeId: 'forward_pass', passId: 'forward', inputs: ['shadow_atlas'], outputs: ['hdr_color', 'depth'] },
{ nodeId: 'compose_pass', passId: 'compose', inputs: ['hdr_color'], outputs: ['swapchain'] }
],
edges: [
{ fromNodeId: 'shadow_pass', toNodeId: 'forward_pass' },
{ fromNodeId: 'forward_pass', toNodeId: 'compose_pass' }
],
resources: [
{ resId: 'shadow_atlas', kind: 'texture', desc: { format: 'depth24', size: 'shadow_res' }, lifetime: 'frame' },
{ resId: 'hdr_color', kind: 'texture', desc: { format: 'rgba16f', size: 'screen' }, lifetime: 'frame' },
{ resId: 'depth', kind: 'texture', desc: { format: 'depth24', size: 'screen' }, lifetime: 'frame' },
{ resId: 'swapchain', kind: 'attachment', desc: { format: 'swapchain' }, lifetime: 'frame' }
],
fallback: true
}
});
Response
Returns CmdResultRenderGraphSet:
| Field | Type | Description |
|---|---|---|
success |
bool |
Whether the graph was accepted |
fallbackUsed |
bool |
Whether the fallback graph was applied |
message |
String |
Status or error message |
Notes
- The graph is cached by
graphIdfor performance. - Invalid graphs never crash the core; fallback keeps rendering alive.
Documentation Vulfram Core