From dfd95c6e29c25c3ad9acc3e63a790da866339015 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 11:28:19 +1100 Subject: seperate framebuffers and renderpasses; depth buffering. --- c2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'c2.cpp') diff --git a/c2.cpp b/c2.cpp index 9327727..573744e 100644 --- a/c2.cpp +++ b/c2.cpp @@ -174,12 +174,12 @@ extern "C" int entrypoint() { dev->unmap_buffer(cbuf2); } - Pipeline_Builder pb(&frame_arena); + Pipeline_Builder pb(&frame_arena, dev); pb.begin_rp(); pb.rp_target(dev->get_backbuffer(), { r, 0x00, 0xff, 0xff }); Render_Pass& pass = pb.build_rp(); - pb.begin(dev); + pb.begin(); pb.shader(shader->id); pb.vertex_format(shader->vf); pb.texture( @@ -208,6 +208,7 @@ extern "C" int entrypoint() { pb.begin_rp(); pb.rp_target(dev->get_backbuffer(), Clear_Mode::restore); + pb.rp_depth_target(dev->get_depth_target(), 1.0f); Render_Pass& pass2 = pb.build_rp(); monkey->render(dev, &frame_arena, pass2, cbuf2); -- cgit v1.2.3-54-g00ecf