diff options
author | omnisci3nce <omniscient.oce@gmail.com> | 2024-04-28 11:02:21 +1000 |
---|---|---|
committer | omnisci3nce <omniscient.oce@gmail.com> | 2024-04-28 11:02:27 +1000 |
commit | 5e382c2095bc4891e2952ba87609f2796f2248ad (patch) | |
tree | b3a87539ec5e31083b5d9fd83e19b54bf6f59696 /src/renderer/render.c | |
parent | 411520b240446f878a27c5d89812000774cc3c15 (diff) |
start porting vulkan code to new RAL
Diffstat (limited to 'src/renderer/render.c')
-rw-r--r-- | src/renderer/render.c | 25 |
1 files changed, 24 insertions, 1 deletions
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 <glfw3.h> #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) {} |