Skip to main content

RenderGraph

Struct RenderGraph 

Source
pub struct RenderGraph {
    pub targets: Vec<RenderTarget>,
    pub buffers: Vec<RenderBuffer>,
    pub passes: Vec<RenderPass>,
    pub picture: Option<TargetId>,
    pub lighting: Option<LightingPipeline>,
    pub local_shadow_atlas: Option<LocalShadowAtlas>,
    pub left_out: Vec<String>,
}
Expand description

core.render_graph: see the module documentation.

Fields§

§targets: Vec<RenderTarget>§buffers: Vec<RenderBuffer>

The buffers the frame’s own steps write and read (the light lists a compute step builds for the lighting steps).

§passes: Vec<RenderPass>§picture: Option<TargetId>

The target that holds the finished picture, before any interface the game draws over it, and before what RenderGraph::left_out names after it.

§lighting: Option<LightingPipeline>

A source-described lighting subgraph’s imports, selected passes and linear HDR handoff.

§local_shadow_atlas: Option<LocalShadowAtlas>

The layout of the frame’s local-light shadow atlas, where the source has one: the target the steps that run per face (Items::LocalShadowFaces) draw into and the shadowed lights’ steps (Items::ShadowedLights) read, its regions, faces and projection. Which lights a frame shadows is the consumer’s choice (crate::shader::LocalShadowAtlas::place).

§left_out: Vec<String>

What the source’s frame draws that the graph holds no step for, each named with why (its post-processing, where that is not traced: the picture is then the image before it). Empty where the graph holds every step.

Implementations§

Source§

impl RenderGraph

Source

pub fn check(&self) -> Result<(), String>

The targets are well formed (a size and at least one mip), and the buffers (some bytes), every view names a target and a mip it has and every buffer reference a buffer, colour and depth go to targets of their kind, a step in some frames names them, a repeated step states its counts, a scene step names its draw (the steps that make one draw drawing the same surfaces), why it does not read what the draw draws where it does not, gives each frame texture once as a target of the role’s shape and states its sort keys once each (or why it states none), what is left out is named, and the picture is a target.

Source

pub fn scene_draws(&self) -> Vec<(&str, &SceneMembers)>

The draws the scene steps make, a group’s steps’ included, each with the surfaces it draws: a draw several steps make is listed once for each.

Source

pub fn retain_steps(&mut self, keep: &dyn Fn(Entity) -> bool) -> StepsDropped

Keep the steps that draw with entities keep accepts alone; drop each other top-level step whole (a group’s steps run together, so a group goes with any of its steps). The lighting pipeline goes where it selected a dropped step, and its other selections are renumbered; the picture goes where a dropped step wrote it. The targets and buffers stay. The steps left draw what they drew: a step reading what a dropped one made reads the target as the frame leaves it, as the graph states for a step a frame does not have.

Trait Implementations§

Source§

impl Clone for RenderGraph

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RenderGraph

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for RenderGraph

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Resource for RenderGraph

Source§

fn verify(&self, w: &World) -> Result<(), String>

RenderGraph::check, and every step’s stage binding verified against its program as a material’s is, with the graph’s targets allowed as textures (a slot reads a target as the target’s shape).

Source§

fn retain_references(&mut self, keep: &dyn Fn(Entity) -> bool)

The steps that draw with an entity that left go (RenderGraph::retain_steps); the world counts them and the step bindings that named their draws (crate::Dropped).

Source§

const NAME: &'static str = "core.render_graph"

Source§

fn to_json(&self) -> Result<Option<Value>, JsonError>

Source§

fn references(&self, out: &mut Vec<Entity>)

The entities this resource refers to, appended to out. A resource holding entity references must declare every one of them and implement Resource::retain_references.
Source§

const VERSION: u32 = 1

Source§

impl Serialize for RenderGraph

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RenderGraph

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.