From 5e382c2095bc4891e2952ba87609f2796f2248ad Mon Sep 17 00:00:00 2001 From: omnisci3nce Date: Sun, 28 Apr 2024 11:02:21 +1000 Subject: start porting vulkan code to new RAL --- src/renderer/render.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/renderer/render.c') diff --git a/src/renderer/render.c b/src/renderer/render.c index 034585a..799cba7 100644 --- a/src/renderer/render.c +++ b/src/renderer/render.c @@ -1,6 +1,12 @@ #include "render.h" #include #include "camera.h" +#include "log.h" +#include "ral.h" + +/** @brief Creates the pipelines built into Celeritas such as rendering static opaque geometry, + debug visualisations, immediate mode UI, etc */ +void default_pipelines_init(renderer* ren); bool renderer_init(renderer* ren) { // INFO("Renderer init"); @@ -29,12 +35,20 @@ bool renderer_init(renderer* ren) { glfwMakeContextCurrent(ren->window); + DEBUG("Start backend init"); + + gpu_backend_init("Celeritas Engine - Vulkan", window); + gpu_device_create(&ren->device); // TODO: handle errors + gpu_swapchain_create(&ren->swapchain); + // DEBUG("init graphics api backend"); // if (!gfx_backend_init(ren)) { // FATAL("Couldnt load graphics api backend"); // return false; // } + default_pipelines_init(ren); + // ren->blinn_phong = // shader_create_separate("assets/shaders/blinn_phong.vert", // "assets/shaders/blinn_phong.frag"); @@ -46,7 +60,16 @@ bool renderer_init(renderer* ren) { return true; } -void renderer_shutdown(renderer* ren) {} +void renderer_shutdown(renderer* ren) { + // gpu_device_destroy(ren->device); +} + +void default_pipelines_init(renderer* ren) { + // Static opaque geometry + // graphics_pipeline_desc gfx = { + // }; + // ren->static_opaque_pipeline = gpu_graphics_pipeline_create(); +} void render_frame_begin(renderer* ren) {} void render_frame_end(renderer* ren) {} -- cgit v1.2.3-70-g09d2