module voxel.old.pipeline

Code Map

module voxel.old.pipeline;


//! A single SVO rendering pipeline.
class Pipeline
{
public:
	name: string;


public:
	this(name: string) { }
	fn close();
	fn draw(input: Draw) { }
	fn doDraw(input: Draw);


protected:
	mTimeTrackerRoot: gfx.TimeTracker;
}

//! A SVO rendering pipeline that uses stages.
class StepPipeline : Pipeline
{
public:
	enum Kind
	{
		CubePoint,
		Points0,
		Points1,
		Raycube,
		Num,
	}


public:
	this(octTexture: GLuint, create: Create, kind: Kind) { }
	fn makePointsPipeline(b: StepsBuilder, dub: bool) { }
	fn makeRayDoublePipeline(b: StepsBuilder, old: bool) { }
	fn makeCubePointPipeline(b: StepsBuilder) { }
	fn makeRaycubePipeline(b: StepsBuilder) { }
	fn close() { }
	fn doDraw(input: Draw) { }
	fn debugCounter(src: u32) u32 { }


protected:
	mTimeTrackers: gfx.TimeTracker[];
	mOctTexture: GLuint;
	mElementsVAO: GLuint;
	mArrayVAO: GLuint;
	mIndexBuffer: GLuint;
	mAtomicBuffer: GLuint;
	mIndirectBuffer: GLuint;
	mOutputBuffers: GLuint[6];
	mSteps: Step[];
}

//! Helper class to build a rendering pipeline.
class StepsBuilder
{
public:
	s: ShaderStore;
	endLevelOfBuf: u32[6];
	tracker: BufferTracker;


public:
	this(s: ShaderStore) { }
	fn makeInit(dst: u32) InitStep { }
	fn makeList1(src: u32, powerLevels: u32, dst: u32) ListStep { }
	fn makeListDouble(src: u32, dst: u32) ListDoubleStep { }
	fn makeList2(src: u32, powerLevels: u32, distance: f32, dst1: u32, dst2: u32) ListStep { }
	fn makeCubes(src: u32) CubeStep { }
	fn makePoints(src: u32) PointsStep { }
	fn makeRayDouble(src: u32) RayDoubleStep { }
}

//! Base class for all steps in a rendering pipeline.
class Step
{
public:
	name: string;


public:
	this() { }
	fn run(state: StepState);
}

//! First step of any rendering pipeline.
class InitStep : Step
{
public:
	dst: u32;


public:
	this(dst: u32) { }
	fn run(state: StepState) { }
}

class ListStep : Step
{
public:
	dispatchShader: gfx.Shader;
	listShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, dst1: u32, dst2: u32, powerStart: u32, powerLevels: u32, distance: f32) { }
	fn run(state: StepState) { }
}

class ListDoubleStep : Step
{
public:
	dispatchShader: gfx.Shader;
	listShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, dst: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

class CubeStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

class RayStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32, powerLevels: u32) { }
	fn run(state: StepState) { }
}

class RayDoubleStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

class PointsStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

//! Input to the draw call that renders the SVO.
struct Draw
{
public:
	camMVP: math.Matrix4x4d;
	cullMVP: math.Matrix4x4d;
	camPos: math.Point3f;
	pad0: f32;
	cullPos: math.Point3f;
	pad1: f32;
	frame: u32;
	numLevels: u32;
	targetWidth: u32;
	targetHeight: u32;
	fov: f32;
}

//! Checks if we can run voxel graphics code, return null on success.
fn checkGraphics() string { }
fn checkGraphics() string

Checks if we can run voxel graphics code, return null on success.

struct Draw

Input to the draw call that renders the SVO.

class Pipeline

A single SVO rendering pipeline.

class StepPipeline : Pipeline

A SVO rendering pipeline that uses stages.

class StepsBuilder

Helper class to build a rendering pipeline.

class Step

Base class for all steps in a rendering pipeline.

class InitStep : Step

First step of any rendering pipeline.