Skip to main content

ChunkCtx

Struct ChunkCtx 

Source
pub struct ChunkCtx<'a> {
    pub rd: Gd<RenderingDevice>,
    pub gpu: &'a mut ChunkGpuResources,
    pub stage: &'a mut Option<ChunkStage>,
    pub terrain: TerrainGpu,
    pub res: u32,
    pub realize_count: u32,
    pub vis_count: u32,
    pub captured: Vec<&'static str>,
    /* private fields */
}
Expand description

Production recording context for the chunk pipeline: wraps the main RenderingDevice, the chunk GPU resources, and the staged upload for this execute. Mirrors Ctx<'a> from pipeline.rs.

Fields§

§rd: Gd<RenderingDevice>§gpu: &'a mut ChunkGpuResources§stage: &'a mut Option<ChunkStage>§terrain: TerrainGpu§res: u32§realize_count: u32

Chunks to realize this execute; set by the upload node from the stage and read by the realize node to size its dispatch (count * verts_per_chunk).

§vis_count: u32

Visible instances this execute (CEL-73); set by the upload node, read by the scatter-compact node to size its dispatch (vis * capacity).

§captured: Vec<&'static str>

Timestamp labels captured this execute (for GPU timing parity with Ctx).

Implementations§

Source§

impl<'a> ChunkCtx<'a>

Source

pub fn new( rd: Gd<RenderingDevice>, gpu: &'a mut ChunkGpuResources, stage: &'a mut Option<ChunkStage>, terrain: TerrainGpu, res: u32, ) -> Self

Source

pub fn list(&mut self) -> i64

Source

pub fn close_list(&mut self)

Timestamps must sit between compute lists, so close any open list.

Source

pub fn finish(self) -> Vec<&'static str>

Close the list and capture the end marker; returns the captured labels.

Trait Implementations§

Source§

impl<'a> GraphNode<ChunkCtx<'a>> for Box<dyn ChunkNode>

Bridge the trait objects to the celestial-graph executor.

Source§

fn params_hash(&self) -> u64

Hash of the node’s own parameters; a change marks the node dirty even if no upstream resource changed.
Source§

fn record(&mut self, ctx: &mut ChunkCtx<'a>)

Record this node’s GPU work. Only called when the node is dirty.
Source§

impl RecordCtx for ChunkCtx<'_>

Source§

fn timestamp(&mut self, label: &str)

Auto Trait Implementations§

§

impl<'a> Freeze for ChunkCtx<'a>

§

impl<'a> !RefUnwindSafe for ChunkCtx<'a>

§

impl<'a> !Send for ChunkCtx<'a>

§

impl<'a> !Sync for ChunkCtx<'a>

§

impl<'a> Unpin for ChunkCtx<'a>

§

impl<'a> UnsafeUnpin for ChunkCtx<'a>

§

impl<'a> !UnwindSafe for ChunkCtx<'a>

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.