summaryrefslogtreecommitdiff
path: root/src/new_render/render_frame.c
blob: 9a95259e91e5cdb3ca95d63ff10400672618b4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


#include "render_frame.h"
#include <assert.h>
#include "logos/threadpool.h"
#include "mem.h"
#include "render.h"

Cull_Result Frame_Cull(Renderer* ren, RenderEnt* entities, size_t entity_count, Camera* camera) {
  // TODO: u32 chunk_count = Tpool_GetNumWorkers();

  arena* frame_arena = GetRenderFrameArena(ren);

  Cull_Result result = { 0 };
  result.visible_ent_indices = arena_alloc(
      frame_arena, sizeof(u32) * entity_count);  // make space for if all ents are visible

  assert((result.n_visible_objects + result.n_culled_objects == entity_count));
  return result;
}