diff options
Diffstat (limited to 'src/renderer/ral.c')
-rw-r--r-- | src/renderer/ral.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/renderer/ral.c b/src/renderer/ral.c index 7d868be..4f2a999 100644 --- a/src/renderer/ral.c +++ b/src/renderer/ral.c @@ -1,5 +1,7 @@ #include "ral.h" +#include "backend_opengl.h" + size_t vertex_attrib_size(vertex_attrib_type attr) { switch (attr) { case ATTR_F32: @@ -40,3 +42,24 @@ vertex_description static_3d_vertex_description() { vertex_desc_add(&builder, "texCoords", ATTR_F32x2); return builder; } + +void backend_pools_init(arena* a, gpu_backend_pools* backend_pools) { + pipeline_layout_pool pipeline_layout_pool = + pipeline_layout_pool_create(a, MAX_PIPELINES, sizeof(gpu_pipeline_layout)); + backend_pools->pipeline_layouts = pipeline_layout_pool; + pipeline_pool pipeline_pool = pipeline_pool_create(a, MAX_PIPELINES, sizeof(gpu_pipeline)); + backend_pools->pipelines = pipeline_pool; + renderpass_pool rpass_pool = renderpass_pool_create(a, MAX_RENDERPASSES, sizeof(gpu_renderpass)); + backend_pools->renderpasses = rpass_pool; + + // context.gpu_pools; +} + +void resource_pools_init(arena* a, struct resource_pools* res_pools) { + buffer_pool buf_pool = buffer_pool_create(a, MAX_BUFFERS, sizeof(gpu_buffer)); + res_pools->buffers = buf_pool; + texture_pool tex_pool = texture_pool_create(a, MAX_TEXTURES, sizeof(gpu_texture)); + res_pools->textures = tex_pool; + + // context.resource_pools = res_pools; +}
\ No newline at end of file |