move arbtri under new pipeline system

This commit is contained in:
Tuomas Katajisto 2025-10-05 22:14:36 +03:00
parent fde02a1dc7
commit 0a123efc55
6 changed files with 22 additions and 23 deletions

View File

@ -379,9 +379,13 @@ draw_world_triles :: (cam: *Camera, world: *World) {
} }
draw_level_editor :: () { draw_level_editor :: () {
cam := get_level_editor_camera(); camtask := Rendering_Task_Set_Camera.{type = .SET_CAMERA, camera = get_level_editor_camera()};
draw_sky(*get_level_editor_camera(), *world.conf); add_rendering_task(camtask);
draw_world_triles(*cam, *world); skytask := Rendering_Task_Sky.{type = .SKY, worldConfig = *world.conf};
add_rendering_task(skytask);
groundtask := Rendering_Task_Ground.{type = .GROUND, world = *world};
add_rendering_task(groundtask);
// draw_world_triles(*cam, *world);
} }
draw_level_editor_ui :: (theme: *GR.Overall_Theme) { draw_level_editor_ui :: (theme: *GR.Overall_Theme) {

View File

@ -254,11 +254,12 @@ draw_material_tab :: (theme: *GR.Overall_Theme, area: GR.Rect) {
draw_trile_editor :: () { draw_trile_editor :: () {
draw_sky(*get_trile_editor_camera());
draw_trile(); draw_trile();
} }
draw_trile :: () { draw_trile :: () {
return; // @ToDo: Implement this using the new drawing commands.
if is_in_reflection_pass then return; // We don't want to double update the buffer. if is_in_reflection_pass then return; // We don't want to double update the buffer.
if editor_current_trile == null then return; if editor_current_trile == null then return;

View File

@ -138,30 +138,16 @@ frame :: () {
GR.getrect_handle_event(event); GR.getrect_handle_event(event);
} }
sgl_defaults();
sgl_matrix_mode_projection();
sgl_ortho(0.0, sapp_widthf(), sapp_heightf(), 0.0, -1.0, +1.0);
tick_ui(); tick_ui();
// This populates our render task queue. // This populates our render task queue.
if !in_editor_view then game_draw(); if !in_editor_view then game_draw();
ui_clear_mouse_occluders();
ui_pass();
draw_editor();
render(); render();
// sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = gPipelines.plane.attachments}));
// is_in_reflection_pass = true;
// draw_editor();
// is_in_reflection_pass = false;
// sg_end_pass();
// sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, swapchain = cast,force(sg_swapchain) sglue_swapchain() }));
// draw_editor();
// if !in_editor_view then game_draw();
// ui_clear_mouse_occluders();
// ui_pass();
// sg_end_pass();
// sg_commit();
input_per_frame_event_and_flag_update(); input_per_frame_event_and_flag_update();
#if MEM_DEBUG { #if MEM_DEBUG {
memory_visualizer_per_frame_update(); memory_visualizer_per_frame_update();

View File

@ -110,7 +110,6 @@ layer : s32 = 0;
flush_arb_commands :: () { flush_arb_commands :: () {
sfons_flush(state.fons); // All the text has been drawn, now flush it to the atlas. sfons_flush(state.fons); // All the text has been drawn, now flush it to the atlas.
layer = 0; layer = 0;
if debug_arb_flush then print(" --- !BEGIN FLUSH! ---- \n"); if debug_arb_flush then print(" --- !BEGIN FLUSH! ---- \n");
for arbTriState.command_list { for arbTriState.command_list {

View File

@ -72,8 +72,18 @@ backend_process_command_buckets :: () {
for render_command_buckets.main { for render_command_buckets.main {
backend_handle_command(it); backend_handle_command(it);
} }
// 3.2 Draw the UI. @ToDo: This should probably happen after post processing once we have that.
// Also, it's kind of stupid that this has it's own command system. It should be moved to using the
// same backend commands we are using for other rendering.
sgl_defaults();
sgl_matrix_mode_projection();
sgl_ortho(0.0, sapp_widthf(), sapp_heightf(), 0.0, -1.0, +1.0);
arb_tri_flush();
// End the main pass
sg_end_pass(); sg_end_pass();
sg_commit(); sg_commit();
array_reset_keeping_memory(*render_command_buckets.setup); array_reset_keeping_memory(*render_command_buckets.setup);

View File

@ -405,5 +405,4 @@ render_ui :: () {
ui_pass :: () { ui_pass :: () {
render_ui(); // Generates commands that are handled in arb_tri_flush render_ui(); // Generates commands that are handled in arb_tri_flush
arb_tri_flush();
} }