diff options
author | Jacques Lucke <jacques@blender.org> | 2021-12-27 20:18:37 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-12-27 20:18:37 +0300 |
commit | 11ac276caaa6e6d42176452526af97cf972abb5f (patch) | |
tree | debf8ccbf9143cf7523de6e745cb67fee2771495 /source/blender/draw/intern | |
parent | 1c9d8fcb477c5aea5555781cc209d60da126f48f (diff) |
Cleanup: clang tidy
Use c++ headers; use nullptr; redundant `void` in parameter list;
inconsistent parameter name.
Diffstat (limited to 'source/blender/draw/intern')
4 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index 5533130212e..f8d8674f2a7 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -276,7 +276,7 @@ static GPUShader *get_subdiv_shader(int shader_type, const char *defines) /** Vertex formats used for data transfer from OpenSubdiv, and for data processing on our side. * \{ */ -static GPUVertFormat *get_uvs_format(void) +static GPUVertFormat *get_uvs_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -286,7 +286,7 @@ static GPUVertFormat *get_uvs_format(void) } /* Vertex format for `OpenSubdiv::Osd::PatchArray`. */ -static GPUVertFormat *get_patch_array_format(void) +static GPUVertFormat *get_patch_array_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -301,7 +301,7 @@ static GPUVertFormat *get_patch_array_format(void) } /* Vertex format used for the `PatchTable::PatchHandle`. */ -static GPUVertFormat *get_patch_handle_format(void) +static GPUVertFormat *get_patch_handle_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -313,7 +313,7 @@ static GPUVertFormat *get_patch_handle_format(void) } /* Vertex format used for the quad-tree nodes of the PatchMap. */ -static GPUVertFormat *get_quadtree_format(void) +static GPUVertFormat *get_quadtree_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -324,7 +324,7 @@ static GPUVertFormat *get_quadtree_format(void) /* Vertex format for `OpenSubdiv::Osd::PatchParam`, not really used, it is only for making sure * that the #GPUVertBuf used to wrap the OpenSubdiv patch param buffer is valid. */ -static GPUVertFormat *get_patch_param_format(void) +static GPUVertFormat *get_patch_param_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -334,7 +334,7 @@ static GPUVertFormat *get_patch_param_format(void) } /* Vertex format for the patches' vertices index buffer. */ -static GPUVertFormat *get_patch_index_format(void) +static GPUVertFormat *get_patch_index_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -344,7 +344,7 @@ static GPUVertFormat *get_patch_index_format(void) } /* Vertex format for the OpenSubdiv vertex buffer. */ -static GPUVertFormat *get_subdiv_vertex_format(void) +static GPUVertFormat *get_subdiv_vertex_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -355,11 +355,11 @@ static GPUVertFormat *get_subdiv_vertex_format(void) return &format; } -typedef struct CompressedPatchCoord { +struct CompressedPatchCoord { int ptex_face_index; /* UV coordinate encoded as u << 16 | v, where u and v are quantized on 16-bits. */ unsigned int encoded_uv; -} CompressedPatchCoord; +}; MINLINE CompressedPatchCoord make_patch_coord(int ptex_face_index, float u, float v) { @@ -371,7 +371,7 @@ MINLINE CompressedPatchCoord make_patch_coord(int ptex_face_index, float u, floa } /* Vertex format used for the #CompressedPatchCoord. */ -static GPUVertFormat *get_blender_patch_coords_format(void) +static GPUVertFormat *get_blender_patch_coords_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { @@ -382,7 +382,7 @@ static GPUVertFormat *get_blender_patch_coords_format(void) return &format; } -static GPUVertFormat *get_origindex_format(void) +static GPUVertFormat *get_origindex_format() { static GPUVertFormat format; if (format.attr_len == 0) { @@ -677,7 +677,7 @@ static DRWSubdivCache *mesh_batch_cache_ensure_subdiv_cache(MeshBatchCache *mbc) * reevaluations, as long as the topology does not change. * \{ */ -typedef struct DRWCacheBuildingContext { +struct DRWCacheBuildingContext { const Mesh *coarse_mesh; const SubdivToMeshSettings *settings; @@ -700,7 +700,7 @@ typedef struct DRWCacheBuildingContext { * the shaders. */ int *v_origindex; int *e_origindex; -} DRWCacheBuildingContext; +}; static bool draw_subdiv_topology_info_cb(const SubdivForeachContext *foreach_context, const int num_vertices, @@ -1037,7 +1037,7 @@ static bool draw_subdiv_build_cache(DRWSubdivCache *cache, * Common uniforms for the various shaders. * \{ */ -typedef struct DRWSubdivUboStorage { +struct DRWSubdivUboStorage { /* Offsets in the buffers data where the source and destination data start. */ int src_offset; int dst_offset; @@ -1073,7 +1073,7 @@ typedef struct DRWSubdivUboStorage { * final vertex count, depending on which compute pass we do). This is used to early out in case * of out of bond accesses as compute dispatch are of fixed size. */ uint total_dispatch_size; -} DRWSubdivUboStorage; +}; static_assert((sizeof(DRWSubdivUboStorage) % 16) == 0, "DRWSubdivUboStorage is not padded to a multiple of the size of vec4"); diff --git a/source/blender/draw/intern/draw_subdivision.h b/source/blender/draw/intern/draw_subdivision.h index f60ec7afc77..d36bfe87689 100644 --- a/source/blender/draw/intern/draw_subdivision.h +++ b/source/blender/draw/intern/draw_subdivision.h @@ -182,7 +182,7 @@ void draw_subdiv_extract_pos_nor(const DRWSubdivCache *cache, void draw_subdiv_interp_custom_data(const DRWSubdivCache *cache, struct GPUVertBuf *src_data, - struct GPUVertBuf *dst_buffer, + struct GPUVertBuf *dst_data, int dimensions, int dst_offset); diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc index eef64085c95..0b4172dfb28 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc @@ -109,7 +109,7 @@ static void mesh_render_data_vert_flag(const MeshRenderData *mr, } } -static GPUVertFormat *get_edit_data_format(void) +static GPUVertFormat *get_edit_data_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc index ea7810bcf6b..a0307b9b2cd 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc @@ -71,7 +71,7 @@ static void init_vcol_format(GPUVertFormat *format, /* Vertex format for vertex colors, only used during the coarse data upload for the subdivision * case. */ -static GPUVertFormat *get_coarse_vcol_format(void) +static GPUVertFormat *get_coarse_vcol_format() { static GPUVertFormat format = {0}; if (format.attr_len == 0) { |