From 5bc8f90c38981045515bab04d26687f929f62ec1 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 21 Dec 2024 21:25:22 +1100 Subject: render a triangle --- pipeline.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'pipeline.cpp') 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); +} -- cgit v1.2.3-54-g00ecf