diff options
Diffstat (limited to 'pipeline.cpp')
-rw-r--r-- | pipeline.cpp | 24 |
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); +} |