summaryrefslogtreecommitdiff
path: root/pipeline.cpp
blob: 30bf442f56d09a7b0db3b108bb4aee9f430e27ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "video.hpp"

extern "C" {
#include "qstd/memory.h"
#include "qstd/plat.h"
}

Pipeline_Builder::Pipeline_Builder(Arena* arena):
	arena(arena) {}

void Pipeline_Builder::begin_rp() {
	pass = (Render_Pass*)arena_alloc(arena, sizeof *pass);
	pass->target = 0;
	pass->clear = { 0, 0, 0, 0 };
}

void Pipeline_Builder::rp_target(Texture_Id id, Colour clear) {
	pass->target = id;
	pass->clear = clear;
}

void Pipeline_Builder::validate_rp() {
	assert(pass->target);
}

Render_Pass& Pipeline_Builder::build_rp() {
	validate_rp();
	return *pass;
}