diff options
author | Omniscient <omniscient.oce@gmail.com> | 2024-05-20 10:49:57 +1000 |
---|---|---|
committer | Omniscient <omniscient.oce@gmail.com> | 2024-05-20 10:49:57 +1000 |
commit | 73d4145f46d2305f45761b8e456df692d1962dfb (patch) | |
tree | 5295c8ce5f855ca4a0f1bebe50beee80bae66682 | |
parent | c91f86bd744df6f93a93e61d030c55393fb9ef0d (diff) |
move standard vertex desc to ral.c
-rw-r--r-- | src/renderer/bind_group_layouts.h | 4 | ||||
-rw-r--r-- | src/renderer/ral.c | 8 | ||||
-rw-r--r-- | src/renderer/ral.h | 3 | ||||
-rw-r--r-- | src/renderer/standard_vertex_types.c | 11 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/renderer/bind_group_layouts.h b/src/renderer/bind_group_layouts.h index d2571ef..246d1ef 100644 --- a/src/renderer/bind_group_layouts.h +++ b/src/renderer/bind_group_layouts.h @@ -16,10 +16,10 @@ // 1. Scene / Global typedef struct bg_globals { - f32 total_time; - f32 delta_time; mat4 view; mat4 projection; + f32 total_time; + f32 delta_time; } bg_globals; // 2. Material (once per object) diff --git a/src/renderer/ral.c b/src/renderer/ral.c index 2ae7c23..7d868be 100644 --- a/src/renderer/ral.c +++ b/src/renderer/ral.c @@ -32,3 +32,11 @@ void vertex_desc_add(vertex_description* builder, const char* name, vertex_attri builder->attributes_count++; } + +vertex_description static_3d_vertex_description() { + vertex_description builder = { .debug_label = "vertex" }; + vertex_desc_add(&builder, "position", ATTR_F32x3); + vertex_desc_add(&builder, "normal", ATTR_F32x3); + vertex_desc_add(&builder, "texCoords", ATTR_F32x2); + return builder; +} diff --git a/src/renderer/ral.h b/src/renderer/ral.h index bd2d701..376898f 100644 --- a/src/renderer/ral.h +++ b/src/renderer/ral.h @@ -166,3 +166,6 @@ void gpu_backend_end_frame(); void gpu_temp_draw(size_t n_verts); // TODO: --- Compute + +// --- Helpers +vertex_description static_3d_vertex_description(); diff --git a/src/renderer/standard_vertex_types.c b/src/renderer/standard_vertex_types.c deleted file mode 100644 index 4973bf0..0000000 --- a/src/renderer/standard_vertex_types.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "ral.h" -#include "ral_types.h" -#include "render.h" - -vertex_description static_3d_vertex_description() { - vertex_description builder = { .debug_label = "vertex" }; - vertex_desc_add(&builder, "position", ATTR_F32x3); - vertex_desc_add(&builder, "normal", ATTR_F32x3); - vertex_desc_add(&builder, "texCoords", ATTR_F32x2); - return builder; -}
\ No newline at end of file |