summaryrefslogtreecommitdiff
path: root/pipeline.cpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-21 21:25:22 +1100
committerquou <quou@disroot.org>2024-12-21 21:25:22 +1100
commit5bc8f90c38981045515bab04d26687f929f62ec1 (patch)
treed1d603ded306ae218e75f7eff4b69807f2a14e26 /pipeline.cpp
parent3283c6c8c32f980bd01591e441acd9c712c650ef (diff)
render a triangle
Diffstat (limited to 'pipeline.cpp')
-rw-r--r--pipeline.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/pipeline.cpp b/pipeline.cpp
index 30bf442..ce95672 100644
--- a/pipeline.cpp
+++ b/pipeline.cpp
@@ -27,3 +27,27 @@ Render_Pass& Pipeline_Builder::build_rp() {
validate_rp();
return *pass;
}
+
+void Pipeline_Builder::begin() {
+ pip = (Pipeline*)arena_alloc(arena, sizeof *pip);
+ pip->vertex_format = 0;
+ pip->shader = 0;
+}
+
+void Pipeline_Builder::shader(Shader_Id s) {
+ pip->shader = s;
+}
+
+void Pipeline_Builder::vertex_format(Vertex_Format_Id vf) {
+ pip->vertex_format = vf;
+}
+
+Pipeline& Pipeline_Builder::build() {
+ validate();
+ return *pip;
+}
+
+void Pipeline_Builder::validate() {
+ assert(pip->vertex_format);
+ assert(pip->shader);
+}