diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-04 10:57:07 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-04 10:57:07 +1000 |
commit | a837297eab7447db797198b84fde5f29f1c992ce (patch) | |
tree | 01850c363b4b70ea9bd0e44e0378449745ab19db /src/systems/terrain.c | |
parent | c71e165e7afe563b7a65d6b994314bb403df5f04 (diff) |
simplify shader bindings a bit
Diffstat (limited to 'src/systems/terrain.c')
-rw-r--r-- | src/systems/terrain.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/systems/terrain.c b/src/systems/terrain.c index d2a9300..bde4b4d 100644 --- a/src/systems/terrain.c +++ b/src/systems/terrain.c @@ -38,8 +38,8 @@ bool Terrain_Init(Terrain_Storage* storage) { ERROR_EXIT("Failed to load shaders from disk") } - ShaderData camera_data = { .get_layout = &Binding_Camera_GetLayout }; - ShaderData terrain_data = { .get_layout = &TerrainUniforms_GetLayout }; + ShaderDataLayout camera_data = Binding_Camera_GetLayout(NULL); + ShaderDataLayout terrain_data = TerrainUniforms_GetLayout(NULL); GraphicsPipelineDesc pipeline_desc = { .debug_name = "terrain rendering pipeline", @@ -166,11 +166,10 @@ void Terrain_Draw(Terrain_Storage* storage) { .projection = proj, .viewPos = vec4(scene->camera.position.x, scene->camera.position.y, scene->camera.position.z, 1.0) }; - GPU_EncodeBindShaderData( - enc, 0, (ShaderData){ .data = &camera_data, .get_layout = &Binding_Camera_GetLayout }); + GPU_EncodeBindShaderData(enc, 0, Binding_Camera_GetLayout(&camera_data)); TerrainUniforms uniforms = { .tex_slot_1 = storage->texture }; - ShaderData terrain_data = { .data = &uniforms, .get_layout = &TerrainUniforms_GetLayout }; + ShaderDataLayout terrain_data = TerrainUniforms_GetLayout(&uniforms); GPU_EncodeBindShaderData(enc, 1, terrain_data); GPU_EncodeSetVertexBuffer(enc, storage->vertex_buffer); |