From 1a29b16aa28c454aeb05966bff1ce60a43d070f4 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Sat, 22 Jun 2019 04:19:55 +0900 Subject: [PATCH] Sketching out the structures for ray traversal tracking. --- src/ray.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ray.rs b/src/ray.rs index d2cf51f..2c7e41b 100644 --- a/src/ray.rs +++ b/src/ray.rs @@ -98,6 +98,30 @@ impl RayBatch { } } +/// A structure used for tracking traversal of a ray batch through a scene. +#[derive(Debug)] +pub struct RayStack { + lanes: Vec>, + tasks: Vec, +} + +/// A task within a RayStack. +#[derive(Debug)] +pub enum RayTask { + // A barrier represents a division when traversing into a new system. + // For example, when traversing from the top-level BVH into an object's + // local BVH. It helps with keeping track of where we're at and aids in + // debugging. + Barrier, + + // A task for handling a set of rays. + // + // Specifies the lane that the relevant ray pointers are in, and the + // starting index within that lane. The relevant pointers are always + // `&[start_idx..]` within the given lane. + Rays { lane: usize, start_idx: usize }, +} + #[derive(Debug, Copy, Clone)] pub struct Ray { pub orig: Point,