diff options
author | Omniscient <omniscient.oce@gmail.com> | 2024-07-11 18:03:29 +1000 |
---|---|---|
committer | Omniscient <omniscient.oce@gmail.com> | 2024-07-11 18:03:29 +1000 |
commit | 65d74bdb26af833b5380046dec204f685f745cc1 (patch) | |
tree | 6a913e8b47787fff9f4650963074ea3f8ab5de27 /src/ral | |
parent | 3103f383751a12f8a0bdb22309704f1f826d204c (diff) |
changing styles plus simplifying a bit
Diffstat (limited to 'src/ral')
-rw-r--r-- | src/ral/README.md | 5 | ||||
-rw-r--r-- | src/ral/ral_common.h | 13 | ||||
-rw-r--r-- | src/ral/ral_types.h | 5 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/ral/README.md b/src/ral/README.md new file mode 100644 index 0000000..f66b95a --- /dev/null +++ b/src/ral/README.md @@ -0,0 +1,5 @@ +# RAL + +**Render Abstraction Layer** is a thin abstraction over graphics APIs. Everything in `render` builds on top of the code in +this folder in order to be API-agnostic. It also makes writing graphics code easier as it smooths over some of the discrepancies +between APIs like texture/buffer creation and updating shader values.
\ No newline at end of file diff --git a/src/ral/ral_common.h b/src/ral/ral_common.h index bc86945..fabf264 100644 --- a/src/ral/ral_common.h +++ b/src/ral/ral_common.h @@ -4,10 +4,11 @@ #include "ral_types.h" #include "ral_impl.h" -CORE_DEFINE_HANDLE(buffer_handle); -CORE_DEFINE_HANDLE(texture_handle); -CORE_DEFINE_HANDLE(sampler_handle); -CORE_DEFINE_HANDLE(shader_handle); +CORE_DEFINE_HANDLE(BufferHandle); +CORE_DEFINE_HANDLE(TextureHandle); +CORE_DEFINE_HANDLE(SamplerHandle); +CORE_DEFINE_HANDLE(ShaderHandle); + CORE_DEFINE_HANDLE(pipeline_layout_handle); CORE_DEFINE_HANDLE(pipeline_handle); CORE_DEFINE_HANDLE(renderpass_handle); @@ -18,7 +19,7 @@ CORE_DEFINE_HANDLE(renderpass_handle); #define MAX_PIPELINES 128 #define MAX_RENDERPASSES 128 -TYPED_POOL(gpu_buffer, buffer); +TYPED_POOL(GPU_Buffer, Buffer); TYPED_POOL(gpu_texture, texture); TYPED_POOL(gpu_pipeline_layout, pipeline_layout); TYPED_POOL(gpu_pipeline, pipeline); @@ -42,4 +43,4 @@ struct resource_pools { }; void resource_pools_init(arena* a, struct resource_pools* res_pools); -// vertex_description static_3d_vertex_description();
\ No newline at end of file +// vertex_description static_3d_vertex_description(); diff --git a/src/ral/ral_types.h b/src/ral/ral_types.h index bc24d7f..a27bbd2 100644 --- a/src/ral/ral_types.h +++ b/src/ral/ral_types.h @@ -11,6 +11,9 @@ typedef struct gpu_cmd_buffer gpu_cmd_buffer; // Ready for submission typedef struct gpu_buffer gpu_buffer; typedef struct gpu_texture gpu_texture; +typedef struct GPU_Renderpass GPU_Renderpass; +typedef struct GPU_Pipeline GPU_Pipeline; + typedef enum gpu_primitive_topology { CEL_PRIMITIVE_TOPOLOGY_POINT, CEL_PRIMITIVE_TOPOLOGY_LINE, @@ -77,4 +80,4 @@ typedef struct gpu_renderpass_desc { texture_handle color_target; // for now only support one bool has_depth_stencil; texture_handle depth_stencil; -} gpu_renderpass_desc;
\ No newline at end of file +} gpu_renderpass_desc; |