diff options
author | Omniscient <omniscient.oce@gmail.com> | 2024-06-10 15:12:28 +1000 |
---|---|---|
committer | Omniscient <omniscient.oce@gmail.com> | 2024-06-10 15:12:28 +1000 |
commit | ae214fc4c9a1cac1969f64b2316d8ec431b33693 (patch) | |
tree | 35968674ad0f7dd9b0f655ccab44a96a62343d6a /src/renderer/static_pipeline.h | |
parent | 99f2476d7bb8479d543f080c209324c77c775737 (diff) |
default renderer pipeline
Diffstat (limited to 'src/renderer/static_pipeline.h')
-rw-r--r-- | src/renderer/static_pipeline.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/renderer/static_pipeline.h b/src/renderer/static_pipeline.h new file mode 100644 index 0000000..78f09f2 --- /dev/null +++ b/src/renderer/static_pipeline.h @@ -0,0 +1,30 @@ +#pragma once +#include "maths_types.h" +#include "defines.h" +#include "ral.h" +#include "ral_types.h" +#include "render_types.h" + +typedef struct mvp_uniforms { + mat4 model; + mat4 view; + mat4 projection; +} mvp_uniforms; +typedef struct my_shader_bind_group { + mvp_uniforms mvp; +} my_shader_bind_group; + +static shader_data_layout mvp_uniforms_layout(void* data) { + my_shader_bind_group* d = (my_shader_bind_group*)data; + bool has_data = data != NULL; + + shader_binding b1 = { .label = "mvp_uniforms", + .type = SHADER_BINDING_BYTES, + .stores_data = has_data, + .data = { .bytes = { .size = sizeof(mvp_uniforms) } } }; + + if (has_data) { + b1.data.bytes.data = &d->mvp; + } + return (shader_data_layout){ .name = "global_ubo", .bindings = { b1}, .bindings_count = 1 }; +} |