module voxel.svo.steps

Code Map

module voxel.svo.steps;


class Step
{
public:
	baseIndex: u32;
	counterIndex: u32;
	finalLevel: u32;


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

class DummyStep : Step
{
public:
	this(baseIndex: u32, counterIndex: u32, finalLevel: u32) { }
	fn run(state: StepState) { }
}

class InitStep : Step
{
public:
	this(baseIndex: u32, counterIndex: u32) { }
	fn run(state: StepState) { }
}

class BaseWalkStep : Step
{
public:
	src: Step;
	shader: gfx.Shader;
	timeTracker: gfx.TimeTracker;


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

class FrustumStep : BaseWalkStep
{
public:
	this(store: ShaderStore, src: Step, baseIndex: u32, counterIndex: u32, powerLevels: u32) { }
}

class SplitStep : BaseWalkStep
{
public:
	this(store: ShaderStore, src: Step, baseIndex: u32, counterIndex: u32, splitIndex: u32) { }
}

class SortToDoubleToPointStep : BaseWalkStep
{
public:
	doubleTime: gfx.TimeTracker;
	doubleShader: gfx.Shader;
	pointsTime: gfx.TimeTracker;
	pointsShader: gfx.Shader;


public:
	this(store: ShaderStore, src: Step, baseIndex: u32) { }
	fn run(state: StepState) { }
}

class SortToDoubleToCubeStep : BaseWalkStep
{
public:
	doubleTime: gfx.TimeTracker;
	doubleShader: gfx.Shader;
	dispatchShader: gfx.Shader;
	cubesTime: gfx.TimeTracker;
	cubesShader: gfx.Shader;


public:
	this(store: ShaderStore, src: Step, baseIndex: u32) { }
	fn run(state: StepState) { }
}

//! Helper class to make shaders.
struct ResourceTracker
{
public:
	store: ShaderStore;
	baseIndex: u32;
	counterIndex: u32;
	steps: Step[];


public:
	fn addInit(s: Step) { }
	fn addFrustum(s: Step, src: Step, powerLevels: u32) { }
	fn addSplit(s: Step, o: Step, src: Step, splitIndex: u32) { }
	fn addSortToDoubleToPoint(src: Step) { }
	fn addSortToDoubleToCube(src: Step) { }
	fn makeDummy(s: Step, finalLevel: u32) { }
}

//! The state that is passed to each step when we are running the
//! pipeline.
struct StepState
{
public:
	enum VoxelBufferStepSize;
	enum CountersBufferBinding;
	enum DataBufferBinding;
	enum VoxelBufferBinding;
	enum SortBufferBinding;
	enum DoubleBufferBinding;
	enum DrawIndirectBinding;


public:
	voxelBuffer: GLuint;
	sortBuffer: GLuint;
	doubleBuffer: GLuint;
	dataBuffer: GLuint;
	atomicBuffer: GLuint;
	countersBuffer: GLuint;
	drawIndirectBuffer: GLuint;
	computeIndirectBuffer: GLuint;
}
struct ResourceTracker

Helper class to make shaders.

struct StepState

The state that is passed to each step when we are running the pipeline.