Skip to main content

Module render_graph

Module render_graph 

Source
Expand description

core.render_graph: the frame a source’s renderer draws, as data (a world resource): the images it makes and the passes that make them, in order, each a program of the source’s with the role of everything it reads and writes. A consumer runs it with generic machinery: it allocates the targets, runs each pass’s programs with the bindings the pass states, and gives each role its value; it knows no game. Where a renderer’s meaning has no core role, the pass states the source’s own words (ConstantRole::Material) that the source’s lowering computed from its data.

The scene’s own draws (the G-buffer, the shadow casters, the forward and effect draws) are passes of kind PassWork::Scene. Each names the draw it makes (the source’s name for it, PassWork::Scene::draw), and the source states which materials that draw draws and through which program on each material (crate::StepBindings: the material’s core.shader_binding, another pass of it, or why none is bound): a material without a step binding for the draw is not drawn in it. Which placements it draws is every placement of such materials, only the ones that name the draw (crate::StepDraws) where the source picks them per placement, or the ones that cast shadows (ScenePlacements); a source that does not read what a draw draws says so and why (SceneMembers::NotRead); the images the draws’ frame textures are in the step (PassWork::Scene::frame) and the order it draws them in (DrawSorting) are the step’s. Everything else is a full-screen draw, a compute dispatch, a clear or a copy of the renderer’s own programs, or a slot where another feature draws (FeatureSlot). What the source’s frame draws that the graph holds no step for is named in RenderGraph::left_out.

Structs§

DepthView
A depth target as a draw binds it.
GeometryStencil
An explicit source approximation for geometry stencil before the lighting stages. A consumer writes value under write_mask wherever the view’s depth differs from far depth; lighting states whose reference is unstated use reference. The reason is always reported, never presented as an observed producer.
LightingBuffer
An externally supplied graph buffer. The selected passes must not also write it.
LightingPipeline
The part of a source graph a consumer runs between its material draws and presentation. Its programs compute in the source’s program frame (crate::shader::ProgramFrame), as its material programs do, so the G-buffer it imports is already in that frame: a consumer converts its constants by their kinds, not its images. The source selects passes; a consumer never chooses programs by their names. Multiple input views can read the same port (a source may keep two views of scene depth), but each exported meaning has one view.
Outputs
The render targets and depth a draw writes.
Region
A rectangle of a target’s texels at its mip 0: its top-left corner x, y and its width and height.
RenderBuffer
One buffer the frame makes (or keeps from the frame before): its steps write it as an unordered-access view and read it as a shader resource, the step that writes it named in the graph’s order (PassWork::Compute::buffer_writes).
RenderGraph
core.render_graph: see the module documentation.
RenderPass
One step of the frame.
RenderTarget
One image the frame makes (or keeps from the frame before).
StepsDropped
What RenderGraph::retain_steps dropped.
TargetView
One subresource range of a target.

Enums§

BufferSize
A buffer’s size.
DrawBucket
The kind of draw a scene step makes, as the source states it (what it draws is SceneMembers’s, never the kind’s).
DrawSorting
The order a scene step draws its draws in, as the source states it.
FeatureSlot
Another feature’s place in the frame.
GraphPrimitive
Geometry supplied by a render-graph consumer, in a declared local coordinate system.
Groups
How many thread groups a dispatch runs.
Items
What one run of a repeated step is for.
LightingPort
The meaning of an image at the lighting boundary, independent of engine names and register numbers.
PassWork
What a step does.
Presence
Whether a frame has a step.
Rounding
How a view-relative size that is not a whole number of texels is rounded, side by side.
Runs
How many times a step runs where the frame has it.
SceneMembers
Which surfaces a scene step’s draw draws.
ScenePlacements
Which placements a scene step draws, of the materials its draw draws.
SceneView
The view a scene step draws from.
SortKey
One key a source sorts a scene step’s draws by.
TargetFormat
How a target stores a texel.
TargetShape
A target’s shape.
TargetSize
A target’s size.
Trigger
What makes the source draw a step that only some frames have.

Type Aliases§

BufferId
A buffer’s index in RenderGraph::buffers.
TargetId
A target’s index in RenderGraph::targets.