module voxel.svo.pipeline

Code Map

module voxel.svo.pipeline;


//! A single SVO rendering pipeline.
class Pipeline : old.Pipeline
{
public:
	alias draw = old.Pipeline.draw;


public:
	data: Data;


public:
	this(data: Data) { }
	fn close() { }
	fn draw(input: Draw) { }
	fn doDraw(input: old.Draw) { }
	fn doDraw(state: DataBuffer) { }


protected:
	enum DataBufferSize;
	enum AtomicBufferSize;
	enum CounterBufferSize;
	enum DrawIndirectSize;
	enum DispatchIndirectSize;
	enum VoxelBufferSize;
	enum SortBufferSize;
	enum DoubleBufferSize;


protected:
	mStore: ShaderStore;
	mVAO: GLuint;
	mState: StepState;
	mTimeInit: gfx.TimeTracker;
	mTimeClose: gfx.TimeTracker;
	mSteps: Step[];
	mStart: Step[16];
}

struct Draw
{
public:
	camVP: math.Matrix4x4d;
	cullVP: math.Matrix4x4d;
	camPos: math.Point3f;
	_pad0: f32;
	cullPos: math.Point3f;
	_pad1: f32;
	targetWidth: u32;
	targetHeight: u32;
	fov: f32;
	_pad2: f32;
	objs: Entity[];
}

struct DataBuffer
{
public:
	struct Entry
	{
	public:
		xy: u32;
		zobj: u32;
		addr: u32;


	public:
		fn from(id: u32, start: u32) { }
	}

	struct PerObject
	{
	public:
		matrix: math.Matrix4x4f;
		planes: math.Planef[4];
		camPosition: math.Point3f;
		_pad0: f32;
	}


public:
	objs: PerObject[256];
	dists: f32[32];
	pointScale: f32;
	nums: u32[16];
	entries: Entry[256][16];


public:
	fn setFrom(input: Draw) { }
	fn setFrom(input: old.Draw) { }


public:
	static fn updateState(outObj: PerObject, camVp: math.Matrix4x4d, cullVp: math.Matrix4x4d, cullCamPos: math.Point3f, model: Entity) { }
}

//! 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.

class Pipeline : old.Pipeline

A single SVO rendering pipeline.