diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-19 14:33:34 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-19 14:33:34 +1000 |
commit | 82515f9d90ac149984013f0d64c1cab37b349b29 (patch) | |
tree | 6da445874d055e3e66ab1825d4aa3bb784955fc9 /src/render | |
parent | 5359c011a08ef2e06ed54104cc16c32868ca88ff (diff) |
chore clang format + tidy
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/backends/opengl/backend_opengl.h | 8 | ||||
-rw-r--r-- | src/render/builtin_materials.h | 17 | ||||
-rw-r--r-- | src/render/ral_types.h | 2 | ||||
-rw-r--r-- | src/render/render.h | 3 | ||||
-rw-r--r-- | src/render/renderpasses.h | 8 |
5 files changed, 17 insertions, 21 deletions
diff --git a/src/render/backends/opengl/backend_opengl.h b/src/render/backends/opengl/backend_opengl.h index 8b88cf8..73a19ed 100644 --- a/src/render/backends/opengl/backend_opengl.h +++ b/src/render/backends/opengl/backend_opengl.h @@ -21,7 +21,7 @@ typedef struct gpu_pipeline_layout { } gpu_pipeline_layout; typedef struct gpu_pipeline { u32 shader_id; - gpu_renderpass* renderpass; + gpu_renderpass *renderpass; vertex_description vertex_desc; buffer_handle uniform_bindings[MAX_PIPELINE_UNIFORM_BUFFERS]; u32 uniform_count; @@ -47,13 +47,13 @@ typedef struct gpu_buffer { union { u32 vao; u32 ubo_binding_point - }; // Optional - char* name; + }; // Optional + char *name; u64 size; } gpu_buffer; typedef struct gpu_texture { u32 id; - void* pad; + void *pad; } gpu_texture; typedef struct opengl_support { diff --git a/src/render/builtin_materials.h b/src/render/builtin_materials.h index f2db5f4..b15e62e 100644 --- a/src/render/builtin_materials.h +++ b/src/render/builtin_materials.h @@ -82,7 +82,7 @@ static shader_data_layout pbr_params_shader_layout(void* data) { .data = { .bytes = { .size = sizeof(pbr_params_light_uniforms) } } }; if (has_data) { - // printf("Size %d \n", b3.data.bytes.size); + // printf("Size %d \n", b3.data.bytes.size); b1.data.bytes.data = &d->mvp_matrices; b2.data.bytes.data = &d->material; /* d->lights.viewPos = vec3(0, 1, 0); */ @@ -127,16 +127,14 @@ static shader_data_layout pbr_textured_shader_layout(void* data) { .stores_data = has_data, .data = { .bytes = { .size = sizeof(pbr_params_light_uniforms) } } }; - shader_binding b3 = {.label = "albedoMap", + shader_binding b3 = { .label = "albedoMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; - shader_binding b4 = {.label = "metallicRoughnessMap", + shader_binding b4 = { .label = "metallicRoughnessMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; - shader_binding b5 = {.label = "aoMap", - .type = SHADER_BINDING_TEXTURE, - .stores_data = has_data }; - shader_binding b6 = {.label = "normalMap", + shader_binding b5 = { .label = "aoMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; + shader_binding b6 = { .label = "normalMap", .type = SHADER_BINDING_TEXTURE, .stores_data = has_data }; @@ -149,6 +147,7 @@ static shader_data_layout pbr_textured_shader_layout(void* data) { b6.data.texture.handle = d->textures.normal_tex; } - return (shader_data_layout){ .name = "pbr_params", .bindings = { b1, b2, b3, b4, b5, b6 }, .bindings_count = 6 - }; + return (shader_data_layout){ .name = "pbr_params", + .bindings = { b1, b2, b3, b4, b5, b6 }, + .bindings_count = 6 }; } diff --git a/src/render/ral_types.h b/src/render/ral_types.h index be95902..19f6ea3 100644 --- a/src/render/ral_types.h +++ b/src/render/ral_types.h @@ -26,7 +26,6 @@ CORE_DEFINE_HANDLE(pipeline_handle); CORE_DEFINE_HANDLE(renderpass_handle); #define ABSENT_MODEL_HANDLE 999999999 - // --- Shaders & Bindings typedef enum shader_visibility { @@ -85,7 +84,6 @@ typedef struct shader_binding { } data; /** @brief can store any kind of data that we can bind to a shader / descriptor set */ } shader_binding; - void print_shader_binding(shader_binding b); /** @brief A list of bindings that describe what data a shader / pipeline expects diff --git a/src/render/render.h b/src/render/render.h index f0e9a64..313b14c 100644 --- a/src/render/render.h +++ b/src/render/render.h @@ -69,7 +69,6 @@ texture_handle texture_data_upload(texture_data data, bool free_on_upload); material pbr_material_load(char* albedo_path, char* normal_path, bool metal_roughness_combined, char* metallic_path, char* roughness_map, char* ao_map); - /** * @brief Creates buffers and returns a struct that holds handles to our resources * @@ -79,7 +78,7 @@ material pbr_material_load(char* albedo_path, char* normal_path, bool metal_roug * @return mesh */ mesh mesh_create(geometry_data* geometry, bool free_on_upload); -void mesh_delete(mesh* mesh); // TODO +void mesh_delete(mesh* mesh); // TODO void draw_mesh(mesh* mesh, mat4* model, camera* cam); diff --git a/src/render/renderpasses.h b/src/render/renderpasses.h index 5a5ffee..1ceea6c 100644 --- a/src/render/renderpasses.h +++ b/src/render/renderpasses.h @@ -23,7 +23,6 @@ gpu_renderpass* renderpass_blinn_phong_create(); void renderpass_blinn_phong_execute(gpu_renderpass* pass, render_entity* entities, size_t entity_count); - typedef struct ren_shadowmaps { u32 width; u32 height; @@ -41,11 +40,11 @@ typedef struct lightspace_tf_uniform { } lightspace_tf_uniform; typedef struct debug_quad_uniform { - texture_handle depthMap; + texture_handle depthMap; } debug_quad_uniform; shader_data_layout model_uniform_layout(void* data); -shader_data_layout lightspace_uniform_layout(void* data); +shader_data_layout lightspace_uniform_layout(void* data); shader_data_layout debug_quad_layout(void* data); void ren_shadowmaps_init(ren_shadowmaps* storage); @@ -53,4 +52,5 @@ void ren_shadowmaps_init(ren_shadowmaps* storage); gpu_renderpass* shadowmaps_renderpass_create(); gpu_pipeline* shadowmaps_pipeline_create(gpu_renderpass* rpass); -void renderpass_shadowmap_execute(gpu_renderpass* pass, render_entity* entities, size_t entity_count); +void renderpass_shadowmap_execute(gpu_renderpass* pass, render_entity* entities, + size_t entity_count); |