diff options
author | quou <quou@disroot.org> | 2024-12-19 19:20:50 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-19 19:22:20 +1100 |
commit | bec7a1c90f7cda0a9e7d2e2628ac69b645108dc4 (patch) | |
tree | 830660aab41d90c24302d2c64e096292b62a4394 /pipeline.cpp | |
parent | 73744341846d4e76d6910dc5a15dff6d74586e39 (diff) |
basic vulkan setup
Diffstat (limited to 'pipeline.cpp')
-rw-r--r-- | pipeline.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pipeline.cpp b/pipeline.cpp new file mode 100644 index 0000000..30bf442 --- /dev/null +++ b/pipeline.cpp @@ -0,0 +1,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; +} |